From 5f98577d0b2db88c7ce109f6ea331df4bcf8421c Mon Sep 17 00:00:00 2001
From: Alberto Nidasio <alberto.nidasio@skywarder.eu>
Date: Wed, 24 Aug 2022 11:00:10 +0200
Subject: [PATCH] [DeathStackV3] Fixed cutter sensing pin

---
 .../interfaces-impl/bsp.cpp                            |  9 ++++-----
 .../interfaces-impl/bsp_impl.h                         | 10 ++++------
 .../interfaces-impl/hwmapping.h                        |  9 ++++-----
 3 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/bsp.cpp
index 9a462c03..369b9f40 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/bsp.cpp
@@ -437,23 +437,22 @@ void IRQbspInit()
 
     expulsion::servo::mode(Mode::ALTERNATE);
     expulsion::servo::alternateFunction(2);
-    expulsion::sense::mode(Mode::INPUT_PULL_UP);
+    expulsion::sense::mode(Mode::INPUT_PULL_DOWN);
     expulsion::nosecone_detach::mode(Mode::INPUT);
 
     cutter::enable::mode(Mode::OUTPUT);
     cutter::enable::low();
     cutter::enable_backup::mode(Mode::OUTPUT);
     cutter::enable_backup::low();
-    cutter::sense::mode(Mode::INPUT);
+    cutter::sense::mode(Mode::INPUT_ANALOG);
 
     airbrakes::servo::mode(Mode::ALTERNATE);
     airbrakes::servo::alternateFunction(3);
     airbrakes::sensor::mode(Mode::INPUT_ANALOG);
 
-    leds::green1::mode(Mode::OUTPUT);
-    leds::green2::mode(Mode::OUTPUT);
-    leds::blue::mode(Mode::OUTPUT);
     leds::red::mode(Mode::OUTPUT);
+    leds::green::mode(Mode::OUTPUT);
+    leds::blue::mode(Mode::OUTPUT);
 
     buzzer::drive::mode(Mode::ALTERNATE);
     buzzer::drive::alternateFunction(3);
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/bsp_impl.h b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/bsp_impl.h
index 9c2141c7..6cf9694a 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/bsp_impl.h
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/bsp_impl.h
@@ -60,18 +60,16 @@ void configureSdram();
 
 inline void ledOn()
 {
-    leds::green1::high();
-    leds::blue::high();
     leds::red::high();
-    leds::green2::high();
+    leds::green::high();
+    leds::blue::high();
 }
 
 inline void ledOff()
 {
-    leds::green1::low();
-    leds::blue::low();
     leds::red::low();
-    leds::green2::low();
+    leds::green::low();
+    leds::blue::low();
 }
 
 /**
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/hwmapping.h b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/hwmapping.h
index c42cda8a..23616cb1 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/hwmapping.h
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/hwmapping.h
@@ -181,7 +181,7 @@ namespace cutter
 {
 using enable        = Gpio<GPIOG_BASE, 2>;
 using enable_backup = Gpio<GPIOG_BASE, 3>;
-using sense         = Gpio<GPIOC_BASE, 14>;
+using sense         = Gpio<GPIOC_BASE, 5>;
 }  // namespace cutter
 
 namespace airbrakes
@@ -192,10 +192,9 @@ using sensor = Gpio<GPIOC_BASE, 3>;  // Airbrakes ADC
 
 namespace leds
 {
-using green1 = Gpio<GPIOC_BASE, 5>;
-using red    = Gpio<GPIOC_BASE, 4>;
-using blue   = Gpio<GPIOD_BASE, 13>;
-using green2 = Gpio<GPIOD_BASE, 12>;
+using red   = Gpio<GPIOC_BASE, 4>;
+using green = Gpio<GPIOD_BASE, 12>;
+using blue  = Gpio<GPIOD_BASE, 13>;
 }  // namespace leds
 
 namespace buzzer
-- 
GitLab