diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-05-09 00:35:47 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2012-05-09 00:39:11 +0200 |
commit | d76a3073ca794b06b636b3ca7580f3477b29eba0 (patch) | |
tree | dc79d4e9e7cceb19f7bde1d8babab042fa03bc00 | |
parent | 3b64f44f6b2a5dd71ba382bf4bea70ba16ea9565 (diff) | |
download | launchpad-blink-master.tar.gz launchpad-blink-master.tar.xz launchpad-blink-master.zip |
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | main.c | 18 |
2 files changed, 11 insertions, 17 deletions
@@ -1,10 +1,12 @@ CC=msp430-gcc -CFLAGS=-Os -Wall -g -mmcu=msp430x2012 +CFLAGS=-Os -Wall -g -mmcu=msp430g2231 OBJS=main.o +TARGET=main.elf +all: $(TARGET) -all: $(OBJS) +$(TARGET): $(OBJS) $(CC) $(CFLAGS) -o main.elf $(OBJS) %.o: %.c @@ -12,3 +14,7 @@ all: $(OBJS) clean: rm -fr main.elf $(OBJS) + +.PHONY: prog +prog: $(TARGET) + mspdebug rf2500 "prog $<" @@ -20,17 +20,7 @@ Copyright (c) 2010 - Mike Szczys THE SOFTWARE. */ -//#include <msp430x20x2.h> <-taken care of by including io.h and setting -mmcu=msp430x2012 in cflags - /* It's interesting to note that this is not the header - file for the chip we are using. This source code - is intended for the MSP430G2231 but there's no - header file for that specific ship. It apprears - 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 #define LED1 BIT6 @@ -61,7 +51,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,8 +65,6 @@ int main(void) { } } -interrupt(TIMERA0_VECTOR) TIMERA0_ISR(void) { +void __attribute__((interrupt (TIMERA0_VECTOR))) TIMERA0_ISR(void) { LED_OUT ^= (LED0 + LED1); //Toggle both LEDs } - - |