From c8d2516c6d42bbd60f3c1b35f237546bdc2d18ce Mon Sep 17 00:00:00 2001 From: Dan Green Date: Tue, 4 Apr 2023 17:38:09 -0700 Subject: [PATCH] Fix missing Polarity on PinConf --- src/drivers/pinconf.hh | 2 ++ src/main.cc | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/drivers/pinconf.hh b/src/drivers/pinconf.hh index a780cbd..e3af8a1 100644 --- a/src/drivers/pinconf.hh +++ b/src/drivers/pinconf.hh @@ -96,6 +96,8 @@ struct PinConf { PinNum pin{PinNum::Unused}; PinAF af{PinAF::AFNone}; + // FIXME: Polarity is not used + void init(PinMode mode, PinPull pull = PinPull::None, PinPolarity polarity = PinPolarity::Normal, diff --git a/src/main.cc b/src/main.cc index de2bc65..cbd7655 100644 --- a/src/main.cc +++ b/src/main.cc @@ -47,10 +47,10 @@ void main() // Check Boot Select pin if constexpr (Board::UseBootSelect) { - Board::BootSelectPin.init(PinMode::Input, PinPull::Up, PinPolarity::Inverted); + Board::BootSelectPin.init(PinMode::Input, PinPull::Up); // delay to allow pull-up to settle udelay(1000); - if (Board::BootSelectPin.read()) { + if (!Board::BootSelectPin.read()) { image_type = BootLoader::LoadTarget::SSBL; print("Boot Select pin detected active: Loading alt image...\n"); }