Bayley Wang / Mbed 2 deprecated eeprom_emulation_446

Dependencies:   mbed

Revision:
0:2dfd987fe78d
Child:
1:1b008c088fcc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Feb 28 03:11:10 2017 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+#include "stm32f4xx_flash.h"
+#include "BREMSFlash.h"
+
+Serial pc(USBTX, USBRX);
+int x;
+
+int main() {
+    pc.baud(921600);
+    pc.printf("%s\n", "The program is running");
+    
+    FlashWriter writer(4);
+    writer.write(0, (int) -38);
+    writer.write(1, (uint32_t) 1234);
+    writer.write(2, 4.14159f);
+    writer.close();
+    
+    for(;;) {
+        pc.printf("%d %d %f\n", flashReadInt(4, 0), flashReadUint(4, 1), flashReadFloat(4, 2));
+        wait(1);
+    }
+}