Skip to content

Commit

Permalink
Added some comments and advanced version number.
Browse files Browse the repository at this point in the history
  • Loading branch information
RedGuyyyy committed Jan 20, 2018
1 parent d78c331 commit 8cbc42f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/config
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions src/usbinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8cbc42f

Please sign in to comment.