Feng Hong / Mbed OS Nucleo_rtos_basic
Revision:
10:d1104e320de7
Parent:
9:486f65124378
Child:
11:8702316d7fc8
diff -r 486f65124378 -r d1104e320de7 main.cpp
--- a/main.cpp	Sat Apr 06 04:06:53 2019 +0000
+++ b/main.cpp	Sat Apr 06 05:11:01 2019 +0000
@@ -34,7 +34,7 @@
 #endif
 
 
-extern EEPROM ep;
+EEPROM ep(SDA,SCL,EEPROM_ADDR,EEPROM::T24C256);
 extern void eeprom_test(void);
 int init_id = 0x537;  // first 8 bit is the address
 
@@ -148,7 +148,7 @@
     //button1.mode(PullUp); // Activate pull-up
 
     button1.fall(callback(button1_onpressed_cb)); // Attach ISR to handle button press event
-//    eeprom_test();
+    eeprom_test();
 
     int idx = 0; // Just for printf below
     can_tx_data[0] = 0;
@@ -170,7 +170,6 @@
 #ifdef LCD_1602
             lcd.printf(0, 0, "%d ", idx );    //  line# (0 or 1), string
 #endif   
-            ep.read(0,ival);
             can1.write(CANMessage((init_id + idx%10), reinterpret_cast<char*>(can_tx_data), 8));            
             led1 = !led1;
             can_tx_data[0]++;