From c6dc241649476057b7bbf57310c433c277dfce73 Mon Sep 17 00:00:00 2001 From: Thomas Izycki Date: Fri, 25 Nov 2022 15:11:30 +0100 Subject: [PATCH] Add Kbuild option for loco deck LOCODECK_ALT_PIN_RESET Sets the loco deck reset pin to GPIO_IO4. Requires a accordingly modified loco deck with a connection to GPIO_IO4. --- src/deck/drivers/src/Kconfig | 9 +++++++++ src/deck/drivers/src/locodeck.c | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/deck/drivers/src/Kconfig b/src/deck/drivers/src/Kconfig index 87e2d553a6..7a40ee3565 100644 --- a/src/deck/drivers/src/Kconfig +++ b/src/deck/drivers/src/Kconfig @@ -290,6 +290,15 @@ config DECK_LOCO LOCO deck alternative IRQ and RESET pins(IO_2, IO_3) instead of default (RX1, TX1), leaving UART1 free for use. + config LOCODECK_ALT_PIN_RESET + bool "Set pin GPIO_IO4 for reset on the LOCO deck" + default name + depends on DECK_LOCODECK_USE_ALT_PINS + help + Only works when LOCODECK_USE_ALT_PINS is set. For instance useful with + Loco + Lighhouse + Flow decks where IO_3 collides with the Flow deck. + Requires modified Loco deck with connection to GPIO_IO4. + config DECK_LOCO_NR_OF_ANCHORS int "The number of anchors in use" default 8 diff --git a/src/deck/drivers/src/locodeck.c b/src/deck/drivers/src/locodeck.c index 1201c4716f..76eb1f6a95 100644 --- a/src/deck/drivers/src/locodeck.c +++ b/src/deck/drivers/src/locodeck.c @@ -65,10 +65,10 @@ #ifdef CONFIG_DECK_LOCODECK_USE_ALT_PINS #define GPIO_PIN_IRQ DECK_GPIO_IO2 - #ifndef LOCODECK_ALT_PIN_RESET + #ifndef CONFIG_LOCODECK_ALT_PIN_RESET #define GPIO_PIN_RESET DECK_GPIO_IO3 #else - #define GPIO_PIN_RESET LOCODECK_ALT_PIN_RESET + #define GPIO_PIN_RESET DECK_GPIO_IO4 #endif #define EXTI_PortSource EXTI_PortSourceGPIOB @@ -570,7 +570,11 @@ static const DeckDriver dwm1000_deck = { .name = "bcDWM1000", #ifdef CONFIG_DECK_LOCODECK_USE_ALT_PINS + #ifndef CONFIG_LOCODECK_ALT_PIN_RESET .usedGpio = DECK_USING_IO_1 | DECK_USING_IO_2 | DECK_USING_IO_3, + #else + .usedGpio = DECK_USING_IO_1 | DECK_USING_IO_2 | DECK_USING_IO_4, + #endif #else // (PC10/PC11 is UART1 TX/RX) .usedGpio = DECK_USING_IO_1 | DECK_USING_PC10 | DECK_USING_PC11,