Merge pull request #5972 from thinkyhead/rc_cooldown_before
Fix preheat menu formatting
This commit is contained in:
commit
a9a1971295
@ -105,6 +105,9 @@
|
||||
#ifndef MSG_PREHEAT_1_ALL
|
||||
#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" All")
|
||||
#endif
|
||||
#ifndef MSG_PREHEAT_1_END
|
||||
#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" End")
|
||||
#endif
|
||||
#ifndef MSG_PREHEAT_1_BEDONLY
|
||||
#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Bed")
|
||||
#endif
|
||||
@ -120,6 +123,9 @@
|
||||
#ifndef MSG_PREHEAT_2_ALL
|
||||
#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" All")
|
||||
#endif
|
||||
#ifndef MSG_PREHEAT_2_END
|
||||
#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" End")
|
||||
#endif
|
||||
#ifndef MSG_PREHEAT_2_BEDONLY
|
||||
#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Bed")
|
||||
#endif
|
||||
@ -129,9 +135,6 @@
|
||||
#ifndef MSG_COOLDOWN
|
||||
#define MSG_COOLDOWN _UxGT("Cooldown")
|
||||
#endif
|
||||
#ifndef MSG_HOTEND
|
||||
#define MSG_HOTEND _UxGT("Hotend")
|
||||
#endif
|
||||
#ifndef MSG_SWITCH_PS_ON
|
||||
#define MSG_SWITCH_PS_ON _UxGT("Switch power on")
|
||||
#endif
|
||||
|
@ -451,7 +451,7 @@ void Stepper::isr() {
|
||||
|
||||
|
||||
#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
|
||||
if (ENDSTOPS_ENABLED && e_hit) {
|
||||
if (e_hit && ENDSTOPS_ENABLED) {
|
||||
endstops.update();
|
||||
e_hit--;
|
||||
}
|
||||
|
@ -1087,17 +1087,17 @@ void Temperature::init() {
|
||||
delay(250);
|
||||
|
||||
#define TEMP_MIN_ROUTINE(NR) \
|
||||
minttemp[NR] = HEATER_ ## NR ## _MINTEMP; \
|
||||
while(analog2temp(minttemp_raw[NR], NR) < HEATER_ ## NR ## _MINTEMP) { \
|
||||
if (HEATER_ ## NR ## _RAW_LO_TEMP < HEATER_ ## NR ## _RAW_HI_TEMP) \
|
||||
minttemp[NR] = HEATER_ ##NR## _MINTEMP; \
|
||||
while(analog2temp(minttemp_raw[NR], NR) < HEATER_ ##NR## _MINTEMP) { \
|
||||
if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \
|
||||
minttemp_raw[NR] += OVERSAMPLENR; \
|
||||
else \
|
||||
minttemp_raw[NR] -= OVERSAMPLENR; \
|
||||
}
|
||||
#define TEMP_MAX_ROUTINE(NR) \
|
||||
maxttemp[NR] = HEATER_ ## NR ## _MAXTEMP; \
|
||||
while(analog2temp(maxttemp_raw[NR], NR) > HEATER_ ## NR ## _MAXTEMP) { \
|
||||
if (HEATER_ ## NR ## _RAW_LO_TEMP < HEATER_ ## NR ## _RAW_HI_TEMP) \
|
||||
maxttemp[NR] = HEATER_ ##NR## _MAXTEMP; \
|
||||
while(analog2temp(maxttemp_raw[NR], NR) > HEATER_ ##NR## _MAXTEMP) { \
|
||||
if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \
|
||||
maxttemp_raw[NR] -= OVERSAMPLENR; \
|
||||
else \
|
||||
maxttemp_raw[NR] += OVERSAMPLENR; \
|
||||
@ -1256,7 +1256,7 @@ void Temperature::disable_all_heaters() {
|
||||
#define DISABLE_HEATER(NR) { \
|
||||
setTargetHotend(0, NR); \
|
||||
soft_pwm[NR] = 0; \
|
||||
WRITE_HEATER_ ## NR (LOW); \
|
||||
WRITE_HEATER_ ##NR (LOW); \
|
||||
}
|
||||
|
||||
#if HAS_TEMP_HOTEND
|
||||
@ -1477,9 +1477,11 @@ void Temperature::set_current_temp_raw() {
|
||||
* in OCR0B above (128 or halfway between OVFs).
|
||||
*
|
||||
* - Manage PWM to all the heaters and fan
|
||||
* - Update the raw temperature values
|
||||
* - Check new temperature values for MIN/MAX errors
|
||||
* - Prepare or Measure one of the raw ADC sensor values
|
||||
* - Check new temperature values for MIN/MAX errors (kill on error)
|
||||
* - Step the babysteps value for each axis towards 0
|
||||
* - For PINS_DEBUGGING, monitor and report endstop pins
|
||||
* - For ENDSTOP_INTERRUPTS_FEATURE check endstops if flagged
|
||||
*/
|
||||
ISR(TIMER0_COMPB_vect) { Temperature::isr(); }
|
||||
|
||||
@ -1535,37 +1537,37 @@ void Temperature::isr() {
|
||||
*/
|
||||
if (pwm_count == 0) {
|
||||
soft_pwm_0 = soft_pwm[0];
|
||||
WRITE_HEATER_0(soft_pwm_0 > 0 ? 1 : 0);
|
||||
WRITE_HEATER_0(soft_pwm_0 > 0 ? HIGH : LOW);
|
||||
#if HOTENDS > 1
|
||||
soft_pwm_1 = soft_pwm[1];
|
||||
WRITE_HEATER_1(soft_pwm_1 > 0 ? 1 : 0);
|
||||
WRITE_HEATER_1(soft_pwm_1 > 0 ? HIGH : LOW);
|
||||
#if HOTENDS > 2
|
||||
soft_pwm_2 = soft_pwm[2];
|
||||
WRITE_HEATER_2(soft_pwm_2 > 0 ? 1 : 0);
|
||||
WRITE_HEATER_2(soft_pwm_2 > 0 ? HIGH : LOW);
|
||||
#if HOTENDS > 3
|
||||
soft_pwm_3 = soft_pwm[3];
|
||||
WRITE_HEATER_3(soft_pwm_3 > 0 ? 1 : 0);
|
||||
WRITE_HEATER_3(soft_pwm_3 > 0 ? HIGH : LOW);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_HEATER_BED
|
||||
soft_pwm_BED = soft_pwm_bed;
|
||||
WRITE_HEATER_BED(soft_pwm_BED > 0 ? 1 : 0);
|
||||
WRITE_HEATER_BED(soft_pwm_BED > 0 ? HIGH : LOW);
|
||||
#endif
|
||||
|
||||
#if ENABLED(FAN_SOFT_PWM)
|
||||
#if HAS_FAN0
|
||||
soft_pwm_fan[0] = fanSpeedSoftPwm[0] >> 1;
|
||||
WRITE_FAN(soft_pwm_fan[0] > 0 ? 1 : 0);
|
||||
WRITE_FAN(soft_pwm_fan[0] > 0 ? HIGH : LOW);
|
||||
#endif
|
||||
#if HAS_FAN1
|
||||
soft_pwm_fan[1] = fanSpeedSoftPwm[1] >> 1;
|
||||
WRITE_FAN1(soft_pwm_fan[1] > 0 ? 1 : 0);
|
||||
WRITE_FAN1(soft_pwm_fan[1] > 0 ? HIGH : LOW);
|
||||
#endif
|
||||
#if HAS_FAN2
|
||||
soft_pwm_fan[2] = fanSpeedSoftPwm[2] >> 1;
|
||||
WRITE_FAN2(soft_pwm_fan[2] > 0 ? 1 : 0);
|
||||
WRITE_FAN2(soft_pwm_fan[2] > 0 ? HIGH : LOW);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
@ -1621,29 +1623,29 @@ void Temperature::isr() {
|
||||
|
||||
// Macros for Slow PWM timer logic
|
||||
#define _SLOW_PWM_ROUTINE(NR, src) \
|
||||
soft_pwm_ ## NR = src; \
|
||||
if (soft_pwm_ ## NR > 0) { \
|
||||
if (state_timer_heater_ ## NR == 0) { \
|
||||
if (state_heater_ ## NR == 0) state_timer_heater_ ## NR = MIN_STATE_TIME; \
|
||||
state_heater_ ## NR = 1; \
|
||||
WRITE_HEATER_ ## NR(1); \
|
||||
soft_pwm_ ##NR = src; \
|
||||
if (soft_pwm_ ##NR > 0) { \
|
||||
if (state_timer_heater_ ##NR == 0) { \
|
||||
if (state_heater_ ##NR == 0) state_timer_heater_ ##NR = MIN_STATE_TIME; \
|
||||
state_heater_ ##NR = 1; \
|
||||
WRITE_HEATER_ ##NR(1); \
|
||||
} \
|
||||
} \
|
||||
else { \
|
||||
if (state_timer_heater_ ## NR == 0) { \
|
||||
if (state_heater_ ## NR == 1) state_timer_heater_ ## NR = MIN_STATE_TIME; \
|
||||
state_heater_ ## NR = 0; \
|
||||
WRITE_HEATER_ ## NR(0); \
|
||||
if (state_timer_heater_ ##NR == 0) { \
|
||||
if (state_heater_ ##NR == 1) state_timer_heater_ ##NR = MIN_STATE_TIME; \
|
||||
state_heater_ ##NR = 0; \
|
||||
WRITE_HEATER_ ##NR(0); \
|
||||
} \
|
||||
}
|
||||
#define SLOW_PWM_ROUTINE(n) _SLOW_PWM_ROUTINE(n, soft_pwm[n])
|
||||
|
||||
#define PWM_OFF_ROUTINE(NR) \
|
||||
if (soft_pwm_ ## NR < slow_pwm_count) { \
|
||||
if (state_timer_heater_ ## NR == 0) { \
|
||||
if (state_heater_ ## NR == 1) state_timer_heater_ ## NR = MIN_STATE_TIME; \
|
||||
state_heater_ ## NR = 0; \
|
||||
WRITE_HEATER_ ## NR (0); \
|
||||
if (soft_pwm_ ##NR < slow_pwm_count) { \
|
||||
if (state_timer_heater_ ##NR == 0) { \
|
||||
if (state_heater_ ##NR == 1) state_timer_heater_ ##NR = MIN_STATE_TIME; \
|
||||
state_heater_ ##NR = 0; \
|
||||
WRITE_HEATER_ ##NR (0); \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -1683,15 +1685,15 @@ void Temperature::isr() {
|
||||
if (pwm_count == 0) {
|
||||
#if HAS_FAN0
|
||||
soft_pwm_fan[0] = fanSpeedSoftPwm[0] >> 1;
|
||||
WRITE_FAN(soft_pwm_fan[0] > 0 ? 1 : 0);
|
||||
WRITE_FAN(soft_pwm_fan[0] > 0 ? HIGH : LOW);
|
||||
#endif
|
||||
#if HAS_FAN1
|
||||
soft_pwm_fan[1] = fanSpeedSoftPwm[1] >> 1;
|
||||
WRITE_FAN1(soft_pwm_fan[1] > 0 ? 1 : 0);
|
||||
WRITE_FAN1(soft_pwm_fan[1] > 0 ? HIGH : LOW);
|
||||
#endif
|
||||
#if HAS_FAN2
|
||||
soft_pwm_fan[2] = fanSpeedSoftPwm[2] >> 1;
|
||||
WRITE_FAN2(soft_pwm_fan[2] > 0 ? 1 : 0);
|
||||
WRITE_FAN2(soft_pwm_fan[2] > 0 ? HIGH : LOW);
|
||||
#endif
|
||||
}
|
||||
#if HAS_FAN0
|
||||
|
@ -763,6 +763,7 @@ void kill_screen(const char* lcd_msg) {
|
||||
*
|
||||
*/
|
||||
|
||||
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
||||
/**
|
||||
* Set the home offset based on the current_position
|
||||
*/
|
||||
@ -771,6 +772,7 @@ void kill_screen(const char* lcd_msg) {
|
||||
enqueue_and_echo_commands_P(PSTR("M428"));
|
||||
lcd_return_to_status();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(BABYSTEPPING)
|
||||
|
||||
@ -1106,16 +1108,16 @@ void kill_screen(const char* lcd_msg) {
|
||||
#if HOTENDS == 1
|
||||
#if TEMP_SENSOR_BED != 0
|
||||
MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0);
|
||||
MENU_ITEM(function, MSG_PREHEAT_1 MSG_HOTEND, lcd_preheat_m1_e0_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_END, lcd_preheat_m1_e0_only);
|
||||
#else
|
||||
MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only);
|
||||
#endif
|
||||
#else
|
||||
#if TEMP_SENSOR_BED != 0
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0);
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_N MSG_HOTEND " " MSG_E1, lcd_preheat_m1_e0_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E1, lcd_preheat_m1_e0_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1);
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_N MSG_HOTEND " " MSG_E2, lcd_preheat_m1_e1_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E2, lcd_preheat_m1_e1_only);
|
||||
#else
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1_only);
|
||||
@ -1124,14 +1126,14 @@ void kill_screen(const char* lcd_msg) {
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2_only);
|
||||
#if TEMP_SENSOR_BED != 0
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2);
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_N MSG_HOTEND " " MSG_E3, lcd_preheat_m1_e2_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E3, lcd_preheat_m1_e2_only);
|
||||
#else
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2_only);
|
||||
#endif
|
||||
#if HOTENDS > 3
|
||||
#if TEMP_SENSOR_BED != 0
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3);
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_N MSG_HOTEND " " MSG_E4, lcd_preheat_m1_e3_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E4, lcd_preheat_m1_e3_only);
|
||||
#else
|
||||
MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3_only);
|
||||
#endif
|
||||
@ -1151,16 +1153,16 @@ void kill_screen(const char* lcd_msg) {
|
||||
#if HOTENDS == 1
|
||||
#if TEMP_SENSOR_BED != 0
|
||||
MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0);
|
||||
MENU_ITEM(function, MSG_PREHEAT_2 MSG_HOTEND, lcd_preheat_m2_e0_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_END, lcd_preheat_m2_e0_only);
|
||||
#else
|
||||
MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only);
|
||||
#endif
|
||||
#else
|
||||
#if TEMP_SENSOR_BED != 0
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0);
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_N MSG_HOTEND " " MSG_E1, lcd_preheat_m2_e0_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E1, lcd_preheat_m2_e0_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1);
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_N MSG_HOTEND " " MSG_E2, lcd_preheat_m2_e1_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E2, lcd_preheat_m2_e1_only);
|
||||
#else
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1_only);
|
||||
@ -1169,14 +1171,14 @@ void kill_screen(const char* lcd_msg) {
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2_only);
|
||||
#if TEMP_SENSOR_BED != 0
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2);
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_N MSG_HOTEND " " MSG_E3, lcd_preheat_m2_e2_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E3, lcd_preheat_m2_e2_only);
|
||||
#else
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2_only);
|
||||
#endif
|
||||
#if HOTENDS > 3
|
||||
#if TEMP_SENSOR_BED != 0
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3);
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_N MSG_HOTEND " " MSG_E4, lcd_preheat_m2_e3_only);
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E4, lcd_preheat_m2_e3_only);
|
||||
#else
|
||||
MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3_only);
|
||||
#endif
|
||||
@ -1427,11 +1429,13 @@ KeepDrawing:
|
||||
MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed);
|
||||
#endif
|
||||
|
||||
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
||||
//
|
||||
// Set Home Offsets
|
||||
//
|
||||
MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
|
||||
//MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
|
||||
#endif
|
||||
|
||||
//
|
||||
// Disable Steppers
|
||||
|
Loading…
Reference in New Issue
Block a user