terry LAI / Mbed 2 deprecated ESDC2014-pwm

Dependencies:   mbed

Fork of ESDC2014 by terry LAI

Revision:
6:7ab57721c0fb
Parent:
5:098e6a44bd94
diff -r 098e6a44bd94 -r 7ab57721c0fb communication.cpp
--- a/communication.cpp	Fri Jul 04 16:08:29 2014 +0000
+++ b/communication.cpp	Mon Jul 07 06:10:11 2014 +0000
@@ -69,6 +69,7 @@
     info_ok_IntelToMbed = 0;
     info_ok_MbedToArduino = 0;
     
+    buzzer_type=0;
     
    
     _MSB = 0;
@@ -185,7 +186,7 @@
                 }
                 check_sum = 0;
 
-                if(_x == STARTER || _x == COMPASS_STARTER)
+                if(_x == STARTER || _x == COMPASS_STARTER || _x == BUZZER_STARTER)
                 {
                     state_IntelToMbed++;
                     forward_msg_buffer[0] = _x;
@@ -263,6 +264,7 @@
                 {
                     state_IntelToMbed++;
                     forward_msg_buffer[4] = _x;
+                    buzzer_type = _x;
                 }
                 else
                 {
@@ -511,6 +513,7 @@
             }
         }
     }
+    
     else if(action_type == 1) //lifter
     {
         uint32_t pulseCountOld = 0;
@@ -628,6 +631,9 @@
      else if(action_type == 4)
     {
         
+        
+        
+        
         putByte(BUZZER_STARTER ,1); //1 means IntelToMbed
         putByte(0,1); //O
         putByte(0,1); //K
@@ -732,4 +738,5 @@
 void Communication::clearBuffer()
 {
     _in = _out = 0;
+    memset(buffer_compass,0,BUFFER_SIZE);
 }
\ No newline at end of file