Simple counter class, non-volatile between resets and power on/off.
Simple Counter class, used to store count array in non-volatile flash memory between resets and power on/off.
Diff: Counter.cpp
- Revision:
- 4:bb12605080d5
- Parent:
- 3:c15c22484205
--- a/Counter.cpp Fri Nov 16 14:51:40 2018 +0000 +++ b/Counter.cpp Fri Nov 16 14:52:41 2018 +0000 @@ -12,7 +12,7 @@ #ifdef COUNTER_DEBUG debug_out.printf("Constructing Object...\r\n"); #endif - memset(&counter, 0, MAX_LEN); + memset(&count, 0, MAX_LEN); this->init(); } @@ -91,6 +91,5 @@ #ifdef COUNTER_DEBUG debug_out.printf("Clearing stored values\r\n"); #endif - memset(&counter, 0, MAX_LEN); - memwrite(); + memset(&count, 0, MAX_LEN); } \ No newline at end of file