diff options
author | Zach Eveland <zeveland@blacklabel-development.com> | 2011-10-23 16:49:36 -0400 |
---|---|---|
committer | Zach Eveland <zeveland@blacklabel-development.com> | 2011-10-23 16:49:36 -0400 |
commit | 4f19d9bc8e4bd5c09eb21fd2e25748d5574e37c4 (patch) | |
tree | 7a45fb9da4d6bc0a2096a53ec12cb28004458849 /bootloaders/nuevo_diskloader/src/DiskLoader.cpp | |
parent | 8d5361044e84cb3e80d83e35f1946fb4f37a3079 (diff) |
bootloader responds properly now. nearly there - still have an issue with it falling out of sync after completing most operations
Diffstat (limited to 'bootloaders/nuevo_diskloader/src/DiskLoader.cpp')
-rw-r--r-- | bootloaders/nuevo_diskloader/src/DiskLoader.cpp | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/bootloaders/nuevo_diskloader/src/DiskLoader.cpp b/bootloaders/nuevo_diskloader/src/DiskLoader.cpp index 86d62e4..2f41f25 100644 --- a/bootloaders/nuevo_diskloader/src/DiskLoader.cpp +++ b/bootloaders/nuevo_diskloader/src/DiskLoader.cpp @@ -116,13 +116,14 @@ int main() _inSync = STK_INSYNC; _ok = STK_OK; + for (;;) { u8* packet = _flashbuf; u16 address = 0; for (;;) { - while (Serial.available() <= 0) + while (Serial.available() < 1) ; u8 cmd = Serial.read(); @@ -185,20 +186,42 @@ int main() USB_Send(CDC_TX, &_inSync, 1); if (send) { - u8 i; - for (i=0; i<send; i++) { -// Serial.write(0xFF); // this works -// Serial.write(*pgm + i); // this doesn't - Serial.write(pgm[i]); - } +// u8 i; +// for (i=0; i<send; i++) { +//// Serial.write(0xFF); // this works +//// Serial.write(*pgm + i); // this doesn't +// Serial.write(pgm[i]); +// } + USB_Send(CDC_TX|TRANSFER_PGM, pgm, send); } // Send ok // Serial.write(STK_OK); USB_Send(CDC_TX|TRANSFER_RELEASE, &_ok, 1); - if ('Q' == cmd) - break; +// if ('Q' == cmd) +// break; + } + } + + /* + for (;;) + { + for (;;) + { + while (Serial.available() < 1) + ; + u8 cmd = Serial.read(); + + if (cmd == '1') + { + L_LED_ON(); + } + +// USB_Send(CDC_TX, &_inSync, 1); +// +// USB_Send(CDC_TX|TRANSFER_RELEASE, &_ok, 1); } } + */ } |