From: travisutk Date: Sun, 17 Apr 2011 21:39:22 +0000 (+0000) Subject: Arduino port is blinking. X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=092aa3fd5225a9daa84bc1359b8b9d772d795784 Arduino port is blinking. Serial port should bring the monitor up. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@995 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/firmware/Makefile b/firmware/Makefile index 643163d..1cf9b6c 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -107,7 +107,7 @@ config ?= monitor chipcon spi jtag430 jtag430x2 avr openocd ccspi # Build the needed list of app and lib object files from the config apps= -libs= lib/$(mcu).o lib/command.o lib/dco_calib.o lib/apps.o lib/msp430.o +libs= lib/$(mcu).o lib/command.o lib/dco_calib.o lib/apps.o lib/msp430.o lib/arduino.o hdrs= ERR= diff --git a/firmware/goodfet.c b/firmware/goodfet.c index 5d33b39..714fbe6 100644 --- a/firmware/goodfet.c +++ b/firmware/goodfet.c @@ -18,7 +18,15 @@ //! General init function, calls platform-specific one. void init(){ #ifdef MSP430 - msp430_init(); + #define INITCHIP msp430_init(); +#endif + +#ifdef ARDUINO + #define INITCHIP arduino_init(); +#endif + +#ifdef INITCHIP +INITCHIP #else #warning "No init() routine for this platform!" #endif diff --git a/firmware/lib/arduino.c b/firmware/lib/arduino.c new file mode 100644 index 0000000..0be48f3 --- /dev/null +++ b/firmware/lib/arduino.c @@ -0,0 +1,31 @@ +/*! \file arduino.c + \author Travis Goodspeed + \brief Arduino platform support. +*/ + +#include "platform.h" + +#include + +#ifdef ARDUINO + +//! Arduino setup code. +void arduino_init(){ + /* set PORTB for output*/ + DDRB = 0xFF; + + while (1) + { + /* set PORTB.6 high */ + PORTB = 0x20; + + _delay_ms(1000); + + /* set PORTB.6 low */ + PORTB = 0x00; + + _delay_ms(1000); + } +} + +#endif