Initial for Condor Simulator

Dependents:   USBJoystick_2 USBJoystick_NEW

Fork of USBJoystick by Wim Huiskamp

Files at this revision

API Documentation at this revision

Comitter:
Cirrus01
Date:
Sun Oct 21 11:24:24 2018 +0000
Parent:
5:fa0a30d0ef3d
Commit message:
Minor changes

Changed in this revision

USBJoystick.cpp Show annotated file Show diff for this revision Revisions of this file
USBJoystick.h Show annotated file Show diff for this revision Revisions of this file
diff -r fa0a30d0ef3d -r cefcdf03ca0e USBJoystick.cpp
--- a/USBJoystick.cpp	Sun Oct 07 14:37:43 2018 +0000
+++ b/USBJoystick.cpp	Sun Oct 21 11:24:24 2018 +0000
@@ -143,12 +143,12 @@
 
 void USBJoystick::_init()
 {
-    _x = 0;                                     // X-Axis
-    _y = 0;                                     // Y-Axis
-    _b = 0;                                     // Breaks
-    _f = 0;                                     // Wing Flaps
-    _r = 0;                                     // Rudder
-    _t = 0;                                     // Throttle
+    _x = 32767;                                     // X-Axis
+    _y = 32767;                                     // Y-Axis
+    _b = 32767;                                     // Breaks
+    _f = 32767;                                     // Wing Flaps
+    _r = 32767;                                     // Rudder
+    _t = 32767;                                     // Throttle
     _hat = 0x00;                                // POV Hat-Switches
     _buttons = 0x00000000;                      // Buttons
 }
@@ -173,8 +173,8 @@
 //                USAGE(1), 0x34,               // Ry
 //                USAGE(1), 0x35,               // Rz (Rudder on Usage Page 0x02)
 //                USAGE(1), 0x36                // Slider (Throttle on Usage Page 0x02)
-                LOGICAL_MINIMUM(2), 0x01, 0x80, // -32767 ; war 0, 0x00
-                LOGICAL_MAXIMUM(2), 0xff, 0x7f, // 32767 ; war 65536, 0xff 0xff
+                LOGICAL_MINIMUM(2), 0xff, 0x08, // war 0, 0x00, 0x80
+                LOGICAL_MAXIMUM(2), 0x00, 0x08, // war 65536, 0xff 0x7f
                 REPORT_SIZE(1), 0x10,
                 REPORT_COUNT(1), 0x04,
                 INPUT(1), 0x02,                 // Data, Variable, Absolute        
@@ -183,8 +183,8 @@
             USAGE_PAGE(1), 0x02,                // Simulation Controls
             USAGE(1), 0xBA,                     // Usage (Rudder)
             USAGE(1), 0xBB,                     // Usage (Throttle)
-            LOGICAL_MINIMUM(1), 0x00,           // 0
-            LOGICAL_MAXIMUM(2), 0xff, 0xff,     // 65536
+            LOGICAL_MINIMUM(2), 0xff, 0x08,     // 0
+            LOGICAL_MAXIMUM(2), 0x00, 0x08,     // 65536
             REPORT_SIZE(1), 0x10,
             REPORT_COUNT(1), 0x02,
             INPUT(1), 0x02,                     // Data, Variable, Absolute
diff -r fa0a30d0ef3d -r cefcdf03ca0e USBJoystick.h
--- a/USBJoystick.h	Sun Oct 07 14:37:43 2018 +0000
+++ b/USBJoystick.h	Sun Oct 21 11:24:24 2018 +0000
@@ -160,7 +160,7 @@
       */
 //     USBJoystick(uint16_t vendor_id = 0x1234, uint16_t product_id = 0x0100, uint16_t product_release = 0x0001, int waitForConnect = true):    // 4 buttons, no padding on buttons
 //     USBJoystick(uint16_t vendor_id = 0x1234, uint16_t product_id = 0x0500, uint16_t product_release = 0x0001, int waitForConnect = true):    // 8 buttons, no padding on buttons
-    USBJoystick(uint16_t vendor_id = 0x1234, uint16_t product_id = 0x0500, uint16_t product_release = 0x0005, int waitForConnect = true):    // 32 buttons, no padding on buttons
+    USBJoystick(uint16_t vendor_id = 0x4567, uint16_t product_id = 0x0500, uint16_t product_release = 0x0001, int waitForConnect = true):    // 32 buttons, no padding on buttons
         USBHID(0, 0, vendor_id, product_id, product_release, false) {
         _init();
         connect(waitForConnect);