diff options
author | Jenna Fox <a@creativepony.com> | 2012-09-27 01:39:34 +1000 |
---|---|---|
committer | Jenna Fox <a@creativepony.com> | 2012-09-27 01:39:34 +1000 |
commit | 97b381f5d755080539776e59ba5e6887092cad41 (patch) | |
tree | c8c72bc8085fcbd043fefa3845780f677e7c4ab5 /firmware/main.c | |
parent | 070eab5ba108ae53d999d0366e16224b89ac0c2b (diff) | |
download | micronucleus-97b381f5d755080539776e59ba5e6887092cad41.tar.gz micronucleus-97b381f5d755080539776e59ba5e6887092cad41.tar.bz2 micronucleus-97b381f5d755080539776e59ba5e6887092cad41.zip |
Fixed severe bug in microboot.rb where final 64 byte chunk of user program wouldn't upload correctly
Diffstat (limited to 'firmware/main.c')
-rw-r--r-- | firmware/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/firmware/main.c b/firmware/main.c index 59498b7..187a8b2 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -89,7 +89,7 @@ static uchar events = 0; // bitmap of events to run #define clearEvents() events = 0 // length of bytes to write in to flash memory in upcomming usbFunctionWrite calls -static uchar writeLength; +static unsigned char writeLength; // becomes 1 when some programming happened // lets leaveBootloader know if needs to finish up the programming @@ -248,6 +248,7 @@ static uchar usbFunctionSetup(uchar data[8]) { // read in a page over usb, and write it in to the flash write buffer static uchar usbFunctionWrite(uchar *data, uchar length) { + //if (length > writeLength) length = writeLength; // test for missing final page bug writeLength -= length; do { |