Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP
Fork of SystemManagement by
Diff: Libs/CoulombCounter/CoulombCounter.cpp
- Revision:
- 33:6bc82b6b62e5
- Parent:
- 30:91af74a299e1
- Child:
- 34:18bcf276d3bf
--- a/Libs/CoulombCounter/CoulombCounter.cpp Sun Nov 16 02:43:58 2014 +0000 +++ b/Libs/CoulombCounter/CoulombCounter.cpp Tue Jan 06 20:45:26 2015 +0000 @@ -16,12 +16,11 @@ if (capReg < 1.0 || capReg > 5.0) { // Bad, write default store.write(defaultAh, rtcGPREG_capacity); } - capReg = store.read(rtcGPREG_capacity); // Default SOC if blank or corrupted float Ah = store.read(rtcGPREG_counter); - if (Ah < 0 || Ah > capReg) { // Bad, write default - store.write(defaultSOC*capReg, rtcGPREG_counter); + if (Ah < 0 || Ah > defaultAh) { // Bad, write default + store.write(defaultSOC*defaultAh, rtcGPREG_counter); } // Take the initial readings, fill the buffer