Exclude TempErrorSource::ambient for boards without a thermistor

This commit is contained in:
Yuri D'Elia 2022-07-04 23:34:23 +02:00
parent 5965572e88
commit f835537e88

View File

@ -460,7 +460,9 @@ enum class TempErrorSource : uint8_t
{ {
hotend, hotend,
bed, bed,
#ifdef AMBIENT_THERMISTOR
ambient, ambient,
#endif
}; };
// thermal error type (in order of decreasing priority!) // thermal error type (in order of decreasing priority!)
@ -1708,9 +1710,11 @@ void handle_temp_error()
alert_automaton_bed.step(current_temperature_bed, BED_MINTEMP + TEMP_HYSTERESIS); alert_automaton_bed.step(current_temperature_bed, BED_MINTEMP + TEMP_HYSTERESIS);
} }
break; break;
#ifdef AMBIENT_THERMISTOR
case TempErrorSource::ambient: case TempErrorSource::ambient:
ambient_min_temp_error(); ambient_min_temp_error();
break; break;
#endif
} }
break; break;
case TempErrorType::max: case TempErrorType::max:
@ -1721,9 +1725,11 @@ void handle_temp_error()
case TempErrorSource::bed: case TempErrorSource::bed:
bed_max_temp_error(); bed_max_temp_error();
break; break;
#ifdef AMBIENT_THERMISTOR
case TempErrorSource::ambient: case TempErrorSource::ambient:
ambient_max_temp_error(); ambient_max_temp_error();
break; break;
#endif
} }
break; break;
case TempErrorType::preheat: case TempErrorType::preheat:
@ -1735,9 +1741,11 @@ void handle_temp_error()
((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorType)temp_error_state.type == TempErrorType::preheat),
((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); ((TempErrorSource)temp_error_state.source == TempErrorSource::bed));
break; break;
#ifdef AMBIENT_THERMISTOR
case TempErrorSource::ambient: case TempErrorSource::ambient:
// not needed // not needed
break; break;
#endif
} }
break; break;
#ifdef TEMP_MODEL #ifdef TEMP_MODEL