diff --git a/tests/unit/logic/feed_to_finda/test_feed_to_finda.cpp b/tests/unit/logic/feed_to_finda/test_feed_to_finda.cpp index e08bf89..233c413 100644 --- a/tests/unit/logic/feed_to_finda/test_feed_to_finda.cpp +++ b/tests/unit/logic/feed_to_finda/test_feed_to_finda.cpp @@ -55,8 +55,7 @@ TEST_CASE("feed_to_finda::feed_phase_unlimited", "[feed_to_finda]") { REQUIRE(ml::leds.LedOn(mg::globals.ActiveSlot(), ml::Color::green)); // now let the filament be pushed into the FINDA - do 500 steps without triggering the condition - // and then let the simulated ADC channel 1 create a FINDA switch - ha::ReinitADC(config::findaADCIndex, ha::TADCData({ 600, 700, 800, 900 }), 1); + hal::gpio::WritePin(FINDA_PIN, hal::gpio::Level::high); REQUIRE(WhileCondition( ff, @@ -121,7 +120,7 @@ TEST_CASE("feed_to_finda::FINDA_failed", "[feed_to_finda]") { REQUIRE(ml::leds.Mode(mg::globals.ActiveSlot(), ml::Color::green) == ml::blink0); // now let the filament be pushed into the FINDA - but we make sure the FINDA doesn't trigger at all - ha::ReinitADC(config::findaADCIndex, ha::TADCData({ 0 }), 100); + hal::gpio::WritePin(FINDA_PIN, hal::gpio::Level::low); REQUIRE(WhileCondition( ff, diff --git a/tests/unit/logic/stubs/main_loop_stub.cpp b/tests/unit/logic/stubs/main_loop_stub.cpp index 8903784..338e585 100644 --- a/tests/unit/logic/stubs/main_loop_stub.cpp +++ b/tests/unit/logic/stubs/main_loop_stub.cpp @@ -56,7 +56,7 @@ void ForceReinitAllAutomata() { hal::adc::ReinitADC(config::buttonsADCIndex, hal::adc::TADCData({ 1023 }), 1); // finda OFF - hal::adc::ReinitADC(config::findaADCIndex, hal::adc::TADCData({ 0 }), 1); + hal::gpio::WritePin(FINDA_PIN, hal::gpio::Level::low); // reinit timing mt::ReinitTimebase(); @@ -79,7 +79,7 @@ void EnsureActiveSlotIndex(uint8_t slot) { } void SetFINDAStateAndDebounce(bool press) { - hal::adc::SetADC(config::findaADCIndex, press ? config::findaADCDecisionLevel + 1 : config::findaADCDecisionLevel - 1); + hal::gpio::WritePin(FINDA_PIN, hal::gpio::Level::high); for (size_t i = 0; i < config::findaDebounceMs + 1; ++i) main_loop(); }