From f5edcbfc46dfafc434774a3e2849582be7cc6348 Mon Sep 17 00:00:00 2001 From: travisutk Date: Mon, 25 Jan 2010 20:50:35 +0000 Subject: [PATCH] Trying to clean up port. Not nearly complete. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@285 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- firmware/apps/monitor/monitor.c | 2 ++ firmware/include/command.h | 5 +++++ firmware/include/gfports.h | 11 +++++++++++ firmware/include/monitor.h | 2 ++ firmware/include/platform.h | 4 ---- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/firmware/apps/monitor/monitor.c b/firmware/apps/monitor/monitor.c index 323691f..85c523f 100644 --- a/firmware/apps/monitor/monitor.c +++ b/firmware/apps/monitor/monitor.c @@ -89,7 +89,9 @@ void monitor_ram_pattern(){ txdata(0x00,0x90,0); //Reboot + #ifdef MSP430 asm("br &0xfffe"); + #endif } //! Return the number of contiguous bytes 0xBEEF, to measure RAM usage. diff --git a/firmware/include/command.h b/firmware/include/command.h index 1fe9e42..d909e33 100644 --- a/firmware/include/command.h +++ b/firmware/include/command.h @@ -74,7 +74,12 @@ extern unsigned char silent; #define OCT_CMP 0x90 #define OCT_RES 0x91 +#ifdef GCC #define WEAKDEF __attribute__ ((weak)) +#else +//Compiler doesn't support weak linking. :( +#define WEAKDEF +#endif //! Handle a plugin, weak-linked to error. extern int pluginhandle(unsigned char app, diff --git a/firmware/include/gfports.h b/firmware/include/gfports.h index 8cc1012..38757cd 100644 --- a/firmware/include/gfports.h +++ b/firmware/include/gfports.h @@ -6,7 +6,9 @@ #ifndef GFPORTS #define GFPORTS +#ifdef MSP430 #include +#endif // N.B., only asm-clean CPP definitions allowed. @@ -30,5 +32,14 @@ #endif #endif +//Use these instead of the explicit names. +#ifdef MSP430 +#define gfout P5OUT +#define gfin P5IN +#define gfdir P5DIR +#define gfren P5REN +#endif + + #endif //GFPORTS diff --git a/firmware/include/monitor.h b/firmware/include/monitor.h index ecae3fd..b36ceab 100644 --- a/firmware/include/monitor.h +++ b/firmware/include/monitor.h @@ -3,9 +3,11 @@ \brief Debug monitor commands. */ +#ifdef MSP430 #include #include #include +#endif // Generic Commands diff --git a/firmware/include/platform.h b/firmware/include/platform.h index 113549c..87b18cc 100644 --- a/firmware/include/platform.h +++ b/firmware/include/platform.h @@ -6,10 +6,6 @@ definition file, such as msp430x1612.c or msp430x2618.c. */ -#include -#include -#include - #include "gfports.h" unsigned char serial_rx(); -- 2.20.1