diff --git a/src/config b/src/config index 66ce5421..d8be7b77 100644 --- a/src/config +++ b/src/config @@ -1,4 +1,4 @@ CONFIG_VERSION="0.1.7e-usb-v7" -#CONFIG_FWVER=0x80000007 -CONFIG_FWVER=0x44534E53 +CONFIG_FWVER=0x80000007 +#CONFIG_FWVER=0x44534E53 CONFIG_MCU_FOSC=12000000 diff --git a/src/usbinterface.c b/src/usbinterface.c index 124396f6..c1d5a5f7 100644 --- a/src/usbinterface.c +++ b/src/usbinterface.c @@ -228,6 +228,14 @@ void usbint_set_state(unsigned open) { connected = open; } +// TODO: New Design +// - Unify interrupt handler and RAM/FILE IO +// - Add IRQ disable/enable to other code to protect against conflict +// - Need dedicated file pointer since it is retained across interrupts. +// - Figure out which operation still need to be part of the main loop (boot, reset, etc). +// - Support multiple commands in IO commands in flight. +// - Separate input/output USB IRQ disable. + // collect a flit void usbint_recv_flit(const unsigned char *in, int length) { //if (!length) return; @@ -271,6 +279,8 @@ void usbint_recv_flit(const unsigned char *in, int length) { // To avoid that we disable the handler here and let the menu loop re-enable it when we have it locked. if (!cmdDat_old && cmdDat) NVIC_DisableIRQ(USB_IRQn); + // FIXME: implement proper circular queue. + // shift extra bytes down memmove((unsigned char*)recv_buffer, recv_buffer + size, recv_buffer_offset - size); recv_buffer_offset -= size;