Add a read function for mmu_print_saved

and remove the old extern value which is not used anymore

I had to remove "MMU2::" from mmu2_protocol_logic.cpp, otherwise the build failed.
This commit is contained in:
Guðni Már Gilbert 2022-04-24 14:01:37 +00:00 committed by D.R.racer
parent dcebad21c8
commit 11290c1123
4 changed files with 8 additions and 7 deletions

View File

@ -21,6 +21,7 @@
#include "Configuration.h"
#include "pins.h"
#include "Timer.h"
#include "mmu2.h"
extern uint8_t mbl_z_probe_nr;
#ifndef AT90USB

View File

@ -295,9 +295,6 @@ float saved_start_position[NUM_AXIS] = {SAVED_START_POSITION_UNSET, 0, 0, 0};
uint16_t saved_segment_idx = 0;
// save/restore printing in case that mmu was not responding
bool mmu_print_saved = false;
// storing estimated time to end of print counted by slicer
uint8_t print_percent_done_normal = PRINT_PERCENT_DONE_INIT;
uint8_t print_percent_done_silent = PRINT_PERCENT_DONE_INIT;

View File

@ -129,7 +129,10 @@ public:
return { 0, 0, 0};
}
}
/// Method to read-only mmu_print_saved
bool MMU_PRINT_SAVED() const { return mmu_print_saved; }
private:
/// Perform software self-reset of the MMU (sends an X0 command)
void ResetX0();

View File

@ -344,7 +344,7 @@ void ProtocolLogic::PlanGenericRequest(RequestMsg rq) {
} // otherwise wait for an empty window to activate the request
}
bool MMU2::ProtocolLogic::ActivatePlannedRequest(){
bool ProtocolLogic::ActivatePlannedRequest(){
if( plannedRq.code == RequestMsgCodes::Button ){
// only issue the button to the MMU and do not restart the state machines
command.SendButton(plannedRq.value);
@ -466,7 +466,7 @@ void ProtocolLogic::LogRequestMsg(const uint8_t *txbuff, uint8_t size){
memcpy(lastMsg, tmp, rqs);
}
void MMU2::ProtocolLogic::LogError(const char *reason){
void ProtocolLogic::LogError(const char *reason){
char lrb[lastReceivedBytes.size() * 3];
FormatLastReceivedBytes(lrb);
@ -482,7 +482,7 @@ void ProtocolLogic::LogResponse(){
SERIAL_ECHOLN();
}
StepStatus MMU2::ProtocolLogic::HandleCommError(const char *msg, StepStatus ss){
StepStatus ProtocolLogic::HandleCommError(const char *msg, StepStatus ss){
protocol.ResetResponseDecoder();
HandleCommunicationTimeout();
if( dataTO.Record(ss) ){