Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Communication_Robot by
Diff: communication.cpp
- Revision:
- 1:1f6864549b92
- Parent:
- 0:0c88691e3904
- Child:
- 2:56c1de1612dd
--- a/communication.cpp	Sun Mar 01 06:28:01 2015 +0000
+++ b/communication.cpp	Sun Mar 01 08:48:23 2015 +0000
@@ -1,7 +1,7 @@
 #include "mbed.h"
 #include "communication.h"
 
-uint8_t COMMUNICATION::CommunicatePacket(ANDANTE_PROTOCOL_PACKET *packet)
+uint8_t COMMUNICATION::receiveCommunicatePacket(ANDANTE_PROTOCOL_PACKET *packet)
 {
     uint8_t currentParameter = 0;
     bool isWholePacket = false;
@@ -111,23 +111,18 @@
         }
     }
 
-#ifdef ANDANTE_DEBUG
-    pc->printf("Timer: %d ms\r\n", timer.read_ms());
-#endif
-
     timer.stop();
 
     if(!isWholePacket) {
 #ifdef ANDANTE_DEBUG
         pc->printf("Error: Read response timeout\r\n");
+        pc->printf("Timer: %d ms\r\n", timer.read_ms());
 #endif
 
         return ANDANTE_ERRBIT_READ_TIMEOUT;
     }
 
-    timer.reset();
-    timer.start();
-
+    return ANDANTE_ERRBIT_NONE;
 }
 
 COMMUNICATION::COMMUNICATION(PinName tx, PinName rx, uint32_t baudRate, uint16_t tx_buff, uint16_t rx_buff )
    