FeuerSturm
Member
Hi,
I have ported my project from using TinyUSB stack and FastLED on a generic Raspberry Pi Pico to
a Teensy 4.X with using your amazing OctoWS2811 library, I've got almost everything to work perfect,
but there's one thing that nags me: the lack of being able to reliably detect the PC suspending the USB ports
Using TinyUSB allowed me to simply check for the state of the USB port with
and I desperatly need such a feature.
I asked for help on the forums already and receivedd a reply with a possible solution reading the suspend flag in the PORTSC1,
unfortunately that's not really working for me at all, using this test sketch showed that it seems to be totally random when the
onboard led turns on or off:
I have then checked the i.MX RT1060 Processor Reference Manual, Rev. 2, 12/2019 and tried everything that I could find searching for "suspend" inside it, no success at all.
I'd really love to see a callback or function to reliably check if the PC the Teensy is connected to is on or off (port suspended or not).
Thanks!
I have ported my project from using TinyUSB stack and FastLED on a generic Raspberry Pi Pico to
a Teensy 4.X with using your amazing OctoWS2811 library, I've got almost everything to work perfect,
but there's one thing that nags me: the lack of being able to reliably detect the PC suspending the USB ports
Using TinyUSB allowed me to simply check for the state of the USB port with
Code:
bool portSuspended = TinyUSBDevice.suspended();
I asked for help on the forums already and receivedd a reply with a possible solution reading the suspend flag in the PORTSC1,
unfortunately that's not really working for me at all, using this test sketch showed that it seems to be totally random when the
onboard led turns on or off:
Code:
unsigned long lastCheck;
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
}
void loop()
{
unsigned long currentMillis = millis();
if(currentMillis - lastCheck >= 1000)
{
lastCheck = currentMillis;
if(!bitRead(USB1_PORTSC1,7))
{
digitalWrite(LED_BUILTIN, HIGH);
}
else
{
digitalWrite(LED_BUILTIN, LOW);
}
}
}
I have then checked the i.MX RT1060 Processor Reference Manual, Rev. 2, 12/2019 and tried everything that I could find searching for "suspend" inside it, no success at all.
I'd really love to see a callback or function to reliably check if the PC the Teensy is connected to is on or off (port suspended or not).
Thanks!