From 93254875ba79c70c4e1b4fb1b144a8b117337abf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niccol=C3=B2=20Betto?= <niccolo.betto@skywarder.eu>
Date: Tue, 26 Nov 2024 12:32:25 +0100
Subject: [PATCH] [BSP][ConRIG] Fix incorrect button configuration

---
 .../stm32f429zi_con_rig/interfaces-impl/bsp.cpp     | 13 +++++++------
 .../stm32f429zi_con_rig/interfaces-impl/hwmapping.h |  4 ++--
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/bsps/stm32f429zi_con_rig/interfaces-impl/bsp.cpp b/src/bsps/stm32f429zi_con_rig/interfaces-impl/bsp.cpp
index 1a50d444e..bd7894576 100644
--- a/src/bsps/stm32f429zi_con_rig/interfaces-impl/bsp.cpp
+++ b/src/bsps/stm32f429zi_con_rig/interfaces-impl/bsp.cpp
@@ -220,14 +220,15 @@ void IRQbspInit()
     interfaces::spi1::mosi::mode(Mode::ALTERNATE);
     interfaces::spi1::mosi::alternateFunction(5);
 
-    btns::ignition::mode(Mode::INPUT);
-    btns::filling::mode(Mode::INPUT);
-    btns::venting::mode(Mode::INPUT);
-    btns::release::mode(Mode::INPUT);
-    btns::detach::mode(Mode::INPUT);
-    btns::tars::mode(Mode::INPUT);
+    btns::n2o_filling::mode(Mode::INPUT);
+    btns::n2o_release::mode(Mode::INPUT);
+    btns::n2o_venting::mode(Mode::INPUT);
+    btns::n2_filling::mode(Mode::INPUT);
+    btns::n2_release::mode(Mode::INPUT);
+    btns::n2_detach::mode(Mode::INPUT);
     btns::nitrogen::mode(Mode::INPUT);
     btns::arm::mode(Mode::INPUT);
+    btns::ignition::mode(Mode::INPUT);
 
     radio::cs::mode(Mode::OUTPUT);
     radio::cs::high();
diff --git a/src/bsps/stm32f429zi_con_rig/interfaces-impl/hwmapping.h b/src/bsps/stm32f429zi_con_rig/interfaces-impl/hwmapping.h
index da3df7769..270493d70 100644
--- a/src/bsps/stm32f429zi_con_rig/interfaces-impl/hwmapping.h
+++ b/src/bsps/stm32f429zi_con_rig/interfaces-impl/hwmapping.h
@@ -47,10 +47,10 @@ namespace btns
 {
 using n2o_filling = Gpio<GPIOE_BASE, 6>;
 using n2o_release = Gpio<GPIOE_BASE, 4>;
+using n2o_venting = Gpio<GPIOD_BASE, 7>;
+using n2_filling  = Gpio<GPIOG_BASE, 11>;
 using n2_release  = Gpio<GPIOG_BASE, 9>;
-using n2_venting  = Gpio<GPIOD_BASE, 7>;
 using n2_detach   = Gpio<GPIOD_BASE, 5>;
-using n2_filling  = Gpio<GPIOG_BASE, 11>;
 using nitrogen    = Gpio<GPIOD_BASE, 3>;
 using arm         = Gpio<GPIOE_BASE, 2>;
 using ignition    = Gpio<GPIOB_BASE, 4>;
-- 
GitLab