STM mbed.org OSRAM team / Mbed 2 deprecated eye_r_eye-htpa32x32-v_1_9

Dependencies:   eye_r_eye-htpa32x32-v_1_8-ticker mbed

Fork of eye_r_eye-htpa32x32-v_1_8-ticker by STM mbed.org OSRAM team

Revision:
2:270ef0ab1a2e
Parent:
1:7fd5cc2052cf
--- a/main.cpp	Tue Mar 13 23:54:51 2018 +0000
+++ b/main.cpp	Thu Mar 15 13:16:22 2018 +0000
@@ -5,20 +5,16 @@
   */
 #include "heimann32x32.h"
 
-#define FIRMWARE "eye_r_eye-v_1_8-ticker"
+#define FIRMWARE "eye_r_eye-v_1_9"
 
-#define BAUDRATE 115200
-//#define BAUDRATE 230400
+//#define BAUDRATE 115200
+#define BAUDRATE 230400
 //#define PROC     HTPA_PROC_RAW
 #define PROC     (HTPA_PROC_ELOFFS  | HTPA_PROC_THOFFS)
 //#define PROC        HTPA_PROC_ELOFFS
 //#define PROC     (HTPA_PROC_ELOFFS  | HTPA_PROC_THOFFS | HTPA_PROC_CONVERT)
 
-#if BAUDRATE == 230400
-    #define HTPA_DT_MS  100 
-#elif BAUDRATE == 115200
-    #define HTPA_DT_MS  100 
-#endif
+#define HTPA_DT_MS  5
 
 I2C i2c(I2C_SDA, I2C_SCL), i2ce(I2C_SDA, I2C_SCL);
 
@@ -28,14 +24,6 @@
 
 DigitalOut led_green(LED2);
 
-Ticker tick;
-volatile bool call_htpa=0;
-void tick_set_htpa_flag( void ) 
-{
-    call_htpa = 1;
-}
-
-
 int main()
 {
     bool printme=0, print_labels=0;
@@ -58,15 +46,12 @@
     wait_ms(HTPA_DT_MS);
 
     led_green = 0;    // initializaiton complete
-    
-    // start ticker
-    tick.attach(&tick_set_htpa_flag, (float) HTPA_DT_MS *  (float) 1e-3);
-    
+
     if (h.tn != TABLENUMBER)
     {
         pc.printf("TN=%d does not match the interpolation table %d\n", h.tn, TABLENUMBER);
-//        pc.printf("Cannot continue!\n");
-//        while (1);
+        pc.printf("Cannot continue!\n");
+        while (1);
     }
         
     while (1)
@@ -173,10 +158,9 @@
                     break;
             } // switch
         }
-        if (call_htpa)
+
+        if (h.eoc())
         {
-            call_htpa=0;
-            
             led_green = 1;
             h.readb();
             led_green = 0;