altos/stmf0: Add casts to reduce -Wconversion warnings. Use AO_TICK_TYPE No bugs identified. Serial timeout types updated to AO_TICK_TYPE. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Mark local functions 'static' Working towards supporting -Wmissing-prototypes Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Remove 8051 address space specifiers Signed-off-by: Keith Packard <keithp@keithp.com>
altos/stmf0: Fix up USB debug code At least make it compile. In this configuration, it's dumping out IN3 endpoint register values. Signed-off-by: Keith Packard <keithp@keithp.com>
altos/stmf0: Add IN3 alternate endpoint support This adds the code necessary to drive another IN endpoint. Signed-off-by: Keith Packard <keithp@keithp.com>
altos/stmf0: Toggle IN2 SW_BUF bit when sending data This tells the hardware we're done writing data to the second input buffer and allows it to be switched from NAK to VALID. Signed-off-by: Keith Packard <keithp@keithp.com>
add a warning about Google limiting per-day access until/unless we pay
altos/stmf0: Use double buffering for ChaosKey This improves the USB performance of ChaosKey so that it doesn't NAK during data transfers at all. Signed-off-by: Keith Packard <keithp@keithp.com>
altos/stmf0: use double buffering for USB rx data This also allows us to stop shadowing USB rx buffers in system ram Signed-off-by: Keith Packard <keithp@keithp.com>
altos/stmf0: Use double buffering for USB tx data This shouldn't have much of an effect, but shows how double buffering works. Signed-off-by: Keith Packard <keithp@keithp.com>
altos/stmf0: Stop shadowing USB tx buffers in system RAM Use the 16-bit USB memory directly, avoiding the buffer space and the copy Signed-off-by: Keith Packard <keithp@keithp.com>
altos/stmf0: Remove packet counters from non-debug build These counters are only useful for helping debug the USB driver. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Make CDC ACM 'line coding' public This allows other systems to see what baud rate the host has requested. Signed-off-by: Keith Packard <keithp@keithp.com>
altos/arm: Align data so that gcc 5.4 doesn't do byte-accesses. Add -Wcast-align Gcc 5.4.1 tracks alignment of data through assignments, so that a uint32_t pointer which comes from byte-aligned uint8_t data: extern uint8_t foo[]; uint32_t *q = (void *) foo; Fetches and stores through this pointer are done bytewise. This is slow (meh), but if q references a device register, things to bad very quickly. This patch works around this bug in the compiler by adding __attribute__((aligned(4))) tags to some variables, or changing them from uint8_t to uint32_t. Places doing this will now be caught as I've added -Wcast-align to the compiler flags. That required adding (void *) casts, after the relevant code was checked to make sure the compiler could tell that the addresses were aligned. Signed-off-by: Keith Packard <keithp@keithp.com>
Switch from GPLv2 to GPLv2+ Signed-off-by: Keith Packard <keithp@keithp.com>
altos/stmf0: Remove ao_usb_free This can't work without a lot more effort. Signed-off-by: Keith Packard <keithp@keithp.com>
altos/stmf0: Rework the sram allocation to save a few text bytes Boot loaders were going over 4096 bytes of ROM. I suspect we'll need more serious work soon. Signed-off-by: Keith Packard <keithp@keithp.com>
stmf0: Do not send more data than requested for GET_DESCRIPTOR When Linux boots, it asks for only the first 8 bytes of the device descriptor; we must limit the amount of data sent back to that amount or USB will get wedged. Signed-off-by: Keith Packard <keithp@keithp.com>
stmf0: Clear all USB state when resetting chip. Wakeup all sleepers When USB is reset, but the board is not power cycled, all of the internal USB state needs to be reset, and any tasks blocked on sending or receiving packets need to be awoken so they can go wait for USB to start running again. Signed-off-by: Keith Packard <keithp@keithp.com>
altos/stmf0: Fix build without second USB IN endpoint The code for the second IN endpoint was using the wrong ifdef. Signed-off-by: Keith Packard <keithp@keithp.com>