From 3b46c3559568f537ba5d6e24b9adfdcd28675555 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Tue, 20 Jul 2021 07:28:43 +0200 Subject: [PATCH] Add handling of the X0 message (restart the MMU) via Watchdog --- src/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8dcbf77..08713da 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -294,12 +294,15 @@ void ProcessRequestMsg(const mp::RequestMsg &rq) { break; case mp::RequestMsgCodes::Reset: // immediately reset the board - there is no response in this case - break; // @@TODO + hal::watchdog::ConfigureWatchDog(1); // set the watchdog to the lowest possible timeout + for (;;) + ; // cycle indefinitely (i.e. let the watchdog reset the CPU) + break; case mp::RequestMsgCodes::Version: ReportVersion(rq); break; case mp::RequestMsgCodes::Wait: - break; // @@TODO + break; // @@TODO - not used anywhere yet case mp::RequestMsgCodes::Cut: case mp::RequestMsgCodes::Eject: case mp::RequestMsgCodes::Load: