X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Fapps%2Fmonitor%2Fmonitor.c;h=85c523f883cfc9e074899ca72d8dd4f04265b7b1;hp=33b31c7029b1fec5f6cb5373fbac50ace32b7930;hb=f5edcbfc46dfafc434774a3e2849582be7cc6348;hpb=4de4683d6ed9abb3ce6eea37957f845d6d33243f diff --git a/firmware/apps/monitor/monitor.c b/firmware/apps/monitor/monitor.c index 33b31c7..85c523f 100644 --- a/firmware/apps/monitor/monitor.c +++ b/firmware/apps/monitor/monitor.c @@ -9,9 +9,9 @@ //! Call a function by address. int fncall(unsigned int adr){ - //TODO replace this with portable C. - //Preprocessor definition might help. - __asm__("call r15"); //r12 on IAR + int (*machfn)() = 0; + machfn= (int (*)()) adr; + return machfn(); } //! Handles a monitor command. @@ -19,6 +19,9 @@ void monitorhandle(unsigned char app, unsigned char verb, unsigned long len){ switch(verb){ + default: + debugstr("ERROR: Command unsupported by debug monitor."); + break; case PEEK: cmddata[0]=memorybyte[cmddataword[0]]; txdata(app,verb,1); @@ -86,7 +89,9 @@ void monitor_ram_pattern(){ txdata(0x00,0x90,0); //Reboot + #ifdef MSP430 asm("br &0xfffe"); + #endif } //! Return the number of contiguous bytes 0xBEEF, to measure RAM usage.