• That's great - just a quick note though. I believe the default idle state of Serial is High, not Low (you could check with a digitalRead?). So probably you want to setWatch on the falling edge?

    rising will work, but it'll be triggering on something in the middle of the first byte, not the Start bit :)

    Is there some timestamp of last console input?

    I'm afraid not... I guess you could put the console on Loopback and manually forward any characters - then you'd know when it was busy or not.

  • I believe the default idle state of Serial is High, not Low (you could check with a digitalRead?). So probably you want to setWatch on the falling edge?

    Yes, idle TX is high and only when data is sent it goes low. However my idea was to detect when I attach serial adapter so RX on device input gets high signal from idle TX. That's why RX as GPIO input is "input_pulldown" and watch is on "rising". So Serial is initialized earlier before any data is sent. Also with this setup I can first put console to sleep (still by using the console) and then detach adapter and it does not get triggered on this falling edge.

    When serial is disabled in this way while devices are still connected then it unfortunately triggers on first change from 0 to 1 so I miss the start bit of first character, yes.

    BTW is missing _options when setup at boot time a bug? Should I make issue on github for this?

About

Avatar for Gordon @Gordon started