From: travisutk Date: Tue, 19 May 2009 13:32:18 +0000 (+0000) Subject: Beginning real firmware development. X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=2193312aba0de2ab4416e40a38d6b3dcdf07127b Beginning real firmware development. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@12 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/firmware/Makefile b/firmware/Makefile deleted file mode 100644 index 7912810..0000000 --- a/firmware/Makefile +++ /dev/null @@ -1,13 +0,0 @@ - -PORT=/dev/ttyUSB0 -BSL=tos-bsl --invert-reset --invert-test -c $(PORT) - -CC=msp430-gcc -g -mmcu=msp430x1611 -DGCC - -app=blink - -install: $(app) - $(BSL) -e -p $(app) - $(BSL) -P $(app) -g 0x4000 -erase: - $(BSL) -e diff --git a/firmware/blink.c b/firmware/blink.c deleted file mode 100644 index d6c7c71..0000000 --- a/firmware/blink.c +++ /dev/null @@ -1,36 +0,0 @@ -//GOODFET Blinker - -//1611 is preferred, but 1612 accepted - -#include -#include -#include - -//LED on P1.0 -//IO on P5 - -//! Initialize registers and all that jazz. -void init(){ - WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer - - //LED and TX OUT - P1DIR = 0x03; - - //Enable Interrupts. - //eint(); -} - -//! Main loop. -int main(void) -{ - volatile unsigned int i; - init(); - - while(1){ - i = 10000; - while(i--); - - P1OUT^=1; // Blink - } -} - diff --git a/firmware/tests/blink/Makefile b/firmware/tests/blink/Makefile new file mode 100644 index 0000000..7912810 --- /dev/null +++ b/firmware/tests/blink/Makefile @@ -0,0 +1,13 @@ + +PORT=/dev/ttyUSB0 +BSL=tos-bsl --invert-reset --invert-test -c $(PORT) + +CC=msp430-gcc -g -mmcu=msp430x1611 -DGCC + +app=blink + +install: $(app) + $(BSL) -e -p $(app) + $(BSL) -P $(app) -g 0x4000 +erase: + $(BSL) -e diff --git a/firmware/tests/blink/blink.c b/firmware/tests/blink/blink.c new file mode 100644 index 0000000..d6c7c71 --- /dev/null +++ b/firmware/tests/blink/blink.c @@ -0,0 +1,36 @@ +//GOODFET Blinker + +//1611 is preferred, but 1612 accepted + +#include +#include +#include + +//LED on P1.0 +//IO on P5 + +//! Initialize registers and all that jazz. +void init(){ + WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer + + //LED and TX OUT + P1DIR = 0x03; + + //Enable Interrupts. + //eint(); +} + +//! Main loop. +int main(void) +{ + volatile unsigned int i; + init(); + + while(1){ + i = 10000; + while(i--); + + P1OUT^=1; // Blink + } +} +