Implementation is DMA buffer based, just like the WS2811 LED Strip code,
so that there is minimal impact on flight performance.
Currently the code is mutually exclusive with the LED_STRIP code and
there is no means to set the transponder code.
The result from this mechanism is never checked, and SPI is not a bus
prone to timeouts anyway (the master generates the clock and the
transmission happens in a deterministic amount of time no matter if the
slave is cooperative, absent, or uncooperative.)
The timeout counter was set *per transfer*, and is fixed no matter what
the SPI clock speed. If the transfer size is large, and the SPI clock is
slow, stalls on the SPI bus are unavoidable (as we can generate data
faster than SPI can transmit it). These accumulate over the length of a
long transfer and trigger a "timeout". Detecting these as fatal timeouts
is not helpful.
Add begin write and end write hints. If implemented by the serial
driver, then the driver can buffer up data sent via serialWrite() and
flush it when serialEndWrite() is called.
Implemented at the buffer level as it requires the least change to how
serial_msp and serial_cli are architected.
Also tidy up the visibility in the VCP driver.
Signed-off-by: Michael Hope <mlhx@google.com>
This bulks up the writes and lets the USB VCP driver send one 20 byte
frame instead of 20 one byte frames. This speeds up the blackbox
download and makes VCP much more reliable when running under a virtual
machine.
Signed-off-by: Michael Hope <mlhx@google.com>
This lets USB send up to 32 bytes in a frame instead of 32 one byte
frames. Add a fallback for drivers that don't implement writeBuf().
Signed-off-by: Michael Hope <mlhx@google.com>
Remove LED_STRIP support from AlienWiiF3 target. It was using sparky
source but Sparky has led strip signal on a PWM motor output due to
hardware mappings and that doesn't make sense for the AlienWiiF3 target
which is has brushed motor circuitry.