Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
* to erase itself from the bootregion
*/
+#define HAVE_BLB11_SOFTW_BACKDOOR 1
+/*
+ * When "HAVE_BLB11_SOFTW_LOCKBIT" is enabled, this backdor will allow writing
+ * to the BLS while JUMPER stays low. (keeps be pressed)
+ * If JUMPER is released (and after a short debouncing period) repressing it
+ * will have NO affect on disabling the writelock.
+ */
+
#define HAVE_EEPROM_PAGED_ACCESS 1
/* If HAVE_EEPROM_PAGED_ACCESS is defined to 1, page mode access to EEPROM is
* compiled in. Whether page mode or byte mode access is used by AVRDUDE
}
}else{
uchar i;
-#if HAVE_BLB11_SOFTW_LOCKBIT
- uint8_t allowWrite;
-#endif
for(i = 0; i < len;){
#if HAVE_BLB11_SOFTW_LOCKBIT
- allowWrite = (CURRENT_ADDRESS < (addr_t)(BOOTLOADER_ADDRESS));
+ uint8_t allowWrite = (CURRENT_ADDRESS < (addr_t)(BOOTLOADER_ADDRESS));
+#if HAVE_BLB11_SOFTW_BACKDOOR
+ if ((stayinloader >= 0x10) && (bootLoaderCondition())) allowWrite=1;
+#endif
#endif
#if !HAVE_CHIP_ERASE
if((currentAddress.w[0] & (SPM_PAGESIZE - 1)) == 0){ /* if page start: erase */
}
}
#endif
- if (stayinloader > 0x10) {
+ if (stayinloader >= 0x10) {
if (!bootLoaderCondition()) {
stayinloader-=0x10;
}