prnthp
Member
Hello
I've been having trouble receiving raw HID packets after upgrading to Teensyduino 1.4.9 or higher. I've boiled my code down to its simplest form and by simply switching from 1.4.8 to 1.4.9 or higher it hangs. It also does not respond to the magic reboot/programming packet (have to press the button to program).
It's a simple test program that blinks the LED twice if the received packet's first byte is 0xAB. On 1.4.8 it's fine.
My setup:
Thank you!
I've been having trouble receiving raw HID packets after upgrading to Teensyduino 1.4.9 or higher. I've boiled my code down to its simplest form and by simply switching from 1.4.8 to 1.4.9 or higher it hangs. It also does not respond to the magic reboot/programming packet (have to press the button to program).
It's a simple test program that blinks the LED twice if the received packet's first byte is 0xAB. On 1.4.8 it's fine.
My setup:
- Teensy 4.0 (tested on two separate boards, same issue)
- Good USB cable (tried more than one)
- macOS 10.15.3
- PlatformIO w/ platform=teensy@4.7.0 and higher for Teensyduino 1.4.9 +
- PlotformIO w/ platform=teensy@4.6.0 for Teensyduino 1.4.8
- Host side is using libusb's HIDAPI
Code:
#include <Arduino.h>
void blink(int num);
void setup()
{
delay(500); // Simulate initialization
pinMode(13, OUTPUT);
blink(1);
}
char rx_buffer[64];
void loop()
{
noInterrupts();
int n = RawHID.recv(rx_buffer, 1);
if (n > 0)
{
if (rx_buffer[0] == 0xAB) // Signature
{
blink(2);
}
}
interrupts();
}
void blink(int num)
{
for (int i = 0; i < num; i++)
{
digitalWrite(13, HIGH);
delay(50);
digitalWrite(13, LOW);
delay(50);
}
}
Thank you!