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: CoulombCounter/RTCStore.h
- 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
