Browse Source

Merge pull request #5972 from thinkyhead/rc_cooldown_before

Fix preheat menu formatting
Scott Lahteine 8 years ago
parent
commit
a9a1971295
4 changed files with 71 additions and 62 deletions
  1. 6
    3
      Marlin/language_en.h
  2. 1
    1
      Marlin/stepper.cpp
  3. 37
    35
      Marlin/temperature.cpp
  4. 27
    23
      Marlin/ultralcd.cpp

+ 6
- 3
Marlin/language_en.h View File

@@ -105,6 +105,9 @@
105 105
 #ifndef MSG_PREHEAT_1_ALL
106 106
   #define MSG_PREHEAT_1_ALL                   MSG_PREHEAT_1 _UxGT(" All")
107 107
 #endif
108
+#ifndef MSG_PREHEAT_1_END
109
+  #define MSG_PREHEAT_1_END                   MSG_PREHEAT_1 _UxGT(" End")
110
+#endif
108 111
 #ifndef MSG_PREHEAT_1_BEDONLY
109 112
   #define MSG_PREHEAT_1_BEDONLY               MSG_PREHEAT_1 _UxGT(" Bed")
110 113
 #endif
@@ -120,6 +123,9 @@
120 123
 #ifndef MSG_PREHEAT_2_ALL
121 124
   #define MSG_PREHEAT_2_ALL                   MSG_PREHEAT_2 _UxGT(" All")
122 125
 #endif
126
+#ifndef MSG_PREHEAT_2_END
127
+  #define MSG_PREHEAT_2_END                   MSG_PREHEAT_2 _UxGT(" End")
128
+#endif
123 129
 #ifndef MSG_PREHEAT_2_BEDONLY
124 130
   #define MSG_PREHEAT_2_BEDONLY               MSG_PREHEAT_2 _UxGT(" Bed")
125 131
 #endif
@@ -129,9 +135,6 @@
129 135
 #ifndef MSG_COOLDOWN
130 136
   #define MSG_COOLDOWN                        _UxGT("Cooldown")
131 137
 #endif
132
-#ifndef MSG_HOTEND
133
-  #define MSG_HOTEND                          _UxGT("Hotend")
134
-#endif
135 138
 #ifndef MSG_SWITCH_PS_ON
136 139
   #define MSG_SWITCH_PS_ON                    _UxGT("Switch power on")
137 140
 #endif

+ 1
- 1
Marlin/stepper.cpp View File

@@ -451,7 +451,7 @@ void Stepper::isr() {
451 451
 
452 452
 
453 453
   #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
454
-    if (ENDSTOPS_ENABLED && e_hit) {
454
+    if (e_hit && ENDSTOPS_ENABLED) {
455 455
       endstops.update();
456 456
       e_hit--;
457 457
     }

+ 37
- 35
Marlin/temperature.cpp View File

@@ -1087,17 +1087,17 @@ void Temperature::init() {
1087 1087
   delay(250);
1088 1088
 
1089 1089
   #define TEMP_MIN_ROUTINE(NR) \
1090
-    minttemp[NR] = HEATER_ ## NR ## _MINTEMP; \
1091
-    while(analog2temp(minttemp_raw[NR], NR) < HEATER_ ## NR ## _MINTEMP) { \
1092
-      if (HEATER_ ## NR ## _RAW_LO_TEMP < HEATER_ ## NR ## _RAW_HI_TEMP) \
1090
+    minttemp[NR] = HEATER_ ##NR## _MINTEMP; \
1091
+    while(analog2temp(minttemp_raw[NR], NR) < HEATER_ ##NR## _MINTEMP) { \
1092
+      if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \
1093 1093
         minttemp_raw[NR] += OVERSAMPLENR; \
1094 1094
       else \
1095 1095
         minttemp_raw[NR] -= OVERSAMPLENR; \
1096 1096
     }
1097 1097
   #define TEMP_MAX_ROUTINE(NR) \
1098
-    maxttemp[NR] = HEATER_ ## NR ## _MAXTEMP; \
1099
-    while(analog2temp(maxttemp_raw[NR], NR) > HEATER_ ## NR ## _MAXTEMP) { \
1100
-      if (HEATER_ ## NR ## _RAW_LO_TEMP < HEATER_ ## NR ## _RAW_HI_TEMP) \
1098
+    maxttemp[NR] = HEATER_ ##NR## _MAXTEMP; \
1099
+    while(analog2temp(maxttemp_raw[NR], NR) > HEATER_ ##NR## _MAXTEMP) { \
1100
+      if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \
1101 1101
         maxttemp_raw[NR] -= OVERSAMPLENR; \
1102 1102
       else \
1103 1103
         maxttemp_raw[NR] += OVERSAMPLENR; \
@@ -1256,7 +1256,7 @@ void Temperature::disable_all_heaters() {
1256 1256
   #define DISABLE_HEATER(NR) { \
1257 1257
     setTargetHotend(0, NR); \
1258 1258
     soft_pwm[NR] = 0; \
1259
-    WRITE_HEATER_ ## NR (LOW); \
1259
+    WRITE_HEATER_ ##NR (LOW); \
1260 1260
   }
1261 1261
 
1262 1262
   #if HAS_TEMP_HOTEND
@@ -1477,9 +1477,11 @@ void Temperature::set_current_temp_raw() {
1477 1477
  * in OCR0B above (128 or halfway between OVFs).
1478 1478
  *
1479 1479
  *  - Manage PWM to all the heaters and fan
1480
- *  - Update the raw temperature values
1481
- *  - Check new temperature values for MIN/MAX errors
1480
+ *  - Prepare or Measure one of the raw ADC sensor values
1481
+ *  - Check new temperature values for MIN/MAX errors (kill on error)
1482 1482
  *  - Step the babysteps value for each axis towards 0
1483
+ *  - For PINS_DEBUGGING, monitor and report endstop pins
1484
+ *  - For ENDSTOP_INTERRUPTS_FEATURE check endstops if flagged
1483 1485
  */
1484 1486
 ISR(TIMER0_COMPB_vect) { Temperature::isr(); }
1485 1487
 
@@ -1535,37 +1537,37 @@ void Temperature::isr() {
1535 1537
      */
1536 1538
     if (pwm_count == 0) {
1537 1539
       soft_pwm_0 = soft_pwm[0];
1538
-      WRITE_HEATER_0(soft_pwm_0 > 0 ? 1 : 0);
1540
+      WRITE_HEATER_0(soft_pwm_0 > 0 ? HIGH : LOW);
1539 1541
       #if HOTENDS > 1
1540 1542
         soft_pwm_1 = soft_pwm[1];
1541
-        WRITE_HEATER_1(soft_pwm_1 > 0 ? 1 : 0);
1543
+        WRITE_HEATER_1(soft_pwm_1 > 0 ? HIGH : LOW);
1542 1544
         #if HOTENDS > 2
1543 1545
           soft_pwm_2 = soft_pwm[2];
1544
-          WRITE_HEATER_2(soft_pwm_2 > 0 ? 1 : 0);
1546
+          WRITE_HEATER_2(soft_pwm_2 > 0 ? HIGH : LOW);
1545 1547
           #if HOTENDS > 3
1546 1548
             soft_pwm_3 = soft_pwm[3];
1547
-            WRITE_HEATER_3(soft_pwm_3 > 0 ? 1 : 0);
1549
+            WRITE_HEATER_3(soft_pwm_3 > 0 ? HIGH : LOW);
1548 1550
           #endif
1549 1551
         #endif
1550 1552
       #endif
1551 1553
 
1552 1554
       #if HAS_HEATER_BED
1553 1555
         soft_pwm_BED = soft_pwm_bed;
1554
-        WRITE_HEATER_BED(soft_pwm_BED > 0 ? 1 : 0);
1556
+        WRITE_HEATER_BED(soft_pwm_BED > 0 ? HIGH : LOW);
1555 1557
       #endif
1556 1558
 
1557 1559
       #if ENABLED(FAN_SOFT_PWM)
1558 1560
         #if HAS_FAN0
1559 1561
           soft_pwm_fan[0] = fanSpeedSoftPwm[0] >> 1;
1560
-          WRITE_FAN(soft_pwm_fan[0] > 0 ? 1 : 0);
1562
+          WRITE_FAN(soft_pwm_fan[0] > 0 ? HIGH : LOW);
1561 1563
         #endif
1562 1564
         #if HAS_FAN1
1563 1565
           soft_pwm_fan[1] = fanSpeedSoftPwm[1] >> 1;
1564
-          WRITE_FAN1(soft_pwm_fan[1] > 0 ? 1 : 0);
1566
+          WRITE_FAN1(soft_pwm_fan[1] > 0 ? HIGH : LOW);
1565 1567
         #endif
1566 1568
         #if HAS_FAN2
1567 1569
           soft_pwm_fan[2] = fanSpeedSoftPwm[2] >> 1;
1568
-          WRITE_FAN2(soft_pwm_fan[2] > 0 ? 1 : 0);
1570
+          WRITE_FAN2(soft_pwm_fan[2] > 0 ? HIGH : LOW);
1569 1571
         #endif
1570 1572
       #endif
1571 1573
     }
@@ -1621,29 +1623,29 @@ void Temperature::isr() {
1621 1623
 
1622 1624
     // Macros for Slow PWM timer logic
1623 1625
     #define _SLOW_PWM_ROUTINE(NR, src) \
1624
-      soft_pwm_ ## NR = src; \
1625
-      if (soft_pwm_ ## NR > 0) { \
1626
-        if (state_timer_heater_ ## NR == 0) { \
1627
-          if (state_heater_ ## NR == 0) state_timer_heater_ ## NR = MIN_STATE_TIME; \
1628
-          state_heater_ ## NR = 1; \
1629
-          WRITE_HEATER_ ## NR(1); \
1626
+      soft_pwm_ ##NR = src; \
1627
+      if (soft_pwm_ ##NR > 0) { \
1628
+        if (state_timer_heater_ ##NR == 0) { \
1629
+          if (state_heater_ ##NR == 0) state_timer_heater_ ##NR = MIN_STATE_TIME; \
1630
+          state_heater_ ##NR = 1; \
1631
+          WRITE_HEATER_ ##NR(1); \
1630 1632
         } \
1631 1633
       } \
1632 1634
       else { \
1633
-        if (state_timer_heater_ ## NR == 0) { \
1634
-          if (state_heater_ ## NR == 1) state_timer_heater_ ## NR = MIN_STATE_TIME; \
1635
-          state_heater_ ## NR = 0; \
1636
-          WRITE_HEATER_ ## NR(0); \
1635
+        if (state_timer_heater_ ##NR == 0) { \
1636
+          if (state_heater_ ##NR == 1) state_timer_heater_ ##NR = MIN_STATE_TIME; \
1637
+          state_heater_ ##NR = 0; \
1638
+          WRITE_HEATER_ ##NR(0); \
1637 1639
         } \
1638 1640
       }
1639 1641
     #define SLOW_PWM_ROUTINE(n) _SLOW_PWM_ROUTINE(n, soft_pwm[n])
1640 1642
 
1641 1643
     #define PWM_OFF_ROUTINE(NR) \
1642
-      if (soft_pwm_ ## NR < slow_pwm_count) { \
1643
-        if (state_timer_heater_ ## NR == 0) { \
1644
-          if (state_heater_ ## NR == 1) state_timer_heater_ ## NR = MIN_STATE_TIME; \
1645
-          state_heater_ ## NR = 0; \
1646
-          WRITE_HEATER_ ## NR (0); \
1644
+      if (soft_pwm_ ##NR < slow_pwm_count) { \
1645
+        if (state_timer_heater_ ##NR == 0) { \
1646
+          if (state_heater_ ##NR == 1) state_timer_heater_ ##NR = MIN_STATE_TIME; \
1647
+          state_heater_ ##NR = 0; \
1648
+          WRITE_HEATER_ ##NR (0); \
1647 1649
         } \
1648 1650
       }
1649 1651
 
@@ -1683,15 +1685,15 @@ void Temperature::isr() {
1683 1685
       if (pwm_count == 0) {
1684 1686
         #if HAS_FAN0
1685 1687
           soft_pwm_fan[0] = fanSpeedSoftPwm[0] >> 1;
1686
-          WRITE_FAN(soft_pwm_fan[0] > 0 ? 1 : 0);
1688
+          WRITE_FAN(soft_pwm_fan[0] > 0 ? HIGH : LOW);
1687 1689
         #endif
1688 1690
         #if HAS_FAN1
1689 1691
           soft_pwm_fan[1] = fanSpeedSoftPwm[1] >> 1;
1690
-          WRITE_FAN1(soft_pwm_fan[1] > 0 ? 1 : 0);
1692
+          WRITE_FAN1(soft_pwm_fan[1] > 0 ? HIGH : LOW);
1691 1693
         #endif
1692 1694
         #if HAS_FAN2
1693 1695
           soft_pwm_fan[2] = fanSpeedSoftPwm[2] >> 1;
1694
-          WRITE_FAN2(soft_pwm_fan[2] > 0 ? 1 : 0);
1696
+          WRITE_FAN2(soft_pwm_fan[2] > 0 ? HIGH : LOW);
1695 1697
         #endif
1696 1698
       }
1697 1699
       #if HAS_FAN0

+ 27
- 23
Marlin/ultralcd.cpp View File

@@ -763,14 +763,16 @@ void kill_screen(const char* lcd_msg) {
763 763
    *
764 764
    */
765 765
 
766
-  /**
767
-   * Set the home offset based on the current_position
768
-   */
769
-  void lcd_set_home_offsets() {
770
-    // M428 Command
771
-    enqueue_and_echo_commands_P(PSTR("M428"));
772
-    lcd_return_to_status();
773
-  }
766
+  #if DISABLED(NO_WORKSPACE_OFFSETS)
767
+    /**
768
+     * Set the home offset based on the current_position
769
+     */
770
+    void lcd_set_home_offsets() {
771
+      // M428 Command
772
+      enqueue_and_echo_commands_P(PSTR("M428"));
773
+      lcd_return_to_status();
774
+    }
775
+  #endif
774 776
 
775 777
   #if ENABLED(BABYSTEPPING)
776 778
 
@@ -1106,16 +1108,16 @@ void kill_screen(const char* lcd_msg) {
1106 1108
       #if HOTENDS == 1
1107 1109
         #if TEMP_SENSOR_BED != 0
1108 1110
           MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0);
1109
-          MENU_ITEM(function, MSG_PREHEAT_1 MSG_HOTEND, lcd_preheat_m1_e0_only);
1111
+          MENU_ITEM(function, MSG_PREHEAT_1_END, lcd_preheat_m1_e0_only);
1110 1112
         #else
1111 1113
           MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only);
1112 1114
         #endif
1113 1115
       #else
1114 1116
         #if TEMP_SENSOR_BED != 0
1115 1117
           MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0);
1116
-          MENU_ITEM(function, MSG_PREHEAT_1_N MSG_HOTEND " " MSG_E1, lcd_preheat_m1_e0_only);
1118
+          MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E1, lcd_preheat_m1_e0_only);
1117 1119
           MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1);
1118
-          MENU_ITEM(function, MSG_PREHEAT_1_N MSG_HOTEND " " MSG_E2, lcd_preheat_m1_e1_only);
1120
+          MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E2, lcd_preheat_m1_e1_only);
1119 1121
         #else
1120 1122
           MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0_only);
1121 1123
           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) {
1124 1126
           MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2_only);
1125 1127
           #if TEMP_SENSOR_BED != 0
1126 1128
             MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2);
1127
-            MENU_ITEM(function, MSG_PREHEAT_1_N MSG_HOTEND " " MSG_E3, lcd_preheat_m1_e2_only);
1129
+            MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E3, lcd_preheat_m1_e2_only);
1128 1130
           #else
1129 1131
             MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2_only);
1130 1132
           #endif
1131 1133
           #if HOTENDS > 3
1132 1134
             #if TEMP_SENSOR_BED != 0
1133 1135
               MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3);
1134
-              MENU_ITEM(function, MSG_PREHEAT_1_N MSG_HOTEND " " MSG_E4, lcd_preheat_m1_e3_only);
1136
+              MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E4, lcd_preheat_m1_e3_only);
1135 1137
             #else
1136 1138
               MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3_only);
1137 1139
             #endif
@@ -1151,16 +1153,16 @@ void kill_screen(const char* lcd_msg) {
1151 1153
       #if HOTENDS == 1
1152 1154
         #if TEMP_SENSOR_BED != 0
1153 1155
           MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0);
1154
-          MENU_ITEM(function, MSG_PREHEAT_2 MSG_HOTEND, lcd_preheat_m2_e0_only);
1156
+          MENU_ITEM(function, MSG_PREHEAT_2_END, lcd_preheat_m2_e0_only);
1155 1157
         #else
1156 1158
           MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only);
1157 1159
         #endif
1158 1160
       #else
1159 1161
         #if TEMP_SENSOR_BED != 0
1160 1162
           MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0);
1161
-          MENU_ITEM(function, MSG_PREHEAT_2_N MSG_HOTEND " " MSG_E1, lcd_preheat_m2_e0_only);
1163
+          MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E1, lcd_preheat_m2_e0_only);
1162 1164
           MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1);
1163
-          MENU_ITEM(function, MSG_PREHEAT_2_N MSG_HOTEND " " MSG_E2, lcd_preheat_m2_e1_only);
1165
+          MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E2, lcd_preheat_m2_e1_only);
1164 1166
         #else
1165 1167
           MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0_only);
1166 1168
           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) {
1169 1171
           MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2_only);
1170 1172
           #if TEMP_SENSOR_BED != 0
1171 1173
             MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2);
1172
-            MENU_ITEM(function, MSG_PREHEAT_2_N MSG_HOTEND " " MSG_E3, lcd_preheat_m2_e2_only);
1174
+            MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E3, lcd_preheat_m2_e2_only);
1173 1175
           #else
1174 1176
             MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2_only);
1175 1177
           #endif
1176 1178
           #if HOTENDS > 3
1177 1179
             #if TEMP_SENSOR_BED != 0
1178 1180
               MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3);
1179
-              MENU_ITEM(function, MSG_PREHEAT_2_N MSG_HOTEND " " MSG_E4, lcd_preheat_m2_e3_only);
1181
+              MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E4, lcd_preheat_m2_e3_only);
1180 1182
             #else
1181 1183
               MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3_only);
1182 1184
             #endif
@@ -1427,11 +1429,13 @@ KeepDrawing:
1427 1429
       MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed);
1428 1430
     #endif
1429 1431
 
1430
-    //
1431
-    // Set Home Offsets
1432
-    //
1433
-    MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
1434
-    //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
1432
+    #if DISABLED(NO_WORKSPACE_OFFSETS)
1433
+      //
1434
+      // Set Home Offsets
1435
+      //
1436
+      MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
1437
+      //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
1438
+    #endif
1435 1439
 
1436 1440
     //
1437 1441
     // Disable Steppers

Loading…
Cancel
Save