Reintegrating glitching code.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Fri, 16 Mar 2012 23:17:59 +0000 (23:17 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Fri, 16 Mar 2012 23:17:59 +0000 (23:17 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1104 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/apps/glitch/glitch.c
firmware/config.mk

index 40e8122..83fa9d6 100644 (file)
@@ -11,6 +11,8 @@
 #include "command.h"
 #include "glitch.h"
 
 #include "command.h"
 #include "glitch.h"
 
+#include <msp430.h>
+
 //! Handles a monitor command.
 void glitch_handle_fn( uint8_t const app,
                                           uint8_t const verb,
 //! Handles a monitor command.
 void glitch_handle_fn( uint8_t const app,
                                           uint8_t const verb,
@@ -41,7 +43,8 @@ void glitchprime(){
   WDTCTL = WDTPW + WDTHOLD;             // Stop WDT
   
   glitchsetup();
   WDTCTL = WDTPW + WDTHOLD;             // Stop WDT
   
   glitchsetup();
-  _EINT();
+  //_EINT();
+  __eint();
   return;
 #endif
 }
   return;
 #endif
 }
@@ -69,7 +72,7 @@ void glitchsetup(){
 }
 
 // Timer A0 interrupt service routine
 }
 
 // Timer A0 interrupt service routine
-interrupt(TIMERA0_VECTOR) Timer_A (void){
+void __attribute__((interrupt(TIMERA0_VECTOR))) Timer_A (void){
   //This oughtn't be necessary, but glitches repeat without it.
   TACTL=0; //disable counter.
   
   //This oughtn't be necessary, but glitches repeat without it.
   TACTL=0; //disable counter.
   
@@ -148,11 +151,11 @@ void glitch_handle_fn( uint8_t const app,
     break;
   case GLITCHTIME:
     debugstr("Measuring start time.");
     break;
   case GLITCHTIME:
     debugstr("Measuring start time.");
-    _DINT();//disable interrupts
+    __dint();//disable interrupts
     TACTL=0; //clear dividers
     TACTL|=TACLR; //clear config
     TACTL|=
     TACTL=0; //clear dividers
     TACTL|=TACLR; //clear config
     TACTL|=
-      TASSEL_SMCLK //smclk source
+      TASSEL_2 //smclk source
       | MC_2; //continuous mode.
     
     //perform the function
       | MC_2; //continuous mode.
     
     //perform the function
index 4bb7af5..a9f6289 100644 (file)
@@ -28,6 +28,7 @@ endif
 ifneq (,$(findstring $(board),goodfet24))
 mcu ?= msp430f2618
 platform := goodfet
 ifneq (,$(findstring $(board),goodfet24))
 mcu ?= msp430f2618
 platform := goodfet
+CONFIG_glitch = y
 endif
 
 ifneq (,$(findstring $(board),nhb12b))
 endif
 
 ifneq (,$(findstring $(board),nhb12b))