to preprocessor definitions. gfports.h, being included
in assembly, MUST NOT contain any C function definitions.
This fixes MSP430 flash programming from the GoodFET30.
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@230
12e2690d-a6be-4b82-a7b7-
67c4a43b65c8
.globl jtag430_tclk_flashpulses
.type jtag430_tclk_flashpulses,@function //for linking
+#define _GNU_ASSEMBLER_
+#include "gfports.h"
+
//This detects model, chooses appropriate timing.
jtag430_tclk_flashpulses:
mov &0x0ff0, r14
// At 3.68MHz, 7 to 14 cycles/loop are allowed for 257 to 475kHz.
// At 16MHz, 33 to 62 cycles/loop are allowed.
jtag430_tclk_flashpulses_3mhz:
- mov #0x0031, r14
+ mov #P5OUT, r14
pulseloop3:
bis.b #2, @r14 ;SETTCLK, 3 cycles
sub #1, r15 ; 1 cycle
ret
jtag430_tclk_flashpulses_16mhz:
- mov #0x0031, r14
+ mov #P5OUT, r14
pulseloop16:
bis.b #2, @r14 ;SETTCLK, 3 cycles
sub #1, r15 ; 1 cycle
--- /dev/null
+/*! \file gfports.h
+ \author Travis Goodspeed
+ \brief GoodFET Port Definitions
+*/
+
+#ifndef GFPORTS
+#define GFPORTS
+
+#include <io.h>
+
+// N.B., only asm-clean CPP definitions allowed.
+
+//Use P3 instead of P5 for target I/O on chips without P5.
+#ifndef __MSP430_HAS_PORT5__
+#ifndef __MSP430_HAS_PORT5_R__
+#warning "No P5, using P3 instead. Will break 2618 and 1612 support."
+#define P5OUT P3OUT
+#define P5DIR P3DIR
+#define P5REN P3REN
+#define P5IN P3IN
+
+#endif
+#endif
+
+//Use false P5REN for 1612.
+#ifdef __MSP430_HAS_PORT5__
+#ifndef __MSP430_HAS_PORT5_R__
+#warning "1xx, using fake P5REN for external pulling resistors."
+#define P5REN P5OUT
+#endif
+#endif
+
+
+#endif //GFPORTS
#include <io.h>
#include <iomacros.h>
-
-//Use P3 instead of P5 for target I/O on chips without P5.
-#ifndef __MSP430_HAS_PORT5__
-#ifndef __MSP430_HAS_PORT5_R__
-#warning "No P5, using P3 instead. Will break 2618 and 1612 support."
-#define P5OUT P3OUT
-#define P5DIR P3DIR
-#define P5REN P3REN
-#define P5IN P3IN
-
-#endif
-#endif
-
-//Use false P5REN for 1612.
-#ifdef __MSP430_HAS_PORT5__
-#ifndef __MSP430_HAS_PORT5_R__
-#warning "1xx, using fake P5REN for external pulling resistors."
-#define P5REN P5OUT
-#endif
-#endif
+#include "gfports.h"
unsigned char serial_rx();
void serial_tx(unsigned char);