From 087114da823fa6794f3d8ac41b21bb2ab75531fd Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Mon, 6 Sep 2021 23:09:07 +1200 Subject: [PATCH] Fixed non-portable code. --- src/main/build/debug_pin.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/build/debug_pin.c b/src/main/build/debug_pin.c index c112e86ebb..edd00d0d77 100644 --- a/src/main/build/debug_pin.c +++ b/src/main/build/debug_pin.c @@ -33,17 +33,14 @@ typedef struct dbgPinState_s { uint32_t resetBSRR; } dbgPinState_t; -#ifndef DEBUG_PIN_COUNT -#define DEBUG_PIN_COUNT 1 -#endif - -// Provide a non-weak reference in target.c or elsewhere -__weak dbgPin_t dbgPins[DEBUG_PIN_COUNT] = { - { .tag = IO_TAG(NONE) }, -}; - dbgPinState_t dbgPinStates[DEBUG_PIN_COUNT] = { 0 }; +extern dbgPin_t dbgPins[DEBUG_PIN_COUNT]; +// Define this in the target definition as (and set DEBUG_PIN_COUNT to the correct value): +// dbgPin_t dbgPins[DEBUG_PIN_COUNT] = { +// { .tag = IO_TAG() }, +// }; + void dbgPinInit(void) { for (unsigned i = 0; i < ARRAYLEN(dbgPins); i++) {