Beginnings of support for Zigduino. AVR code is really out of shape.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sun, 25 Nov 2012 22:00:21 +0000 (22:00 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sun, 25 Nov 2012 22:00:21 +0000 (22:00 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1351 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/apps/monitor/monitor.c
firmware/apps/spi/spi.c
firmware/config.mk
firmware/lib/atmega1284p.c

index b6858aa..db8749c 100644 (file)
@@ -7,18 +7,20 @@
 #include "platform.h"
 #include "monitor.h"
 #include "builddate.h"
+
+
 #if (platform == tilaunchpad)
 #include <setjmp.h>
 extern jmp_buf warmstart;
-
 #endif
 
+
 #define MONITOR_APP
 
 //! Handles a monitor command.
 void monitor_handle_fn(uint8_t const app,
-                                          uint8_t const verb,
-                                          uint32_t const len);
+                      uint8_t const verb,
+                      uint32_t const len);
 
 //! Overwrite all of RAM with 0xBEEF, then reboot.
 void monitor_ram_pattern();
@@ -223,9 +225,13 @@ unsigned int monitor_ram_depth()
 //! Call a function by address.
 int fncall(unsigned int adr)
 {
+  #ifdef MSP430
        int (*machfn)() = 0;
        machfn = (int (*)()) adr;
        return machfn();
+  #else
+       debugstr("fncall() not supported on this platform.");
+  #endif
 }
 
 
index bb1753a..f92fcf5 100644 (file)
 
 #ifdef __MSPGCC__
 #include <msp430.h>
-#else
-#include <signal.h>
-#include <msp430.h>
-#include <iomacros.h>
+/* #else */
+/* #include <signal.h> */
+/* #include <msp430.h> */
+/* #include <iomacros.h> */
 #endif
 
 #include "spi.h"
index 8ed0785..f001b48 100644 (file)
@@ -147,6 +147,16 @@ CFLAGS=$(DEBUG) -Iinclude -mmcu=$(mcu) -W -Os -mcall-prologues -Wall -Wextra -Wu
 config := monitor avr spi jscan
 endif
 
+ifneq (,$(findstring $(board),zigduino))
+GCC := avr-gcc
+CC := avr-gcc
+mcu ?= atmega1284p
+platform = donbfet
+CFLAGS=$(DEBUG) -Iinclude -mmcu=$(mcu) -W -Os -mcall-prologues -Wall -Wextra -Wuninitialized -fpack-struct -fshort-enums -funsigned-bitfields
+config := monitor #avr spi
+endif
+
+
 ifneq (,$(findstring $(board),arduino))
 GCC := avr-gcc
 mcu ?= atmega168
index 2199ecf..12150df 100644 (file)
@@ -74,21 +74,19 @@ void donbfet_init_uart0(){
   _delay_ms(500); //takes a bit to stabilize
 }
 
-void 
-led_on()
-{
+void led_init(){
+  
+}
+
+void  led_on() {
        PLEDOUT |= (1 << PLEDPIN);
 }
 
-void
-led_off()
-{
+void led_off() {
        PLEDOUT &= ~(1 << PLEDPIN);
 }
 
-void 
-donbfet_init()
-{
+void donbfet_init(){
         uint8_t x;
 
         /* explicitly clear interrupts */