Quantitative tests of AVR power stability,
[goodfet] / firmware / goodfet.c
index 467ebae..ee97ebb 100644 (file)
@@ -10,7 +10,7 @@
 #include "platform.h"\r
 #include "command.h"\r
 #include "apps.h"\r
-\r
+#include "glitch.h"\r
 \r
 \r
 //LED on P1.0\r
@@ -22,7 +22,7 @@ void init(){
   \r
   //LED out and on.\r
   PLEDDIR |= PLEDPIN;\r
-  PLEDOUT |= PLEDPIN;\r
+  PLEDOUT &= ~PLEDPIN;\r
   \r
   //Setup clocks, unique to each '430.\r
   msp430_init_dco();\r
@@ -30,8 +30,6 @@ void init(){
   \r
   //Enable Interrupts.\r
   //eint();\r
-\r
-\r
 }\r
 \r
 \r
@@ -40,7 +38,11 @@ void handle(unsigned char app,
            unsigned char verb,\r
            unsigned long len){\r
   //debugstr("GoodFET");\r
+  P1OUT&=~1;\r
   switch(app){\r
+  case GLITCH:\r
+    glitchhandle(app,verb,len);\r
+    break;\r
   case MONITOR:\r
     monitorhandle(app,verb,len);\r
     break;\r
@@ -82,9 +84,11 @@ int main(void)
   unsigned long len;\r
   \r
   init();\r
+  glitchsetup();\r
   \r
   txstring(MONITOR,OK,"http://goodfet.sf.net/");\r
   \r
+  \r
   //Command loop.  There's no end!\r
   while(1){\r
     //Magic 3\r