summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--[-rwxr-xr-x]main.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/main.c b/main.c
index 16dbdb5..05c00d2 100755..100644
--- a/main.c
+++ b/main.c
@@ -38,7 +38,7 @@
* MSP430 serial port
* WARNING: This might disable some functions too, check the code
* to see exactly what that does in this particular version */
-//#define TRACE_SERIAL
+// #define TRACE_SERIAL
#undef TRACE_SERIAL
/* define LOOP_REBOOT if you want that the board reboot forever
@@ -240,6 +240,9 @@ static void dump_trace(void)
#endif /* TRACE_SERIAL */
+volatile u16 Timer_A_count;
+
+
int main(void)
{
u16 state, resetState;
@@ -262,6 +265,8 @@ int main(void)
resetState = ON_STATE;
while (1) {
+ P2OUT = (P2OUT & ~GP24) | ((Timer_A_count & 1) ? GP24 : 0);
+
////////////////////////////////////////////////////////////////////
#ifdef TRACE_SERIAL // debug behavior
switch (resetState) {
@@ -271,9 +276,9 @@ int main(void)
resetState = RST_WAIT;
}
break;
+ resetState = ON_STATE;
case RST_WAIT:
if (SW2State == 0)
- resetState = ON_STATE;
break;
}
#else // normal behavior
@@ -443,8 +448,14 @@ __interrupt void Timer_A(void)
#ifdef WATCHDOG
/* ACLK (VLO) /64 => T belongs to [0.016; 0.0032] s */
WDTCTL = WDTPW | WDTCNTCL | WDTSSEL | WDTIS1 | WDTIS0;
+
+ P3OUT = P3IN ^ MSP_BSL_TXD;
+/* if (IFG2_bit.UCA0TXIFG)
+ UCA0TXBUF = 'a'; */
#endif /* WATCHDOG */
+ Timer_A_count++;
+
if (!(P1IN & START_SW1_N))
SW1State++;
else