From dc3f5764a6d3ffeedd0b24d01831524941259953 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Thu, 16 Sep 2021 10:36:50 +0200 Subject: [PATCH] Add filament sensor status reporting from printer into MMU --- src/main.cpp | 7 ++++--- src/modules/protocol.h | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d8520bc..fd83f2f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -313,9 +313,10 @@ void ProcessRequestMsg(const mp::RequestMsg &rq) { case mp::RequestMsgCodes::Unload: PlanCommand(rq); break; - // case mp::RequestMsgCodes::SetVar: //@@TODO - this is where e.g. printer's fsensor gets updated - // SetVar(rq); - // break; + case mp::RequestMsgCodes::FilamentSensor: // set filament sensor state in the printer + mfs::fsensor.ProcessMessage(rq.value != 0); + ReportCommandAccepted(rq, mp::ResponseMsgParamCodes::Accepted); + break; default: // respond with an error message break; diff --git a/src/modules/protocol.h b/src/modules/protocol.h index 5c1527c..b4c0670 100644 --- a/src/modules/protocol.h +++ b/src/modules/protocol.h @@ -23,7 +23,8 @@ enum class RequestMsgCodes : uint8_t { Button = 'B', Eject = 'E', Wait = 'W', - Cut = 'K' + Cut = 'K', + FilamentSensor = 'F' }; /// Definition of response message parameter codes