I attached the wrong diff file, sorry. The correct one is
diff --git a/Makefile b/Makefile
index 1c1e2c5..9e99753 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
CC=msp430-gcc
-CFLAGS=-Os -Wall -g -mmcu=msp430x2012
+CFLAGS=-Os -Wall -g -mmcu=msp430g2231 -nostdlib
/usr/lib/gcc/msp430/4.5.3/crt0ivtbl16.o -lgcc -lcrt0
OBJS=main.o
diff --git a/main.c b/main.c
index a52c4cf..86eddd2 100644
--- a/main.c
+++ b/main.c
@@ -28,8 +28,7 @@ Copyright (c) 2010 - Mike Szczys
That the MPS430x2012 is closely related and
I haven't observed any problems with using this
header file. */
-#include <io.h>
-#include <signal.h>
+#include <msp430.h>
#define LED0 BIT0
@@ -61,7 +60,7 @@ int main(void) {
BCSCTL3 |= LFXT1S_2; //Set ACLK to use internal VLO (12 kHz clock)
- TACTL = TASSEL__ACLK | MC__UP; //Set TimerA to use auxiliary
clock in UP mode
+ TACTL = TASSEL_1 | MC_1; //Set TimerA to use auxiliary clock in UP mode
TACCTL0 = CCIE; //Enable the interrupt for TACCR0 match
TACCR0 = 11999; /*Set TACCR0 which also starts the timer. At
12 kHz, counting to 12000 should output
@@ -75,7 +74,7 @@ int main(void) {
}
}
-interrupt(TIMERA0_VECTOR) TIMERA0_ISR(void) {
+void __attribute__((interrupt (TIMERA0_VECTOR))) TIMERA0_ISR(void) {
LED_OUT ^= (LED0 + LED1); //Toggle both LEDs
}
--
Mattia Monga
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]