diff options
| -rw-r--r-- | doc/protocol | 2 | ||||
| -rw-r--r-- | fw/usb.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/doc/protocol b/doc/protocol index 2273f40..5d2cb65 100644 --- a/doc/protocol +++ b/doc/protocol @@ -1,5 +1,5 @@ <command> ::= <opcode> " " <args> "\n" -<response> ::= <retval> "\n" +<response> ::= (<retval>|"nack") "\n" Echo: <opcode> ::= "e" @@ -86,8 +86,10 @@ idleState(void) { case 'e': state.next = echoState; break; case 'w': state.next = writeEepromState; break; case 'r': state.next = readEepromState; break; - default: break; // invalid command + default: putsUSBUSART("nack\n"); break; // invalid command } + } else if (readLen > 0) { + putsUSBUSART("nack\n"); } return &state; |