Enforce sensor range for temperature target (#18465)

* Mitigate stepper timeout

* Add CHAMBER PWM code

* Structured thermistor tables

* Fix reversed sensor ranges

* Prevent temps outside sensor range
This commit is contained in:
Scott Lahteine
2020-07-01 16:27:28 -05:00
committed by GitHub
parent 70fa4c9323
commit c43bbcce15
56 changed files with 295 additions and 167 deletions

View File

@@ -240,10 +240,6 @@ bool wait_for_heatup = true;
#endif
// Inactivity shutdown
millis_t max_inactive_time, // = 0
stepper_inactive_time = SEC_TO_MS(DEFAULT_STEPPER_DEACTIVE_TIME);
#if PIN_EXISTS(CHDK)
extern millis_t chdk_timeout;
#endif
@@ -469,20 +465,23 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
const millis_t ms = millis();
if (max_inactive_time && ELAPSED(ms, gcode.previous_move_ms + max_inactive_time)) {
// Prevent steppers timing-out in the middle of M600
#define STAY_TEST (BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT) && did_pause_print)
if (STAY_TEST || ignore_stepper_queue)
gcode.reset_stepper_timeout(ms);
if (gcode.stepper_max_timed_out(ms)) {
SERIAL_ERROR_START();
SERIAL_ECHOLNPAIR(STR_KILL_INACTIVE_TIME, parser.command_ptr);
kill();
}
// Prevent steppers timing-out in the middle of M600
#define STAY_TEST (BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT) && did_pause_print)
if (stepper_inactive_time) {
if (gcode.stepper_inactive_time) {
static bool already_shutdown_steppers; // = false
if (planner.has_blocks_queued())
gcode.reset_stepper_timeout();
else if (!STAY_TEST && !ignore_stepper_queue && ELAPSED(ms, gcode.previous_move_ms + stepper_inactive_time)) {
gcode.reset_stepper_timeout(ms);
else if (!STAY_TEST && !ignore_stepper_queue && gcode.stepper_inactive_timeout()) {
if (!already_shutdown_steppers) {
already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this
if (ENABLED(DISABLE_INACTIVE_X)) DISABLE_AXIS_X();
@@ -601,7 +600,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
}
#endif // !SWITCHING_EXTRUDER
gcode.reset_stepper_timeout();
gcode.reset_stepper_timeout(ms);
}
#endif // EXTRUDER_RUNOUT_PREVENT