From: Stephan Baerwolf Date: Wed, 1 Aug 2012 23:13:49 +0000 (+0200) Subject: BUGfix: fix lost bootloader-writeprotection via "HAVE_BLB11_SOFTW_LOCKBIT" X-Git-Tag: 2010-07-27-stephan-201208020130~1 X-Git-Url: http://git.linex4red.de/pub/USBaspLoader.git/commitdiff_plain/a73f84ba5ae8d7e135df5d8c1890ff681b69a00c?ds=sidebyside BUGfix: fix lost bootloader-writeprotection via "HAVE_BLB11_SOFTW_LOCKBIT" Since via commit 75d2c2e6cf042deafe21b0e9a299c2b6091fd62b this feature was accidently removed together with the removal of "HAVE_BLB11_SOFTW_BACKDOOR". This patch reverts this situation Signed-off-by: Stephan Baerwolf --- diff --git a/firmware/main.c b/firmware/main.c index b7b3f58..c3316ff 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -254,6 +254,7 @@ uchar isLast; for(i = 0; i < len;){ #if HAVE_BLB11_SOFTW_LOCKBIT if (CURRENT_ADDRESS >= (addr_t)(BOOTLOADER_ADDRESS)) { + return 1; } #endif i += 2; diff --git a/firmware/spminterface.h b/firmware/spminterface.h index dd9e100..cee4e70 100644 --- a/firmware/spminterface.h +++ b/firmware/spminterface.h @@ -103,9 +103,9 @@ ret */ #if defined (__AVR_ATmega8__) || defined (__AVR_ATmega8HVA__) //assume SPMCR==0x37, SPMEN==0x0, RWWSRE=0x4, RWWSB=0x6 -const uint16_t bootloader__do_spm[22] PROGMEM = {0x0000, 0x2dec, 0x2dfd, 0xb6b7, 0xfcb0, 0xcffd, 0xbf27, 0x95e8, 0xb6b7, +const uint16_t bootloader__do_spm[19] PROGMEM = {0x0000, 0x2dec, 0x2dfd, 0xb6b7, 0xfcb0, 0xcffd, 0xbf27, 0x95e8, 0xb6b7, 0xfcb0, 0xcffd, 0xe121, 0xb6b7, 0xfcb6, 0xcff4, 0x9508, 0xFFFF, 0xFFFF, - 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF}; + 0xFFFF}; /* 00001826 : 1826: 00 00 nop