diff options
author | Zach Eveland <zeveland@blacklabel-development.com> | 2012-03-14 17:48:11 -0400 |
---|---|---|
committer | Zach Eveland <zeveland@blacklabel-development.com> | 2012-03-14 17:48:11 -0400 |
commit | 083f7c88915db70e1c41997dc9dbd94249aca4e7 (patch) | |
tree | 501064c6ee7f69ab4cc08c812479e8c71386a31a /bootloaders/caterina/Caterina.c | |
parent | cd0db83a6646717ee7fcbb5b4383bc8eac988d69 (diff) |
bugfix for Caterina not starting sketch if "verify upload" turned off in IDE.
Previously, if avrdude skipped the upload step the read while write memory might never be reenabled. This would prevent the bootloader from ending and the sketch from starting - the bootloader just continued to run even after a successful upload. Now enable RWW when we receive the AVR109 "Exit bootloader" 'E' command. Had to disable lock bit changing support in the bootloader to free up flash for the change - will anyone miss it?
Diffstat (limited to 'bootloaders/caterina/Caterina.c')
-rwxr-xr-x | bootloaders/caterina/Caterina.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bootloaders/caterina/Caterina.c b/bootloaders/caterina/Caterina.c index 0565b22..0cb9590 100755 --- a/bootloaders/caterina/Caterina.c +++ b/bootloaders/caterina/Caterina.c @@ -484,6 +484,10 @@ void CDC_Task(void) * subsequent requests */
Timeout = TIMEOUT_PERIOD - 500;
+ /* Re-enable RWW section - must be done here in case
+ * user has disabled verification on upload. */
+ boot_rww_enable_safe();
+
// Send confirmation byte back to the host
WriteNextResponseByte('\r');
}
@@ -592,6 +596,7 @@ void CDC_Task(void) }
else if ((Command == 'B') || (Command == 'g'))
{
+ // Keep resetting the timeout counter if we're receiving self-programming instructions
Timeout = 0;
// Delegate the block write/read to a separate function for clarity
ReadWriteMemoryBlock(Command);
|