Ries Twisk / Mbed 2 deprecated JoyStick

Dependencies:   USBDevice mbed-rtos mbed

Fork of JoyStick by Ries Twisk

Revision:
3:0742b0b42ac9
Parent:
2:ae7a31a3c618
Child:
4:2cc58c173de8
--- a/main.cpp	Fri Aug 30 01:37:49 2013 +0000
+++ b/main.cpp	Tue Feb 10 13:48:20 2015 +0000
@@ -7,7 +7,7 @@
 #include "rtos.h"
 
 // When set, it will send debug data over USB serial
-#define TTY_DEBUG
+#define TTY_DEBUG true
 
 // Value that defines when to start sending data this prevents the noise sending loads's of data over HID
 #define DATA_CHANGE_TRIGGER 64
@@ -35,7 +35,7 @@
     long value5;
 } analogData;
 
-#ifdef TTY_DEBUG
+
 
 
 /**
@@ -108,7 +108,7 @@
         Thread::wait(1000);
     }
 }
-#endif
+
 
 
 void hid_thread(void const *args)
@@ -136,7 +136,6 @@
         memcpy (&localCopy, &analogData, sizeof(AnalogData));
         analogValueMutex.unlock();
 
-        // TODO read buttons
         buttons=0;
         if (localCopy.button1==true) {
             buttons=buttons | 0x01;
@@ -177,9 +176,9 @@
     analogData.value4=0;
     analogData.value5=0;
 
-#ifdef TTY_DEBUG
-    Thread _debugThread(debug_thread);
-#endif
+    if (TTY_DEBUG) {
+        Thread _debugThread(debug_thread);
+    }    
     Thread _hid_thread(hid_thread);
 
     // Initialise moving average filters