File tree Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -106,29 +106,17 @@ void loop() {
106
106
iRemaining = (byte)(round ((float )100 *iBattSoc/1024 ));
107
107
iRunTimeToEmpty = (uint16_t )round ((float )iAvgTimeToEmpty*iRemaining/100 );
108
108
109
- // Charging
110
- if (bCharging)
111
- iPresentStatus.CHARGING = 1 ;
112
- else
113
- iPresentStatus.CHARGING = 0 ;
114
- if (bACPresent)
115
- iPresentStatus.ACPRESENT = 1 ;
116
- else
117
- iPresentStatus.ACPRESENT = 0 ;
118
- if (iRemaining == iFullChargeCapacity)
119
- iPresentStatus.FULLCHARGE = 1 ;
120
- else
121
- iPresentStatus.FULLCHARGE = 0 ;
109
+ // Charging
110
+ iPresentStatus.CHARGING = bCharging;
111
+ iPresentStatus.ACPRESENT = bACPresent;
112
+ iPresentStatus.FULLCHARGE = (iRemaining == iFullChargeCapacity);
122
113
123
114
// Discharging
124
115
if (bDischarging) {
125
116
iPresentStatus.DISCHARGING = 1 ;
126
117
// if(iRemaining < iRemnCapacityLimit) iPresentStatus.BELOWRCL = 1;
127
118
128
- if (iRunTimeToEmpty < iRemainTimeLimit)
129
- iPresentStatus.RTLEXPIRED = 1 ;
130
- else
131
- iPresentStatus.RTLEXPIRED = 0 ;
119
+ iPresentStatus.RTLEXPIRED = (iRunTimeToEmpty < iRemainTimeLimit);
132
120
133
121
}
134
122
else {
You can’t perform that action at this time.
0 commit comments