Penn Electric Racing / Mbed 2 deprecated SystemManagement

Dependencies:   mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP

Fork of SystemManagement by Martin Deng

Revision:
17:c9ce210f6654
Parent:
13:fbd9b3f5a07c
--- a/CoulombCounter/RTCStore.h	Fri Oct 24 22:38:20 2014 +0000
+++ b/CoulombCounter/RTCStore.h	Sat Oct 25 03:28:55 2014 +0000
@@ -16,7 +16,7 @@
         //battery.write(10.92,4);
         printf("LPC_RTC->GPREG4:%f\n\r",battery.read(4));
     }
-*/        
+*/
 
 #ifndef _RTC_STORE_H
 #define _RTC_STORE_H
@@ -28,10 +28,10 @@
         LPC_SC->PCONP |= (1<<9);        // Enable RTC Peripheral
     }
     void write(float data, int block) {
-        *((float*)(&LPC_RTC->GPREG0)+sizeof(float)*block) = data;
+        *((float*)(&LPC_RTC->GPREG0)+block) = data;
     }
     float read(int block) {
-        return *((float*)((&LPC_RTC->GPREG0)+sizeof(float)*block));
+        return *((float*)(&LPC_RTC->GPREG0)+block);
     }              
 };
 #endif