From: Stephan Baerwolf Date: Tue, 31 Jul 2012 18:08:32 +0000 (+0200) Subject: bugfix: fix wrong pageerase an even save some more bytes X-Git-Tag: 2010-07-27-stephan-201207312030~1 X-Git-Url: http://git.linex4red.de/pub/USBaspLoader.git/commitdiff_plain/0b71f3c306cf078b24415e32da8c8e33092bb52d bugfix: fix wrong pageerase an even save some more bytes Signed-off-by: Stephan Baerwolf --- diff --git a/firmware/main.c b/firmware/main.c index d8386e2..ccaa445 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -306,9 +306,9 @@ uchar isLast; DBG1(0x33, 0, 0); # ifndef NO_FLASH_WRITE cli(); - boot_page_erase((currentAddress.w[0]-2) & (SPM_PAGESIZE - 1)); /* erase page */ + boot_page_erase(CURRENT_ADDRESS - 2); /* erase page */ sei(); - boot_spm_busy_wait(); /* wait until page is erased */ + boot_spm_busy_wait(); /* wait until page is erased */ # endif #endif DBG1(0x34, 0, 0);