TX part for SPIRIT1, P2P application.

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
emcu
Date:
Sat Jan 06 23:17:19 2018 +0000
Parent:
0:94f11a1db3fa
Commit message:
Improve anti-debounce

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 94f11a1db3fa -r 4910fc32a71f main.cpp
--- a/main.cpp	Fri Jan 05 19:13:24 2018 +0000
+++ b/main.cpp	Sat Jan 06 23:17:19 2018 +0000
@@ -71,6 +71,8 @@
  */
 static void callback_func(int event) 
 {
+  // printf("\n\r\n\r Interrupt \n\r\n\r");
+  
   if(event == SimpleSpirit1::RX_DONE) 
   {              
     rx_done_flag = 1;
@@ -79,7 +81,7 @@
   {
     tx_done_flag = 1;
   }
-  wait_ms(10);  // Anti debounce on Blue Button
+  wait_ms(60);  // Anti debounce on Blue Button
 }
 
 /**
@@ -180,6 +182,8 @@
       tx_done_flag = false;
       printf("\r\n***Packet sent ***\r\nSent string ='%s' (len=%d)\n\r", send_buf, strlen((const char*)send_buf) + 1);
     }
+    
+    wait_ms(200);  // Anti debounce on Blue Button
   }
   
   /* unreachable */