Thomas Stundner / Mbed 2 deprecated FWFSU_Start_mit_Displ

Dependencies:   mbed PinDetect TextLCD

Fork of FWFSU_Start_28102013 by KX-ONE

Files at this revision

API Documentation at this revision

Comitter:
fox46
Date:
Mon Aug 08 16:16:11 2016 +0000
Parent:
22:642cfa0cebcb
Child:
24:9c0151db1f98
Commit message:
asd

Changed in this revision

MsgSerial.lib Show annotated file Show diff for this revision Revisions of this file
common.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MsgSerial.lib	Mon Aug 08 14:50:44 2016 +0000
+++ b/MsgSerial.lib	Mon Aug 08 16:16:11 2016 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/KX-ONE/code/MsgSerial/#0e0163dc554f
+https://developer.mbed.org/teams/KX-ONE/code/MsgSerial/#1b6c20a97b61
--- a/common.lib	Mon Aug 08 14:50:44 2016 +0000
+++ b/common.lib	Mon Aug 08 16:16:11 2016 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/KX-ONE/code/common/#304d8d6f27e4
+https://developer.mbed.org/teams/KX-ONE/code/common/#7aa228de15bb
--- a/main.cpp	Mon Aug 08 14:50:44 2016 +0000
+++ b/main.cpp	Mon Aug 08 16:16:11 2016 +0000
@@ -131,8 +131,13 @@
     Message *m;
     char e_b[EVENT_DATA_LENGTH] = { 0 };
     
+    if (ser.available() == 0)
+        return 0;
+    
     switch (ser.msgAvailable()) {
         case MSG_AV_FLAG_NONE:
+            while (ser.available())
+                ser.getc();
             delete e;
             return 2;
         case MSG_AV_FLAG_MSG:
@@ -293,6 +298,10 @@
             break;
         case MSG_CODE_PING:
             ebus.raiseEvent(14, 0, e->timestamp, NULL);
+            break;
+        case MSG_CODE_TOTAL_RESET:
+            ebus.raiseEvent(3, 0, e->timestamp, NULL);
+            break;
     }
     
     delete e;
@@ -347,7 +356,7 @@
     pb1.setSamplesTillHeld(1000); //1000 samples ---> 1ms ---> 1 second
     pb1.setSampleFrequency(1000); //1ms
     
-    pb2.attach_asserted(&btn_pressed);
+    pb2.attach_deasserted(&btn_pressed);
     pb2.attach_deasserted_held(&btn_held_released);
     pb2.setSamplesTillHeld(200);
     pb2.setSampleFrequency();
@@ -400,6 +409,8 @@
             prev[2] = systime;
             render_time();
             display();
+            //lcd.locate(0, 1);
+            //lcd.printf("%d", systime);
         }
         if (systime - prev[1] >= ((akku_state >= AKKU_1)? RATE_LED_NOK : RATE_LED_OK)) {
             prev[1] = systime;