The previous implementation was based on blocking calls, i.e. the
platform dependent output channel would block on a write operation and
by extension the Fibre decoder could also block when given data by an
input channel. The revised implementation in this commit is based around
a fully asynchronous (i.e. non-blocking) stream interface.
- Fix incorrect use of snprintf.
- Fix TreatPacketSinkAsStreamSink::process_bytes() quitting when being passed more than 64 bytes.
Reported in https://github.com/madcowswe/ODrive/issues/438
These bugs are not known to have an effect currently but could have
one if code somewhere else is changed.
When enabled, the USB CDC interface of the ODrive will
run the ASCII protocol instead of the native protocol.
In that case the native protocol can still be used on
endpoints 0x03, 0x83.
Truly concurrent use is not tested and thus not recommended.
When the host reset the connection without reading the response packet first, the TX-empty semaphore would never get released, thereby blocking any further TX communication. This commit just overrides the TX buffer if the semaphore wait times out.