|
@ -751,7 +751,7 @@ volatile bool Temperature::raw_temps_ready = false; |
|
|
// Report heater states every 2 seconds
|
|
|
// Report heater states every 2 seconds
|
|
|
if (ELAPSED(ms, next_temp_ms)) { |
|
|
if (ELAPSED(ms, next_temp_ms)) { |
|
|
#if HAS_TEMP_SENSOR |
|
|
#if HAS_TEMP_SENSOR |
|
|
print_heater_states(ischamber ? active_extruder : (isbed ? active_extruder : heater_id)); |
|
|
print_heater_states(heater_id < 0 ? active_extruder : (int8_t)heater_id); |
|
|
SERIAL_EOL(); |
|
|
SERIAL_EOL(); |
|
|
#endif |
|
|
#endif |
|
|
next_temp_ms = ms + 2000UL; |
|
|
next_temp_ms = ms + 2000UL; |
|
@ -2817,6 +2817,9 @@ void Temperature::init() { |
|
|
|
|
|
|
|
|
#if HAS_THERMAL_PROTECTION |
|
|
#if HAS_THERMAL_PROTECTION |
|
|
|
|
|
|
|
|
|
|
|
#pragma GCC diagnostic push |
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" |
|
|
|
|
|
|
|
|
Temperature::tr_state_machine_t Temperature::tr_state_machine[NR_HEATER_RUNAWAY]; // = { { TRInactive, 0 } };
|
|
|
Temperature::tr_state_machine_t Temperature::tr_state_machine[NR_HEATER_RUNAWAY]; // = { { TRInactive, 0 } };
|
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
@ -2946,6 +2949,8 @@ void Temperature::init() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#pragma GCC diagnostic pop |
|
|
|
|
|
|
|
|
#endif // HAS_THERMAL_PROTECTION
|
|
|
#endif // HAS_THERMAL_PROTECTION
|
|
|
|
|
|
|
|
|
void Temperature::disable_all_heaters() { |
|
|
void Temperature::disable_all_heaters() { |
|
@ -3669,6 +3674,9 @@ void Temperature::isr() { |
|
|
|
|
|
|
|
|
switch (adc_sensor_state) { |
|
|
switch (adc_sensor_state) { |
|
|
|
|
|
|
|
|
|
|
|
#pragma GCC diagnostic push |
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" |
|
|
|
|
|
|
|
|
case SensorsReady: { |
|
|
case SensorsReady: { |
|
|
// All sensors have been read. Stay in this state for a few
|
|
|
// All sensors have been read. Stay in this state for a few
|
|
|
// ISRs to save on calls to temp update/checking code below.
|
|
|
// ISRs to save on calls to temp update/checking code below.
|
|
@ -3686,6 +3694,8 @@ void Temperature::isr() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#pragma GCC diagnostic pop |
|
|
|
|
|
|
|
|
case StartSampling: // Start of sampling loops. Do updates/checks.
|
|
|
case StartSampling: // Start of sampling loops. Do updates/checks.
|
|
|
if (++temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256) = 164ms.
|
|
|
if (++temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256) = 164ms.
|
|
|
temp_count = 0; |
|
|
temp_count = 0; |
|
@ -3917,7 +3927,7 @@ void Temperature::isr() { |
|
|
delay(2); |
|
|
delay(2); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Temperature::print_heater_states(const uint8_t target_extruder |
|
|
void Temperature::print_heater_states(const int8_t target_extruder |
|
|
OPTARG(HAS_TEMP_REDUNDANT, const bool include_r/*=false*/) |
|
|
OPTARG(HAS_TEMP_REDUNDANT, const bool include_r/*=false*/) |
|
|
) { |
|
|
) { |
|
|
#if HAS_TEMP_HOTEND |
|
|
#if HAS_TEMP_HOTEND |
|
|