X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=firmware%2Fapps%2Fmonitor%2Fmonitor.c;h=4f36833d10d2d24d23fec4c2ca0a587ff2def804;hb=a25b880a237c5c2ee3a2639a27e558edac80f2d6;hp=701de9e353254920b4c798de8012133aa2928ad4;hpb=7254ebd4731d5c3ce94bbe4e16a5928a5089e6c4;p=goodfet diff --git a/firmware/apps/monitor/monitor.c b/firmware/apps/monitor/monitor.c index 701de9e..4f36833 100644 --- a/firmware/apps/monitor/monitor.c +++ b/firmware/apps/monitor/monitor.c @@ -7,6 +7,11 @@ #include "platform.h" #include "monitor.h" #include "builddate.h" +#if (platform == tilaunchpad) +#include +extern jmp_buf warmstart; + +#endif #define MONITOR_APP @@ -46,8 +51,8 @@ app_t const monitor_app = { //! Handles a monitor command. void monitor_handle_fn(uint8_t const app, - uint8_t const verb, - uint32_t const len) + uint8_t const verb, + uint32_t const len) { int i; @@ -58,9 +63,10 @@ void monitor_handle_fn(uint8_t const app, break; case MONITOR_ECHO: - //Echo back the same buffer. - txdata(app,verb,len); - break; + //Echo back the same buffer. + debugstr("About to monitor echo."); + txdata(app,verb,len); + break; case MONITOR_LIST_APPS: // transmit firmware build date @@ -78,14 +84,26 @@ void monitor_handle_fn(uint8_t const app, break; case PEEK: + #ifdef MSP430 cmddata[0]=memorybyte[cmddataword[0]]; + #else + debugstr("Monitor peeks are unsupported on this platform."); + debughex(cmddataword[0]); + cmddata[0]=0x00; + #endif txdata(app,verb,1); break; case POKE: + #ifdef MSP430 //Todo, make word or byte. memorybyte[cmddataword[0]] = cmddata[2]; cmddata[0] = memorybyte[cmddataword[0]]; + #else + debugstr("Monitor pokes are unsupported on this platform."); + debughex(cmddataword[0]); + cmddata[0]=0x00; + #endif txdata(app,verb,1); break; @@ -123,19 +141,8 @@ void monitor_handle_fn(uint8_t const app, break; case MONITOR_DIR: - //P5DIR=cmddata[0]; - debugstr("Command deprecated."); - txdata(app,verb,1); - break; - case MONITOR_IN: - //cmddata[0]=P5IN; - debugstr("Command deprecated."); - txdata(app,verb,1); - break; - case MONITOR_OUT: - //P5OUT=cmddata[0]; debugstr("Command deprecated."); txdata(app,verb,1); break; @@ -166,10 +173,14 @@ void monitor_ram_pattern() } txdata(0x00,0x90,0); +#if (platform == tilaunchpad) + longjmp(warmstart,1); +#else //Reboot #ifdef MSP430 asm("br &0xfffe"); #endif +#endif } //! Return the number of contiguous bytes 0xBEEF, to measure RAM usage.