Bläddra i källkod

Updated per discussion

main
Mike S 5 år sedan
förälder
incheckning
4616023c08
2 ändrade filer med 6 tillägg och 15 borttagningar
  1. +2
    -11
      examples/JoystickBT/JoystickBT.ino
  2. +4
    -4
      joystick.cpp

+ 2
- 11
examples/JoystickBT/JoystickBT.ino Visa fil

@@ -51,19 +51,10 @@ uint8_t last_bdaddr[6] = {0, 0, 0, 0, 0, 0};

void setup()
{
/* Serial4.begin( 1843200 );
debBegin_tt( &Serial4, LED_BUILTIN, 12);
debTraceShow_tt( -1, "", "", "" );
Serial4.println("\n" __FILE__ " " __DATE__ " " __TIME__);
Serial4.println("\n********\n T4 connected Serial1 *******\n");
Serial4.println("\n" __FILE__ " " __DATE__ " " __TIME__);
Serial4.println("\n********\n T4 connected Serial4 *******\n");
*/

Serial1.begin(2000000);
while (!Serial) ; // wait for Arduino Serial Monitor
//debTraceShow_tt( -2, "", "", "" );
//Serial4.println("\n" __FILE__ " " __DATE__ " " __TIME__);
//Serial1.begin( 1843200 );

Serial.println("\n\nUSB Host Testing");
Serial.println(sizeof(USBHub), DEC);
myusb.begin();

+ 4
- 4
joystick.cpp Visa fil

@@ -328,9 +328,9 @@ hidclaim_t JoystickController::claim_collection(USBHIDParser *driver, Device_t *
axis_change_notify_mask_ = (uint64_t)0xfffffffffffff3ffl; // Start off assume all bits - 10 and 11
break;
default:
additional_axis_usage_page_ = 0;
additional_axis_usage_start_ = 0;
additional_axis_usage_count_ = 0;
additional_axis_usage_page_ = 0x09;
additional_axis_usage_start_ = 0x21;
additional_axis_usage_count_ = 5;
axis_change_notify_mask_ = 0x3ff; // Start off assume only the 10 bits...
}
DBGPrintf("Claim Additional axis: %x %x %d\n", additional_axis_usage_page_, additional_axis_usage_start_, additional_axis_usage_count_);
@@ -354,7 +354,7 @@ void JoystickController::hid_input_begin(uint32_t topusage, uint32_t type, int l

void JoystickController::hid_input_data(uint32_t usage, int32_t value)
{
//DBGPrintf("Joystick: usage=%X, value=%d\n", usage, value);
DBGPrintf("Joystick: usage=%X, value=%d\n", usage, value);
uint32_t usage_page = usage >> 16;
usage &= 0xFFFF;
if (usage_page == 9 && usage >= 1 && usage <= 32) {

Laddar…
Avbryt
Spara