diff options
-rw-r--r-- | firmware/bootloaderconfig.h | 7 | ||||
-rw-r--r-- | firmware/main.c | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/firmware/bootloaderconfig.h b/firmware/bootloaderconfig.h index e6c44da..57f15f2 100644 --- a/firmware/bootloaderconfig.h +++ b/firmware/bootloaderconfig.h @@ -137,6 +137,11 @@ these macros are defined, the boot loader uses them. #define TINYVECTOR_USBPLUS_OFFSET 2 #define TINYVECTOR_OSCCAL_OFFSET 6 +/* ------------------------------------------------------------------------ */ +// postscript are the few bytes at the end of programmable memory which store tinyVectors +#define POSTSCRIPT_SIZE 6 +#define PROGMEM_SIZE (BOOTLOADER_ADDRESS - POSTSCRIPT_SIZE) /* max size of user program */ + /* ------------------------------------------------------------------------- */ /* @@ -264,7 +269,7 @@ these macros are defined, the boot loader uses them. #define LED_DDR DDRB #define LED_PORT PORTB -#define LED_PIN PB1 +#define LED_PIN PB2 #if LED_PRESENT #define LED_INIT(x) LED_PORT &=~_BV(LED_PIN); 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)); |