X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Fgoodfet.c;h=4ed467e9231beadbff88c9454a3cd8d5e2bbc032;hp=e75bda523e6e501dbe2e6ba66875dbb713ee9266;hb=d0798f2be465edde4181142393359297e745d39c;hpb=69539bb167246135b1bde3c55dca7d19bc3c7aee diff --git a/firmware/goodfet.c b/firmware/goodfet.c index e75bda5..4ed467e 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,15 +101,17 @@ 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 init(); txstring(MONITOR,OK,"http://goodfet.sf.net/"); - #ifdef ECHOTEST - while(1) serial0_tx(serial0_rx()); - #endif + //txstring(0xab,0xcd,"http://goodfet.sf.net/"); + //Command loop. There's no end! while(1) @@ -125,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; @@ -147,11 +157,11 @@ int main(void) { reset_count = 0; } - + verb = serial_rx(); len = rxword(); - //Read data, looking for buffer overflow.y + //Read data, looking for buffer overflow. if(len <= CMDDATALEN) { for(i = 0; i < len; i++)