Added LED test into monitor, supporting increased LEDs on the apimote and telosb...
[goodfet] / firmware / apps / monitor / monitor.c
index 4f36833..b6858aa 100644 (file)
@@ -64,7 +64,6 @@ void monitor_handle_fn(uint8_t const app,
 
        case MONITOR_ECHO:
          //Echo back the same buffer.
-         debugstr("About to monitor echo.");
          txdata(app,verb,len);
          break;
 
@@ -146,11 +145,11 @@ void monitor_handle_fn(uint8_t const app,
          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
@@ -158,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;
+
        }
 }