Add support for reporting MMU errors via S3 msg
parent
6af65bc4c8
commit
8a1df52d79
|
|
@ -190,6 +190,11 @@ void ReportVersion(const mp::RequestMsg &rq) {
|
|||
case 2:
|
||||
v = project_version_revision;
|
||||
break;
|
||||
case 3:
|
||||
// @@TODO may be allow reporting uint16_t number of errors,
|
||||
// but anything beyond 255 errors means there is something seriously wrong with the MMU
|
||||
v = mg::globals.DriveErrors();
|
||||
break;
|
||||
default:
|
||||
v = 0;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -28,5 +28,13 @@ void Globals::SetFilamentLoaded(bool newFilamentLoaded) {
|
|||
filamentLoaded = newFilamentLoaded;
|
||||
}
|
||||
|
||||
uint16_t Globals::DriveErrors() const {
|
||||
return modules::permanent_storage::DriveError::get();
|
||||
}
|
||||
|
||||
void Globals::IncDriveErrors() {
|
||||
modules::permanent_storage::DriveError::increment();
|
||||
}
|
||||
|
||||
} // namespace globals
|
||||
} // namespace modules
|
||||
|
|
|
|||
|
|
@ -33,6 +33,13 @@ public:
|
|||
/// @param newFilamentLoaded new state
|
||||
void SetFilamentLoaded(bool newFilamentLoaded);
|
||||
|
||||
/// @returns the total number of MMU errors so far
|
||||
/// Errors are stored in the EEPROM
|
||||
uint16_t DriveErrors() const;
|
||||
|
||||
/// Increment MMU errors by 1
|
||||
void IncDriveErrors();
|
||||
|
||||
private:
|
||||
uint8_t activeSlot;
|
||||
bool filamentLoaded;
|
||||
|
|
|
|||
Loading…
Reference in New Issue