Martin Wolker / Mbed 2 deprecated TSCZ_ConnectorBox

Dependencies:   USBDevice mbed

Files at this revision

API Documentation at this revision

Comitter:
Neolker
Date:
Mon Sep 26 16:50:28 2016 +0000
Parent:
2:35291967fdfb
Commit message:
Some improvements of reading ROTs and initialization

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Sep 26 15:21:45 2016 +0000
+++ b/main.cpp	Mon Sep 26 16:50:28 2016 +0000
@@ -204,9 +204,7 @@
         PC.printf("ROT_%02d (PARSED DATA):\r\n", number);
     }
     t.reset();
-    if ((position != 105) || (buffer[16] == '-')) {
-        PC.printf("ROT_%02d:   0,00;   0,00; 00000000\r\n", number);
-    } else {
+    if ((position == 105) && (buffer[16] != '-')) {
         PC.printf("ROT_%02d: ", number);
         for (int i = TEMPERATURE_START; i < TEMPERATURE_END; i++) {
             if (buffer[i] == '.') {
@@ -228,6 +226,8 @@
             PC.printf("%c", buffer[k]);
         }
         PC.printf("\r\n");
+    } else {
+        PC.printf("ROT_%02d:   0,00;   0,00; 00000000\r\n", number);
     }
     if (debug) PC.printf("-------DEBUG_END--------\r\n");
 }
@@ -245,12 +245,12 @@
 
 int main(void)
 {
+    LED = 0;
+    int flag = 1;
     ROT_01.baud(ROT_SPEED);
     ROT_02.baud(ROT_SPEED);
-    int flag = 1;
-    LED = 0;
     Blink(0);
-    wait(1);
+    wait_ms(100);
     while(1) {
         if (PC.readable()) {
             switch(PC.getc()) {