altos/stm: Always check for idle IN buffer before sending
authorKeith Packard <keithp@keithp.com>
Sun, 24 Mar 2013 22:04:57 +0000 (15:04 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 31 Mar 2013 19:24:38 +0000 (12:24 -0700)
commit8b2f211758dfa97230a730b8c4b31e0e711c19c9
treeaa3f38b7be42f6bfe250f8e83292cf0175489eac
parentde199601a177fc2d45ad9bd7357111111844d40a
altos/stm: Always check for idle IN buffer before sending

Unlike the AVR and CC1111 USB drivers, the STM usb driver queues IN
bytes in a local buffer instead of in the driver; this means that the
driver is queuing bytes while the previous IN packet is queued for the
host, which allows for overlapping execution.

It also means that when the local buffer is full, we must check to see
if the host has picked up the previous IN packet before trying to
queue another IN packet for transmission. This is done by always
waiting for the IN buffer to be ready before sending data.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm/ao_usb_stm.c