aboutsummaryrefslogtreecommitdiff
path: root/bootloaders/nuevo_diskloader/src
diff options
context:
space:
mode:
Diffstat (limited to 'bootloaders/nuevo_diskloader/src')
-rw-r--r--bootloaders/nuevo_diskloader/src/CDC.cpp2
-rw-r--r--bootloaders/nuevo_diskloader/src/DiskLoader.cpp50
2 files changed, 12 insertions, 40 deletions
diff --git a/bootloaders/nuevo_diskloader/src/CDC.cpp b/bootloaders/nuevo_diskloader/src/CDC.cpp
index 827899d..8bc4b51 100644
--- a/bootloaders/nuevo_diskloader/src/CDC.cpp
+++ b/bootloaders/nuevo_diskloader/src/CDC.cpp
@@ -140,6 +140,8 @@ int Serial_::read(void)
return c;
}
+
+
void Serial_::flush(void)
{
USB_Flush(CDC_TX);
diff --git a/bootloaders/nuevo_diskloader/src/DiskLoader.cpp b/bootloaders/nuevo_diskloader/src/DiskLoader.cpp
index 2f41f25..724a130 100644
--- a/bootloaders/nuevo_diskloader/src/DiskLoader.cpp
+++ b/bootloaders/nuevo_diskloader/src/DiskLoader.cpp
@@ -9,12 +9,12 @@ void entrypoint(void) __attribute__ ((naked)) __attribute__ ((section (".vectors
void entrypoint(void)
{
asm volatile (
-// "eor r1, r1\n" // Zero register
-// "out 0x3F, r1\n" // SREG
-// "ldi r28, 0xFF\n"
-// "ldi r29, 0x0A\n"
-// "out 0x3E, r29\n" // SPH
-// "out 0x3D, r28\n" // SPL
+ "eor r1, r1\n" // Zero register
+ "out 0x3F, r1\n" // SREG
+ "ldi r28, 0xFF\n"
+ "ldi r29, 0x0A\n"
+ "out 0x3E, r29\n" // SPH
+ "out 0x3D, r28\n" // SPL
"rjmp main" // Stack is all set up, start the main code
::);
}
@@ -26,7 +26,7 @@ volatile u16 _timeout;
void Program(u8 ep, u16 page, u8 count)
{
- u8 write = page < 30*1024; // Don't write over firmware please
+ u8 write = page < 28*1024; // Don't write over firmware please
if (write)
boot_page_erase(page);
@@ -182,46 +182,16 @@ int main()
// Check sync
if (Serial.available() > 0 && Serial.read() != ' ')
break;
-// Serial.write(STK_INSYNC);
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]);
-// }
+ if (send)
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;
- }
- }
-
- /*
- 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);
+ if ('Q' == cmd)
+ break;
}
}
- */
}