From: travisutk Date: Sat, 20 Jun 2009 01:37:06 +0000 (+0000) Subject: Moved the firmware Makefile to trunk/firmware. X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=c4f077f724f9320a12605271722f61932b4c663c;ds=sidebyside Moved the firmware Makefile to trunk/firmware. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@42 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/firmware/Makefile b/firmware/Makefile new file mode 100644 index 0000000..f1607d6 --- /dev/null +++ b/firmware/Makefile @@ -0,0 +1,35 @@ + +PORT=/dev/ttyUSB0 +BSL=tos-bsl --invert-reset --invert-test -c $(PORT) --speed=38400 + +#mcu=msp430x1611 +mcu=msp430x1612 + +#ldscript is wonky +GCCINC=-T ldscripts/161x.x + +CC=msp430-gcc -g -mmcu=$(mcu) -DGCC $(GCCINC) -I include + +apps= apps/monitor/monitor.c apps/spi/spi.c apps/i2c/i2c.c apps/chipcon/chipcon.c apps/jtag/jtag.c apps/jtag/jtag430.c +libs= lib/msp430f1612.c lib/command.c +app=goodfet + +all: $(app).hex + +goodfet.hex: goodfet + +run: + ../../client/goodfet.msp430 + +install: $(app).hex + $(BSL) -e -p $(app).hex + $(BSL) -P $(app).hex -r +$(app): $(app).c $(libs) $(apps) +$(app).hex: $(app) + msp430-objcopy goodfet -O ihex goodfet.hex +m4s: $(app).hex + msp430-objdump -D -m msp430 $(app).hex | m4s init +erase: + $(BSL) -e +clean: + rm -f $(app) diff --git a/firmware/apps/Makefile b/firmware/apps/Makefile deleted file mode 100644 index 40114b3..0000000 --- a/firmware/apps/Makefile +++ /dev/null @@ -1,35 +0,0 @@ - -PORT=/dev/ttyUSB0 -BSL=tos-bsl --invert-reset --invert-test -c $(PORT) --speed=38400 - -#mcu=msp430x1611 -mcu=msp430x1612 - -#ldscript is wonky -GCCINC=-T ../ldscripts/161x.x - -CC=msp430-gcc -g -mmcu=$(mcu) -DGCC $(GCCINC) -I ../include - -apps= monitor/monitor.c spi/spi.c i2c/i2c.c chipcon/chipcon.c jtag/jtag.c jtag/jtag430.c -libs= ../lib/msp430f1612.c ../lib/command.c -app=goodfet - -all: $(app) - -goodfet.hex: goodfet - -run: - ../../client/goodfet.msp430 - -install: $(app) - $(BSL) -e -p $(app).hex - $(BSL) -P $(app).hex -r -$(app): $(app).c $(libs) $(apps) -$(app).hex: $(app) - msp430-objcopy goodfet -O ihex goodfet.hex -m4s: $(app).hex - msp430-objdump -D -m msp430 $(app).hex | m4s init -erase: - $(BSL) -e -clean: - rm -f $(app) diff --git a/firmware/apps/goodfet.c b/firmware/apps/goodfet.c deleted file mode 100644 index a8d5b7a..0000000 --- a/firmware/apps/goodfet.c +++ /dev/null @@ -1,85 +0,0 @@ -//GOODFET Main File -//Includes several applications. - -#include "platform.h" -#include "command.h" -#include "apps.h" - -#include -#include -#include - - -//LED on P1.0 -//IO on P5 - -//! Initialize registers and all that jazz. -void init(){ - volatile unsigned int i; - WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer - - //LED and TX OUT - PLEDDIR |= PLEDPIN; - - msp430_init_dco(); - msp430_init_uart(); - - //Enable Interrupts. - //eint(); -} - -//! Handle a command. -void handle(unsigned char app, - unsigned char verb, - unsigned char len){ - switch(app){ - case MONITOR: - monitorhandle(app,verb,len); - break; - case SPI: - spihandle(app,verb,len); - break; - case I2C: - i2chandle(app,verb,len); - break; - case CHIPCON: - cchandle(app,verb,len); - break; - case JTAG: - jtaghandle(app,verb,len); - break; - case JTAG430: - jtag430handle(app,verb,len); - break; - default: - txdata(app,NOK,0); - break; - } -} - -//! Main loop. -int main(void) -{ - volatile unsigned int i; - unsigned char app, verb, len; - - init(); - - //Ready - txdata(MONITOR,OK,0); - - //Command loop. There's no end! - while(1){ - //Magic 3 - app=serial_rx(); - verb=serial_rx(); - len=serial_rx(); - - //Read data, if any - for(i=0;i +#include +#include + + +//LED on P1.0 +//IO on P5 + +//! Initialize registers and all that jazz. +void init(){ + volatile unsigned int i; + WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer + + //LED and TX OUT + PLEDDIR |= PLEDPIN; + + msp430_init_dco(); + msp430_init_uart(); + + //Enable Interrupts. + //eint(); +} + +//! Handle a command. +void handle(unsigned char app, + unsigned char verb, + unsigned char len){ + switch(app){ + case MONITOR: + monitorhandle(app,verb,len); + break; + case SPI: + spihandle(app,verb,len); + break; + case I2C: + i2chandle(app,verb,len); + break; + case CHIPCON: + cchandle(app,verb,len); + break; + case JTAG: + jtaghandle(app,verb,len); + break; + case JTAG430: + jtag430handle(app,verb,len); + break; + default: + txdata(app,NOK,0); + break; + } +} + +//! Main loop. +int main(void) +{ + volatile unsigned int i; + unsigned char app, verb, len; + + init(); + + //Ready + txdata(MONITOR,OK,0); + + //Command loop. There's no end! + while(1){ + //Magic 3 + app=serial_rx(); + verb=serial_rx(); + len=serial_rx(); + + //Read data, if any + for(i=0;i