From ac70231fbec57130eddd4516ddb258291536eb9e Mon Sep 17 00:00:00 2001 From: Andrey Date: Sat, 7 Sep 2024 00:37:49 -0400 Subject: [PATCH] per-board pinout --- board.mk | 1 + firmware/pinouts.cpp | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 firmware/pinouts.cpp diff --git a/board.mk b/board.mk index 0222686f..4bc3c538 100644 --- a/board.mk +++ b/board.mk @@ -1,4 +1,5 @@ BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp \ + $(BOARD_DIR)/firmware/pinouts.cpp \ $(BOARD_DIR)/default_tune.cpp \ diff --git a/firmware/pinouts.cpp b/firmware/pinouts.cpp new file mode 100644 index 00000000..9be9da84 --- /dev/null +++ b/firmware/pinouts.cpp @@ -0,0 +1,21 @@ +#include "pch.h" + +static void setBoard_04_pinout() { + engineConfiguration->injectionPins[0] = Gpio::D8; + engineConfiguration->injectionPins[1] = Gpio::D9; + engineConfiguration->injectionPins[2] = Gpio::D10; + engineConfiguration->injectionPins[3] = Gpio::D11; +} + +static void setBoard_ua4c_pinout() { + engineConfiguration->injectionPins[0] = Gpio::D8; + engineConfiguration->injectionPins[0] = Gpio::B15; +} + +/*PUBLIC_API_WEAK*/ void boardTsAction(uint16_t index) { + if (index == 0) { + setBoard_04_pinout(); + } else if (index == 1) { + setBoard_ua4c_pinout(); + } +} \ No newline at end of file