From d2853848057e708ac8c5d824f87020bfa3d8ae69 Mon Sep 17 00:00:00 2001 From: cpldcpu Date: Wed, 9 Oct 2013 08:41:20 +0200 Subject: tiny85FlashInit(); only checks on byte now 20 bytes less --- firmware/main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'firmware') diff --git a/firmware/main.c b/firmware/main.c index c24e8be..d0c7722 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -345,12 +345,9 @@ static inline void tiny85FlashInit(void) { // check for erased first page (no bootloader interrupt vectors), add vectors if missing // this needs to happen for usb communication to work later - essential to first run after bootloader // being installed - if(pgm_read_word(RESET_VECTOR_OFFSET * 2) != 0xC000 + (BOOTLOADER_ADDRESS/2) - 1 || - pgm_read_word(USBPLUS_VECTOR_OFFSET * 2) != 0xC000 + (BOOTLOADER_ADDRESS/2) - 1) { - - fillFlashWithVectors(); - } + if(pgm_read_byte(RESET_VECTOR_OFFSET * 2+1) == 0xff) fillFlashWithVectors(); // write vectors if flash is empty + // TODO: necessary to reset currentAddress? currentAddress = 0; } -- cgit v1.2.3