Implement fsensor raii event suppression
This commit is contained in:
parent
1211ad9360
commit
74fad4f8f6
|
|
@ -7,8 +7,21 @@ FilamentState WhereIsFilament(){
|
|||
return fsensor.getFilamentPresent() ? FilamentState::IN_NOZZLE : FilamentState::NOT_PRESENT;
|
||||
}
|
||||
|
||||
// on AVR this does nothing
|
||||
BlockRunoutRAII::BlockRunoutRAII() { }
|
||||
BlockRunoutRAII::~BlockRunoutRAII() { }
|
||||
|
||||
BlockRunoutRAII::BlockRunoutRAII() {
|
||||
#ifdef FILAMENT_SENSOR
|
||||
fsensor.setRunoutEnabled(false); //suppress filament runouts while loading filament.
|
||||
fsensor.setAutoLoadEnabled(false); //suppress filament autoloads while loading filament.
|
||||
#if (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125)
|
||||
fsensor.setJamDetectionEnabled(false); //suppress filament jam detection while loading filament.
|
||||
#endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125)
|
||||
#endif
|
||||
}
|
||||
|
||||
BlockRunoutRAII::~BlockRunoutRAII() {
|
||||
#ifdef FILAMENT_SENSOR
|
||||
fsensor.settings_init(); // restore filament runout state.
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace MMU2
|
||||
|
|
|
|||
Loading…
Reference in New Issue