Browse Source

Fix USB flightsim on AVR with newer Arduino

teensy4-core
PaulStoffregen 9 years ago
parent
commit
179953284a
2 changed files with 5 additions and 5 deletions
  1. +1
    -1
      usb_flightsim/usb.c
  2. +4
    -4
      usb_flightsim/usb_api.cpp

+ 1
- 1
usb_flightsim/usb.c View File

}; };




static uint8_t PROGMEM rawhid_hid_report_desc[] = {
static const uint8_t PROGMEM rawhid_hid_report_desc[] = {
0x06, 0x1C, 0xFF, // Usage page = 0xFF1C 0x06, 0x1C, 0xFF, // Usage page = 0xFF1C
0x0A, 0x39, 0xA7, // Usage = 0xA739 0x0A, 0x39, 0xA7, // Usage = 0xA739
0xA1, 0x01, // Collection 0x01 0xA1, 0x01, // Collection 0x01

+ 4
- 4
usb_flightsim/usb_api.cpp View File

uint8_t len, buf[6]; uint8_t len, buf[6];


if (!FlightSim.enabled || !name) return; if (!FlightSim.enabled || !name) return;
len = strlen_P((const prog_char*)name);
len = strlen_P((const char *)name);
buf[0] = len + 6; buf[0] = len + 6;
buf[1] = 1; buf[1] = 1;
buf[2] = id; buf[2] = id;
uint8_t len, buf[6]; uint8_t len, buf[6];


if (!FlightSim.enabled || !name) return; if (!FlightSim.enabled || !name) return;
len = strlen_P((const prog_char*)name);
len = strlen_P((const char *)name);
buf[0] = len + 6; buf[0] = len + 6;
buf[1] = 1; buf[1] = 1;
buf[2] = id; buf[2] = id;
uint8_t len, buf[6]; uint8_t len, buf[6];


if (!FlightSim.enabled || !name) return; if (!FlightSim.enabled || !name) return;
len = strlen_P((const prog_char*)name);
len = strlen_P((const char *)name);
buf[0] = len + 6; buf[0] = len + 6;
buf[1] = 1; buf[1] = 1;
buf[2] = id; buf[2] = id;
void FlightSimClass::xmit(const uint8_t *p1, uint8_t n1, const _XpRefStr_ *p2, uint8_t n2) void FlightSimClass::xmit(const uint8_t *p1, uint8_t n1, const _XpRefStr_ *p2, uint8_t n2)
{ {
uint8_t intr_state, total, avail; uint8_t intr_state, total, avail;
const prog_char *s2 = (const prog_char *)p2;
const char *s2 = (const char *)p2;


total = n1 + n2; total = n1 + n2;
if (total > FLIGHTSIM_TX_SIZE) return; if (total > FLIGHTSIM_TX_SIZE) return;

Loading…
Cancel
Save