X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=firmware%2Fapps%2Fmonitor%2Fmonitor.c;h=b6858aa0ceeb85a26d8b3ac3d5730c3d5220d0a7;hb=3a1dba16a3f6c27250e1e9566171abe48537cc89;hp=54d9cd03a55cea283cdbd128c1f6ef5e9fce38b3;hpb=69539bb167246135b1bde3c55dca7d19bc3c7aee;p=goodfet diff --git a/firmware/apps/monitor/monitor.c b/firmware/apps/monitor/monitor.c index 54d9cd0..b6858aa 100644 --- a/firmware/apps/monitor/monitor.c +++ b/firmware/apps/monitor/monitor.c @@ -51,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; @@ -63,9 +63,9 @@ 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. + txdata(app,verb,len); + break; case MONITOR_LIST_APPS: // transmit firmware build date @@ -87,6 +87,8 @@ void monitor_handle_fn(uint8_t const app, 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; @@ -98,6 +100,8 @@ void monitor_handle_fn(uint8_t const app, 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; @@ -136,27 +140,16 @@ 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; - + case MONITOR_SILENT: - silent=cmddata[0]; - txdata(app,verb,1); - break; + silent=cmddata[0]; + txdata(app,verb,1); + break; case MONITOR_CONNECTED: #ifdef MSP430 @@ -164,6 +157,33 @@ void monitor_handle_fn(uint8_t const app, #endif txdata(app,verb,0); break; + + case MONITOR_LEDTEST: + //debugstr("Enter LEDTEST."); + i = 0; + #ifdef PLEDOUT + i++; + led_init(); + led_on(); + msdelay(5000); + led_off(); + #endif + #ifdef PLED2OUT + i++; + led2_on(); + msdelay(5000); + led2_off(); + #endif + #ifdef PLED3OUT + i++; + led3_on(); + msdelay(5000); + led3_off(); + #endif + cmddata[0] = i; //Return number of LEDs that we flashed. + txdata(app,verb,1); + break; + } }