Fix unit test: unload_filament

pull/109/head
3d-gussner 2021-08-22 19:57:15 +02:00 committed by DRracer
parent d5e473f9c9
commit 763e33f79a
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ TEST_CASE("eject_filament::eject0", "[eject_filament][.]") {
// idler and selector reached their target positions and the CF automaton will start feeding to FINDA as the next step // idler and selector reached their target positions and the CF automaton will start feeding to FINDA as the next step
REQUIRE(ef.TopLevelState() == ProgressCode::FeedingToFinda); REQUIRE(ef.TopLevelState() == ProgressCode::FeedingToFinda);
// prepare for simulated finda trigger // prepare for simulated finda trigger
hal::adc::ReinitADC(config::findaADCIndex, hal::adc::TADCData({ 0, 0, 0, 0, 600, 700, 800, 900 }), 10); hal::gpio::WritePin(FINDA_PIN, hal::gpio::Level::high);
REQUIRE(WhileTopState(ef, ProgressCode::FeedingToFinda, 50000)); REQUIRE(WhileTopState(ef, ProgressCode::FeedingToFinda, 50000));
// filament fed into FINDA, cutting... // filament fed into FINDA, cutting...

View File

@ -55,7 +55,7 @@ void RegularUnloadFromSlot04(uint8_t slot, logic::UnloadFilament &uf) {
uf, uf,
[&](int step) -> bool { [&](int step) -> bool {
if(step == 100){ // on 100th step make FINDA trigger if(step == 100){ // on 100th step make FINDA trigger
hal::adc::SetADC(config::findaADCIndex, 0); hal::gpio::WritePin(FINDA_PIN, hal::gpio::Level::low);
} }
return uf.TopLevelState() == ProgressCode::UnloadingToFinda; }, return uf.TopLevelState() == ProgressCode::UnloadingToFinda; },
50000)); 50000));
@ -205,7 +205,7 @@ void FindaDidntTriggerResolveHelpFindaTriggered(uint8_t slot, logic::UnloadFilam
uf, uf,
[&](int step) -> bool { [&](int step) -> bool {
if(step == 100){ // on 100th step make FINDA trigger if(step == 100){ // on 100th step make FINDA trigger
hal::adc::SetADC(config::findaADCIndex, 0); hal::gpio::WritePin(FINDA_PIN, hal::gpio::Level::low);
} }
return uf.TopLevelState() == ProgressCode::ERRHelpingFilament; }, return uf.TopLevelState() == ProgressCode::ERRHelpingFilament; },
5000)); 5000));