X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Fgoodfet.c;h=6bb0f3e6338cce773bf7ab97bab97c6c0dab8304;hp=39cad44a60256e8858647b6127c63073ffe543af;hb=18cee49968e2982cccb0e1c4a579244fd5d51fb1;hpb=c2162dc13a96d38dd3097c7f9ccdf96083f85616 diff --git a/firmware/goodfet.c b/firmware/goodfet.c index 39cad44..6bb0f3e 100644 --- a/firmware/goodfet.c +++ b/firmware/goodfet.c @@ -32,6 +32,10 @@ void init(){ #define INITCHIP arduino_init(); #endif +#if (platform == donbfet) +# define INITCHIP donbfet_init(); +#endif + #ifdef INITCHIP INITCHIP #else @@ -52,7 +56,7 @@ void handle(uint8_t const app, int i; //debugstr("GoodFET"); - led_off(); + //led_off(); // find the app and call the handle fn for(i = 0; i < num_apps; i++){ @@ -97,6 +101,9 @@ int main(void) } else { // we come here after DTR high (release reset) dputs("\nWarmstart\n"); } +#elif (platform == donbfet) + extern void donbfet_reboot(void); + void (*reboot_function)(void) = donbfet_reboot; #else void (*reboot_function)(void) = (void *) 0xFFFE; #endif @@ -124,20 +131,24 @@ int main(void) // or // WDTCTL = WDTPW + WDTCNTCL + WDTSSEL + 0x00; // but instead we'll jump to our reboot function pointer - #ifdef MSP430 -#if (platform == tilaunchpad) +#ifdef MSP430 +# if (platform == tilaunchpad) // do we really need this, we do not want to reset the TUSB3410 dputs("reset_count>4\n"); //longjmp(warmstart,111); goto warmstart; -#else +# else (*reboot_function)(); -#endif - #else +# endif +#else /* !MSP430 */ +# if (platform == donbfet) + (*reboot_function)(); +# else debugstr("Rebooting not supported on this platform."); - #endif +# endif +#endif } continue;