diff --git a/src/Makefile b/src/Makefile index f43ffff5..ea5a857b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -34,6 +34,7 @@ SRC = \ hex_utils.c \ jtag_scan.c \ jtagtap.c \ + jtagtap_generic.c \ lmi.c \ lpc_common.c \ lpc11xx.c \ diff --git a/src/jtagtap_generic.c b/src/jtagtap_generic.c index 63c8e448..416bcb67 100644 --- a/src/jtagtap_generic.c +++ b/src/jtagtap_generic.c @@ -21,9 +21,10 @@ /* This file provides generic forms of the low-level jtagtap functions * for platforms that don't require optimised forms. */ +#include "general.h" +#include "jtagtap.h" -#ifdef PROVIDE_GENERIC_JTAGTAP_TMS_SEQ -void +void __attribute__((weak)) jtagtap_tms_seq(uint32_t MS, int ticks) { while(ticks--) { @@ -31,11 +32,8 @@ jtagtap_tms_seq(uint32_t MS, int ticks) MS >>= 1; } } -#endif - -#ifdef PROVIDE_GENERIC_JTAGTAP_TDI_TDO_SEQ -void +void __attribute__((weak)) jtagtap_tdi_tdo_seq(uint8_t *DO, const uint8_t final_tms, const uint8_t *DI, int ticks) { uint8_t index = 1; @@ -51,11 +49,8 @@ jtagtap_tdi_tdo_seq(uint8_t *DO, const uint8_t final_tms, const uint8_t *DI, int } } } -#endif - -#ifdef PROVIDE_GENERIC_JTAGTAP_TDI_SEQ -void +void __attribute__((weak)) jtagtap_tdi_seq(const uint8_t final_tms, const uint8_t *DI, int ticks) { uint8_t index = 1; @@ -67,6 +62,4 @@ jtagtap_tdi_seq(const uint8_t final_tms, const uint8_t *DI, int ticks) } } } -#endif - diff --git a/src/platforms/stm32/jtagtap.c b/src/platforms/stm32/jtagtap.c index baaa1490..ecd0698a 100644 --- a/src/platforms/stm32/jtagtap.c +++ b/src/platforms/stm32/jtagtap.c @@ -66,11 +66,3 @@ inline uint8_t jtagtap_next(uint8_t dTMS, uint8_t dTDO) return ret != 0; } - - -#define PROVIDE_GENERIC_JTAGTAP_TMS_SEQ -#define PROVIDE_GENERIC_JTAGTAP_TDI_TDO_SEQ -#define PROVIDE_GENERIC_JTAGTAP_TDI_SEQ - -#include "jtagtap_generic.c" - diff --git a/src/platforms/tm4c/jtagtap.c b/src/platforms/tm4c/jtagtap.c index c32a437b..c6b8d7e3 100644 --- a/src/platforms/tm4c/jtagtap.c +++ b/src/platforms/tm4c/jtagtap.c @@ -41,7 +41,3 @@ jtagtap_next(const uint8_t dTMS, const uint8_t dTDO) return ret != 0; } -#define PROVIDE_GENERIC_JTAGTAP_TMS_SEQ -#define PROVIDE_GENERIC_JTAGTAP_TDI_TDO_SEQ -#define PROVIDE_GENERIC_JTAGTAP_TDI_SEQ -#include "jtagtap_generic.c"