You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constexprint16_t DCoffset_I{ 512 }; /**< nominal mid-point value of ADC @ x1 scale */
32
32
33
-
constexprint32_t capacityOfEnergyBucket_long{ static_cast< int32_t >(WORKING_ZONE_IN_JOULES * SUPPLY_FREQUENCY * (1.0F / powerCal_grid)) }; /**< main energy bucket for single-phase use, with units of Joules * SUPPLY_FREQUENCY */
33
+
constexprint32_t capacityOfEnergyBucket_long{ static_cast< int32_t >(WORKING_ZONE_IN_JOULES * SUPPLY_FREQUENCY * (1.0f / powerCal_grid)) }; /**< main energy bucket for single-phase use, with units of Joules * SUPPLY_FREQUENCY */
constexprint32_t lowerThreshold_default{ midPointOfEnergyBucket_long }; /**< default lower threshold for the energy bucket (50% of capacity) */
38
38
constexprint32_t upperThreshold_default{ midPointOfEnergyBucket_long }; /**< default upper threshold for the energy bucket (50% of capacity) */
39
39
40
-
constexprint32_t antiCreepLimit_inIEUperMainsCycle{ static_cast< int32_t >(ANTI_CREEP_LIMIT * (1.0F / powerCal_diverted)) }; /**< threshold value in Integer Energy Units (IEU) that prevents small measurement noise from being incorrectly registered as diverted energy */
41
-
constexprint32_t requiredExportPerMainsCycle_inIEU{ static_cast< int32_t >(REQUIRED_EXPORT_IN_WATTS * (1.0F / powerCal_grid)) }; /**< target amount of energy to be exported to the grid during each mains cycle, expressed in Integer Energy Units (IEU) */
40
+
constexprint32_t antiCreepLimit_inIEUperMainsCycle{ static_cast< int32_t >(ANTI_CREEP_LIMIT * (1.0f / powerCal_diverted)) }; /**< threshold value in Integer Energy Units (IEU) that prevents small measurement noise from being incorrectly registered as diverted energy */
41
+
constexprint32_t requiredExportPerMainsCycle_inIEU{ static_cast< int32_t >(REQUIRED_EXPORT_IN_WATTS * (1.0f / powerCal_grid)) }; /**< target amount of energy to be exported to the grid during each mains cycle, expressed in Integer Energy Units (IEU) */
42
42
// When using integer maths, calibration values that have supplied in floating point
43
43
// form need to be rescaled.
44
44
@@ -67,7 +67,7 @@ uint16_t divertedEnergyTotal_Wh{ 0 }; /**< WattHour register of 63K range */
67
67
// accumulator's value is decremented accordingly. The calculation below is to determine
68
68
// the scaling for this accumulator.
69
69
70
-
constexprint32_t IEU_per_Wh_diverted{ static_cast< int32_t >(JOULES_PER_WATT_HOUR * SUPPLY_FREQUENCY * (1.0F / powerCal_diverted)) }; // depends on powerCal, frequency & the 'sweetzone' size.
70
+
constexprint32_t IEU_per_Wh_diverted{ static_cast< int32_t >(JOULES_PER_WATT_HOUR * SUPPLY_FREQUENCY * (1.0f / powerCal_diverted)) }; // depends on powerCal, frequency & the 'sweetzone' size.
71
71
72
72
bool recentTransition{ false }; /**< a load state has been recently toggled */
73
73
uint8_t postTransitionCount{ 0 }; /**< counts the number of cycle since last transition */
0 commit comments