ESP32C3 - Can UsbSerialJtag detect connection to terminal? #2616
Replies: 1 comment 1 reply
-
The driver should get a feature to not stall if there is nothing connected. (As you already noticed esp-println does that)
You can try this let byte = 0x80
print!("{}", byte as char); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear all,
My application requires monitoring a pin's rising edge and send ONE Byte on the serial line to a computer immediately after seeing that edge.
I am using the UsbSerialJtag for sending that byte. However, the issue is that the attempt to write a byte from UsbSerialJtag seems to crash the whole program when the C3 is not connected with a serial terminal program.
In contrast, when I use esp-print instead of UsBSerialJtag, my program functions without issues. The catch is that I don't see any way to print just 1 Byte. When I try to print for example 0x80 with print!, I saw two bytes on the serial line on the oscilloscope.
Is it possible to check the connection status of the UsBSerialJtag? So that I only send data through UsBSerialJtag if the C3 is connected.
I appreciate any insight. Thank you very much.
I attached the current implementation (esp-hal version 0.21.1) in the followings.
Beta Was this translation helpful? Give feedback.
All reactions