aboutsummaryrefslogtreecommitdiff
path: root/bootloaders/nuevo_diskloader/src
diff options
context:
space:
mode:
authorZach Eveland <zeveland@blacklabel-development.com>2011-10-21 16:51:25 -0400
committerZach Eveland <zeveland@blacklabel-development.com>2011-10-21 16:51:25 -0400
commit13c5eccbe37e939350846559930edc3781a5817e (patch)
treece19865f21295cac55d32b4f13be7477e7ea4d48 /bootloaders/nuevo_diskloader/src
parent0f6498ae1dce530fe37c08e01324c391436ac77c (diff)
can now enable interrupts but EORSTE or SOFE in USB_::attach() still cause bootloader to hang
Diffstat (limited to 'bootloaders/nuevo_diskloader/src')
-rw-r--r--bootloaders/nuevo_diskloader/src/DiskLoader.cpp46
1 files changed, 22 insertions, 24 deletions
diff --git a/bootloaders/nuevo_diskloader/src/DiskLoader.cpp b/bootloaders/nuevo_diskloader/src/DiskLoader.cpp
index 5617d6a..6dda4ae 100644
--- a/bootloaders/nuevo_diskloader/src/DiskLoader.cpp
+++ b/bootloaders/nuevo_diskloader/src/DiskLoader.cpp
@@ -3,36 +3,34 @@
*/
#include "Platform.h"
-//#include "CDC.cpp"
-#include "USBAPI.h"
//extern "C"
-//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
-// "rjmp main" // Stack is all set up, start the main code
-// ::);
-//}
+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
+ "rjmp main" // Stack is all set up, start the main code
+ ::);
+}
-//ISR(BADISR_vect)
-//{
-// L_LED_ON();
-//}
+ISR(BADISR_vect)
+{
+ L_LED_ON();
+}
int main(void) __attribute__ ((naked));
int main()
{
-// /* Enable change of interrupt vectors */
-// MCUCR = (1<<IVCE);
-// /* Move interrupts to boot flash section */
-// MCUCR = (1<<IVSEL);
+ /* Enable change of interrupt vectors */
+ MCUCR = (1<<IVCE);
+ /* Move interrupts to boot flash section */
+ MCUCR = (1<<IVSEL);
wdt_disable();
BOARD_INIT();
@@ -40,7 +38,7 @@ int main()
RX_LED_OFF();
L_LED_OFF();
USB.attach();
-// sei();
+ sei();
for (;;)
{