Misc. improvements (#12747)

* Make ExtUI respect MAXTEMP limits
  - Temperatures are now clamped by MAXTEMP limits rather than arbitrary values.
* Speed up USB init, add status
  - Speed up USB initialization
  - Show status message if init failed
* Enable status messages for EXTENSIBLE_UI
* Adjust max limit to MAX_TEMP - 15
* Misc. tweaks to formatting, const, etc.
This commit is contained in:
Marcio Teixeira
2019-01-01 14:17:48 -07:00
committed by Scott Lahteine
parent 4f2473053c
commit 60cb36bef3
12 changed files with 188 additions and 209 deletions

View File

@ -544,16 +544,20 @@ namespace ExtUI {
}
void setTargetTemp_celsius(float value, const heater_t heater) {
constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP);
const int16_t e = heater - H0;
#if HAS_HEATED_BED
if (heater == BED)
thermalManager.setTargetBed(clamp(value,0,200));
thermalManager.setTargetBed(clamp(value, 0, BED_MAXTEMP - 15));
else
#endif
thermalManager.setTargetHotend(clamp(value,0,500), heater - H0);
thermalManager.setTargetHotend(clamp(value, 0, heater_maxtemp[e] - 15), e);
}
void setTargetTemp_celsius(float value, const extruder_t extruder) {
thermalManager.setTargetHotend(clamp(value,0,500), extruder - E0);
constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP);
const int16_t e = extruder - E0;
thermalManager.setTargetHotend(clamp(value, 0, heater_maxtemp[e] - 15), e);
}
void setFan_percent(float value, const fan_t fan) {