Minor tweaks after rebase onto main

pull/21/head
D.R.racer 2021-06-08 07:11:11 +02:00 committed by DRracer
parent 6f1624b718
commit 271a2dd7df
2 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ struct UnloadToFinda {
namespace mm = modules::motion; namespace mm = modules::motion;
namespace mf = modules::finda; namespace mf = modules::finda;
// check the inital state of FINDA and plan the moves // check the inital state of FINDA and plan the moves
if (mf::finda.Status() == mf::Off) { if (mf::finda.Pressed()) {
state = OK; // FINDA is already off, we assume the fillament is not there, i.e. already unloaded state = OK; // FINDA is already off, we assume the fillament is not there, i.e. already unloaded
} else { } else {
// FINDA is sensing the filament, plan moves to unload it // FINDA is sensing the filament, plan moves to unload it
@ -62,7 +62,7 @@ struct UnloadToFinda {
namespace mf = modules::finda; namespace mf = modules::finda;
switch (state) { switch (state) {
case WaitingForFINDA: case WaitingForFINDA:
if (modules::finda::finda.Status() == modules::finda::Off) { if (modules::finda::finda.Pressed()) {
// detected end of filament // detected end of filament
state = OK; state = OK;
} else if (/*tmc2130_read_gstat() &&*/ mm::motion.QueueEmpty()) { } else if (/*tmc2130_read_gstat() &&*/ mm::motion.QueueEmpty()) {

View File

@ -179,7 +179,7 @@ void ProcessRequestMsg(const modules::protocol::RequestMsg &rq) {
break; break;
case mp::RequestMsgCodes::Finda: case mp::RequestMsgCodes::Finda:
// immediately report FINDA status // immediately report FINDA status
SendMessage(mp::ResponseMsg(rq, mp::ResponseMsgParamCodes::Accepted, modules::finda::finda.Status())); SendMessage(mp::ResponseMsg(rq, mp::ResponseMsgParamCodes::Accepted, modules::finda::finda.Pressed()));
break; break;
case mp::RequestMsgCodes::Mode: case mp::RequestMsgCodes::Mode:
// immediately switch to normal/stealth as requested // immediately switch to normal/stealth as requested
@ -249,7 +249,7 @@ void loop() {
} }
modules::buttons::buttons.Step(hal::adc::ReadADC(0)); modules::buttons::buttons.Step(hal::adc::ReadADC(0));
modules::leds::leds.Step(0); modules::leds::leds.Step(0);
modules::finda::finda.Step(); modules::finda::finda.Step(0);
currentCommand->Step(); currentCommand->Step();
// add a watchdog reset // add a watchdog reset
} }