From 7f1acb2ebd7cb8c309680af437ea8bb1ca48e4d8 Mon Sep 17 00:00:00 2001 From: cpldcpu Date: Sun, 29 Dec 2013 20:53:45 +0100 Subject: firmware: switch saves 2 bytes --- firmware/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'firmware/main.c') diff --git a/firmware/main.c b/firmware/main.c index 828ea8f..447ff20 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -299,9 +299,11 @@ int main(void) { // All events will render the MCU unresponsive to USB traffic for a while. if (command!=cmd_nop) _delay_ms(2); - if (command==cmd_erase_application) eraseApplication(); - if (command==cmd_write_page) writeFlashPage(); - + if (command==cmd_erase_application) + eraseApplication(); + else if (command==cmd_write_page) + writeFlashPage(); + /* main event loop runs as long as no problem is uploaded or existing program is not executed */ } while((command!=cmd_exit)||(pgm_read_byte(BOOTLOADER_ADDRESS - TINYVECTOR_RESET_OFFSET + 1)==0xff)); -- cgit v1.2.3