1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00

Merge pull request #10947 from mikeller/fix_non_portable_code

This commit is contained in:
Michael Keller 2021-09-28 02:22:13 +13:00 committed by GitHub
commit 22da87d471
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,17 +33,14 @@ typedef struct dbgPinState_s {
uint32_t resetBSRR; uint32_t resetBSRR;
} dbgPinState_t; } 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 }; 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(<pin>) },
// };
void dbgPinInit(void) void dbgPinInit(void)
{ {
for (unsigned i = 0; i < ARRAYLEN(dbgPins); i++) { for (unsigned i = 0; i < ARRAYLEN(dbgPins); i++) {