Quellcode durchsuchen

Merge pull request #7070 from thinkyhead/bf_cleanups_fixes

Thursday cleanup / bugfixes
Scott Lahteine vor 7 Jahren
Ursprung
Commit
43c96eb31f

+ 15
- 19
Marlin/Marlin_main.cpp Datei anzeigen

@@ -752,7 +752,7 @@ void report_current_position_detail();
752 752
   #endif
753 753
 
754 754
   #define DEBUG_POS(SUFFIX,VAR) do { \
755
-    print_xyz(PSTR("  " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0)
755
+    print_xyz(PSTR("  " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); }while(0)
756 756
 #endif
757 757
 
758 758
 /**
@@ -3492,20 +3492,20 @@ inline void gcode_G4() {
3492 3492
       SERIAL_ECHOPAIR("Probe Offset X:", X_PROBE_OFFSET_FROM_EXTRUDER);
3493 3493
       SERIAL_ECHOPAIR(" Y:", Y_PROBE_OFFSET_FROM_EXTRUDER);
3494 3494
       SERIAL_ECHOPAIR(" Z:", zprobe_zoffset);
3495
-      #if (X_PROBE_OFFSET_FROM_EXTRUDER > 0)
3495
+      #if X_PROBE_OFFSET_FROM_EXTRUDER > 0
3496 3496
         SERIAL_ECHOPGM(" (Right");
3497
-      #elif (X_PROBE_OFFSET_FROM_EXTRUDER < 0)
3497
+      #elif X_PROBE_OFFSET_FROM_EXTRUDER < 0
3498 3498
         SERIAL_ECHOPGM(" (Left");
3499
-      #elif (Y_PROBE_OFFSET_FROM_EXTRUDER != 0)
3499
+      #elif Y_PROBE_OFFSET_FROM_EXTRUDER != 0
3500 3500
         SERIAL_ECHOPGM(" (Middle");
3501 3501
       #else
3502 3502
         SERIAL_ECHOPGM(" (Aligned With");
3503 3503
       #endif
3504
-      #if (Y_PROBE_OFFSET_FROM_EXTRUDER > 0)
3504
+      #if Y_PROBE_OFFSET_FROM_EXTRUDER > 0
3505 3505
         SERIAL_ECHOPGM("-Back");
3506
-      #elif (Y_PROBE_OFFSET_FROM_EXTRUDER < 0)
3506
+      #elif Y_PROBE_OFFSET_FROM_EXTRUDER < 0
3507 3507
         SERIAL_ECHOPGM("-Front");
3508
-      #elif (X_PROBE_OFFSET_FROM_EXTRUDER != 0)
3508
+      #elif X_PROBE_OFFSET_FROM_EXTRUDER != 0
3509 3509
         SERIAL_ECHOPGM("-Center");
3510 3510
       #endif
3511 3511
       if (zprobe_zoffset < 0)
@@ -11279,7 +11279,7 @@ void ok_to_send() {
11279 11279
     delta[A_AXIS] = DELTA_Z(A_AXIS); \
11280 11280
     delta[B_AXIS] = DELTA_Z(B_AXIS); \
11281 11281
     delta[C_AXIS] = DELTA_Z(C_AXIS); \
11282
-  } while(0)
11282
+  }while(0)
11283 11283
 
11284 11284
   #define DELTA_LOGICAL_IK() do {      \
11285 11285
     const float raw[XYZ] = {           \
@@ -11288,7 +11288,7 @@ void ok_to_send() {
11288 11288
       RAW_Z_POSITION(logical[Z_AXIS])  \
11289 11289
     };                                 \
11290 11290
     DELTA_RAW_IK();                    \
11291
-  } while(0)
11291
+  }while(0)
11292 11292
 
11293 11293
   #define DELTA_DEBUG() do { \
11294 11294
       SERIAL_ECHOPAIR("cartesian X:", raw[X_AXIS]); \
@@ -11297,7 +11297,7 @@ void ok_to_send() {
11297 11297
       SERIAL_ECHOPAIR("delta A:", delta[A_AXIS]);   \
11298 11298
       SERIAL_ECHOPAIR(" B:", delta[B_AXIS]);        \
11299 11299
       SERIAL_ECHOLNPAIR(" C:", delta[C_AXIS]);      \
11300
-    } while(0)
11300
+    }while(0)
11301 11301
 
11302 11302
   void inverse_kinematics(const float logical[XYZ]) {
11303 11303
     DELTA_LOGICAL_IK();
@@ -11847,7 +11847,7 @@ void prepare_move_to_destination() {
11847 11847
           SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
11848 11848
         }
11849 11849
         #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
11850
-          if (labs(destination[E_AXIS] - current_position[E_AXIS]) > EXTRUDE_MAXLENGTH) {
11850
+          if (destination[E_AXIS] - current_position[E_AXIS] > EXTRUDE_MAXLENGTH) {
11851 11851
             current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part
11852 11852
             SERIAL_ECHO_START();
11853 11853
             SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
@@ -11859,16 +11859,12 @@ void prepare_move_to_destination() {
11859 11859
   #endif
11860 11860
 
11861 11861
   if (
11862
-    #if IS_KINEMATIC
11863
-      #if UBL_DELTA
11864
-        ubl.prepare_segmented_line_to(destination, feedrate_mm_s)
11865
-      #else
11866
-        prepare_kinematic_move_to(destination)
11867
-      #endif
11862
+    #if UBL_DELTA // Also works for CARTESIAN (smaller segments follow mesh more closely)
11863
+      ubl.prepare_segmented_line_to(destination, feedrate_mm_s)
11864
+    #elif IS_KINEMATIC
11865
+      prepare_kinematic_move_to(destination)
11868 11866
     #elif ENABLED(DUAL_X_CARRIAGE)
11869 11867
       prepare_move_to_destination_dualx()
11870
-    #elif UBL_DELTA // will work for CARTESIAN too (smaller segments follow mesh more closely)
11871
-      ubl.prepare_segmented_line_to(destination, feedrate_mm_s)
11872 11868
     #else
11873 11869
       prepare_move_to_destination_cartesian()
11874 11870
     #endif

+ 0
- 4
Marlin/fastio.h Datei anzeigen

@@ -215,10 +215,6 @@ typedef enum {
215 215
 
216 216
 // Set Compare Mode bits
217 217
 #define _SET_COM(T,Q,V) (TCCR##T##Q = (TCCR##T##Q & ~(0x3 << COM##T##Q##0)) | (int(V) << COM##T##Q##0))
218
-#define _SET_COMA(T,V) _SET_COM(T,A,V)
219
-#define _SET_COMB(T,V) _SET_COM(T,B,V)
220
-#define _SET_COMC(T,V) _SET_COM(T,C,V)
221
-#define _SET_COMS(T,V1,V2,V3) do{ _SET_COMA(T,V1); _SET_COMB(T,V2); _SET_COMC(T,V3); }while(0)
222 218
 #define SET_COM(T,Q,V) _SET_COM(T,Q,COM_##V)
223 219
 #define SET_COMA(T,V) SET_COM(T,A,V)
224 220
 #define SET_COMB(T,V) SET_COM(T,B,V)

+ 36
- 37
Marlin/pinsDebug_plus_70.h Datei anzeigen

@@ -25,9 +25,9 @@
25 25
  *  structurs for 2560 family boards that use morre than 70 pins
26 26
  */
27 27
 
28
-#ifndef Plus_70_h
29
-  #define Plus_70_h
30
-  
28
+#ifndef __PINSDEBUG_PLUS_70_H__
29
+#define __PINSDEBUG_PLUS_70_H__
30
+
31 31
 #undef NUM_DIGITAL_PINS
32 32
 #if MOTHERBOARD == BOARD_BQ_ZUM_MEGA_3D
33 33
   #define NUM_DIGITAL_PINS            85
@@ -124,22 +124,22 @@ const uint8_t PROGMEM digital_pin_to_port_PGM_plus_70[] = {
124 124
   PK  , // PK 5 ** 67 ** A13
125 125
   PK  , // PK 6 ** 68 ** A14
126 126
   PK  , // PK 7 ** 69 ** A15
127
-  PG  , // PG 4 ** 70 ** 
128
-  PG  , // PG 3 ** 71 ** 
129
-  PJ  , // PJ 2 ** 72 ** 
130
-  PJ  , // PJ 3 ** 73 ** 
131
-  PJ  , // PJ 7 ** 74 ** 
132
-  PJ  , // PJ 4 ** 75 ** 
133
-  PJ  , // PJ 5 ** 76 ** 
134
-  PJ  , // PJ 6 ** 77 ** 
135
-  PE  , // PE 2 ** 78 ** 
136
-  PE  , // PE 6 ** 79 ** 
137
-  PE  , // PE 7 ** 80 ** 
138
-  PD  , // PD 4 ** 81 ** 
139
-  PD  , // PD 5 ** 82 ** 
140
-  PD  , // PD 6 ** 83 ** 
141
-  PH  , // PH 2 ** 84 ** 
142
-  PH  , // PH 7 ** 85 ** 
127
+  PG  , // PG 4 ** 70 **
128
+  PG  , // PG 3 ** 71 **
129
+  PJ  , // PJ 2 ** 72 **
130
+  PJ  , // PJ 3 ** 73 **
131
+  PJ  , // PJ 7 ** 74 **
132
+  PJ  , // PJ 4 ** 75 **
133
+  PJ  , // PJ 5 ** 76 **
134
+  PJ  , // PJ 6 ** 77 **
135
+  PE  , // PE 2 ** 78 **
136
+  PE  , // PE 6 ** 79 **
137
+  PE  , // PE 7 ** 80 **
138
+  PD  , // PD 4 ** 81 **
139
+  PD  , // PD 5 ** 82 **
140
+  PD  , // PD 6 ** 83 **
141
+  PH  , // PH 2 ** 84 **
142
+  PH  , // PH 7 ** 85 **
143 143
 };
144 144
 
145 145
 #define digitalPinToPort_plus_70(P) ( pgm_read_byte( digital_pin_to_port_PGM_plus_70 + (P) ) )
@@ -217,22 +217,22 @@ const uint8_t PROGMEM digital_pin_to_bit_mask_PGM_plus_70[] = {
217 217
   _BV( 5 )  , // PK 5 ** 67 ** A13
218 218
   _BV( 6 )  , // PK 6 ** 68 ** A14
219 219
   _BV( 7 )  , // PK 7 ** 69 ** A15
220
-  _BV( 4 )  , // PG 4 ** 70 ** 
221
-  _BV( 3 )  , // PG 3 ** 71 ** 
222
-  _BV( 2 )  , // PJ 2 ** 72 ** 
223
-  _BV( 3 )  , // PJ 3 ** 73 ** 
224
-  _BV( 7 )  , // PJ 7 ** 74 ** 
225
-  _BV( 4 )  , // PJ 4 ** 75 ** 
226
-  _BV( 5 )  , // PJ 5 ** 76 ** 
227
-  _BV( 6 )  , // PJ 6 ** 77 ** 
228
-  _BV( 2 )  , // PE 2 ** 78 ** 
229
-  _BV( 6 )  , // PE 6 ** 79 ** 
230
-  _BV( 7 )  , // PE 7 ** 80 ** 
231
-  _BV( 4 )  , // PD 4 ** 81 ** 
232
-  _BV( 5 )  , // PD 5 ** 82 ** 
233
-  _BV( 6 )  , // PD 6 ** 83 ** 
234
-  _BV( 2 )  , // PH 2 ** 84 ** 
235
-  _BV( 7 )  , // PH 7 ** 85 ** 
220
+  _BV( 4 )  , // PG 4 ** 70 **
221
+  _BV( 3 )  , // PG 3 ** 71 **
222
+  _BV( 2 )  , // PJ 2 ** 72 **
223
+  _BV( 3 )  , // PJ 3 ** 73 **
224
+  _BV( 7 )  , // PJ 7 ** 74 **
225
+  _BV( 4 )  , // PJ 4 ** 75 **
226
+  _BV( 5 )  , // PJ 5 ** 76 **
227
+  _BV( 6 )  , // PJ 6 ** 77 **
228
+  _BV( 2 )  , // PE 2 ** 78 **
229
+  _BV( 6 )  , // PE 6 ** 79 **
230
+  _BV( 7 )  , // PE 7 ** 80 **
231
+  _BV( 4 )  , // PD 4 ** 81 **
232
+  _BV( 5 )  , // PD 5 ** 82 **
233
+  _BV( 6 )  , // PD 6 ** 83 **
234
+  _BV( 2 )  , // PH 2 ** 84 **
235
+  _BV( 7 )  , // PH 7 ** 85 **
236 236
 };
237 237
 
238 238
 #define digitalPinToBitMask_plus_70(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM_plus_70 + (P) ) )
@@ -338,5 +338,4 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM_plus_70[] = {
338 338
  */
339 339
 
340 340
 
341
-#endif
342
-
341
+#endif // __PINSDEBUG_PLUS_70_H__

+ 1
- 1
Marlin/pins_SETHI.h Datei anzeigen

@@ -99,7 +99,7 @@
99 99
 #define HEATER_BED_PIN      3
100 100
 
101 101
 
102
-#if (GEN7_VERSION >= 13)
102
+#if GEN7_VERSION >= 13
103 103
   // Gen7 v1.3 removed the fan pin
104 104
   #define FAN_PIN          -1
105 105
 #else

+ 10
- 1
Marlin/stepper.cpp Datei anzeigen

@@ -370,7 +370,7 @@ void Stepper::isr() {
370 370
         ocr_val = (remainder < OCR_VAL_TOLERANCE) ? ENDSTOP_NOMINAL_OCR_VAL + remainder : ENDSTOP_NOMINAL_OCR_VAL; \
371 371
         step_remaining = (uint16_t)L - ocr_val; \
372 372
       } \
373
-    } while(0)
373
+    }while(0)
374 374
 
375 375
     if (step_remaining && ENDSTOPS_ENABLED) {   // Just check endstops - not yet time for a step
376 376
       endstops.update();
@@ -862,6 +862,9 @@ void Stepper::isr() {
862 862
         SET_E_STEP_DIR(2);
863 863
         #if E_STEPPERS > 3
864 864
           SET_E_STEP_DIR(3);
865
+          #if E_STEPPERS > 4
866
+            SET_E_STEP_DIR(4);
867
+          #endif
865 868
         #endif
866 869
       #endif
867 870
     #endif
@@ -880,6 +883,9 @@ void Stepper::isr() {
880 883
           START_E_PULSE(2);
881 884
           #if E_STEPPERS > 3
882 885
             START_E_PULSE(3);
886
+            #if E_STEPPERS > 4
887
+              START_E_PULSE(4);
888
+            #endif
883 889
           #endif
884 890
         #endif
885 891
       #endif
@@ -899,6 +905,9 @@ void Stepper::isr() {
899 905
           STOP_E_PULSE(2);
900 906
           #if E_STEPPERS > 3
901 907
             STOP_E_PULSE(3);
908
+            #if E_STEPPERS > 4
909
+              STOP_E_PULSE(4);
910
+            #endif
902 911
           #endif
903 912
         #endif
904 913
       #endif

+ 1
- 1
Marlin/stepper_indirection.cpp Datei anzeigen

@@ -296,7 +296,7 @@
296 296
     stepper##A.setMicroSteps(A##_MICROSTEPS); \
297 297
     stepper##A.setOverCurrent(A##_OVERCURRENT); \
298 298
     stepper##A.setStallCurrent(A##_STALLCURRENT); \
299
-  } while(0)
299
+  }while(0)
300 300
 
301 301
   void L6470_init() {
302 302
     #if ENABLED(X_IS_L6470)

+ 12
- 12
Marlin/temperature.cpp Datei anzeigen

@@ -421,13 +421,13 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
421 421
           bedKp = workKp; \
422 422
           bedKi = scalePID_i(workKi); \
423 423
           bedKd = scalePID_d(workKd); \
424
-          updatePID(); } while(0)
424
+          updatePID(); }while(0)
425 425
 
426 426
         #define _SET_EXTRUDER_PID() do { \
427 427
           PID_PARAM(Kp, hotend) = workKp; \
428 428
           PID_PARAM(Ki, hotend) = scalePID_i(workKi); \
429 429
           PID_PARAM(Kd, hotend) = scalePID_d(workKd); \
430
-          updatePID(); } while(0)
430
+          updatePID(); }while(0)
431 431
 
432 432
         // Use the result? (As with "M303 U1")
433 433
         if (set_result) {
@@ -505,7 +505,7 @@ int Temperature::getHeaterPower(int heater) {
505 505
 //
506 506
 // Temperature Error Handlers
507 507
 //
508
-void Temperature::_temp_error(int e, const char* serial_msg, const char* lcd_msg) {
508
+void Temperature::_temp_error(const int8_t e, const char * const serial_msg, const char * const lcd_msg) {
509 509
   static bool killed = false;
510 510
   if (IsRunning()) {
511 511
     SERIAL_ERROR_START();
@@ -524,7 +524,7 @@ void Temperature::_temp_error(int e, const char* serial_msg, const char* lcd_msg
524 524
   #endif
525 525
 }
526 526
 
527
-void Temperature::max_temp_error(int8_t e) {
527
+void Temperature::max_temp_error(const int8_t e) {
528 528
   #if HAS_TEMP_BED
529 529
     _temp_error(e, PSTR(MSG_T_MAXTEMP), e >= 0 ? PSTR(MSG_ERR_MAXTEMP) : PSTR(MSG_ERR_MAXTEMP_BED));
530 530
   #else
@@ -534,7 +534,7 @@ void Temperature::max_temp_error(int8_t e) {
534 534
     #endif
535 535
   #endif
536 536
 }
537
-void Temperature::min_temp_error(int8_t e) {
537
+void Temperature::min_temp_error(const int8_t e) {
538 538
   #if HAS_TEMP_BED
539 539
     _temp_error(e, PSTR(MSG_T_MINTEMP), e >= 0 ? PSTR(MSG_ERR_MINTEMP) : PSTR(MSG_ERR_MINTEMP_BED));
540 540
   #else
@@ -545,7 +545,7 @@ void Temperature::min_temp_error(int8_t e) {
545 545
   #endif
546 546
 }
547 547
 
548
-float Temperature::get_pid_output(int e) {
548
+float Temperature::get_pid_output(const int8_t e) {
549 549
   #if HOTENDS == 1
550 550
     UNUSED(e);
551 551
     #define _HOTEND_TEST     true
@@ -890,7 +890,7 @@ float Temperature::analog2temp(int raw, uint8_t e) {
890 890
 
891 891
 // Derived from RepRap FiveD extruder::getTemperature()
892 892
 // For bed temperature measurement.
893
-float Temperature::analog2tempBed(int raw) {
893
+float Temperature::analog2tempBed(const int raw) {
894 894
   #if ENABLED(BED_USES_THERMISTOR)
895 895
     float celsius = 0;
896 896
     byte i;
@@ -1148,7 +1148,7 @@ void Temperature::init() {
1148 1148
 
1149 1149
   #define TEMP_MIN_ROUTINE(NR) \
1150 1150
     minttemp[NR] = HEATER_ ##NR## _MINTEMP; \
1151
-    while(analog2temp(minttemp_raw[NR], NR) < HEATER_ ##NR## _MINTEMP) { \
1151
+    while (analog2temp(minttemp_raw[NR], NR) < HEATER_ ##NR## _MINTEMP) { \
1152 1152
       if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \
1153 1153
         minttemp_raw[NR] += OVERSAMPLENR; \
1154 1154
       else \
@@ -1156,7 +1156,7 @@ void Temperature::init() {
1156 1156
     }
1157 1157
   #define TEMP_MAX_ROUTINE(NR) \
1158 1158
     maxttemp[NR] = HEATER_ ##NR## _MAXTEMP; \
1159
-    while(analog2temp(maxttemp_raw[NR], NR) > HEATER_ ##NR## _MAXTEMP) { \
1159
+    while (analog2temp(maxttemp_raw[NR], NR) > HEATER_ ##NR## _MAXTEMP) { \
1160 1160
       if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \
1161 1161
         maxttemp_raw[NR] -= OVERSAMPLENR; \
1162 1162
       else \
@@ -1203,7 +1203,7 @@ void Temperature::init() {
1203 1203
   #endif // HOTENDS > 1
1204 1204
 
1205 1205
   #ifdef BED_MINTEMP
1206
-    while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) {
1206
+    while (analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) {
1207 1207
       #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP
1208 1208
         bed_minttemp_raw += OVERSAMPLENR;
1209 1209
       #else
@@ -1292,7 +1292,7 @@ void Temperature::init() {
1292 1292
         SERIAL_EOL();
1293 1293
     */
1294 1294
 
1295
-    int heater_index = heater_id >= 0 ? heater_id : HOTENDS;
1295
+    const int heater_index = heater_id >= 0 ? heater_id : HOTENDS;
1296 1296
 
1297 1297
     #if HEATER_IDLE_HANDLER
1298 1298
       // If the heater idle timeout expires, restart
@@ -1922,7 +1922,7 @@ void Temperature::isr() {
1922 1922
     case SensorsReady: {
1923 1923
       // All sensors have been read. Stay in this state for a few
1924 1924
       // ISRs to save on calls to temp update/checking code below.
1925
-      constexpr int extra_loops = MIN_ADC_ISR_LOOPS - (int)SensorsReady;
1925
+      constexpr int8_t extra_loops = MIN_ADC_ISR_LOOPS - (int8_t)SensorsReady;
1926 1926
       static uint8_t delay_count = 0;
1927 1927
       if (extra_loops > 0) {
1928 1928
         if (delay_count == 0) delay_count = extra_loops;   // Init this delay

+ 4
- 4
Marlin/temperature.h Datei anzeigen

@@ -535,15 +535,15 @@ class Temperature {
535 535
 
536 536
     static void checkExtruderAutoFans();
537 537
 
538
-    static float get_pid_output(int e);
538
+    static float get_pid_output(const int8_t e);
539 539
 
540 540
     #if ENABLED(PIDTEMPBED)
541 541
       static float get_pid_output_bed();
542 542
     #endif
543 543
 
544
-    static void _temp_error(int e, const char* serial_msg, const char* lcd_msg);
545
-    static void min_temp_error(int8_t e);
546
-    static void max_temp_error(int8_t e);
544
+    static void _temp_error(const int8_t e, const char * const serial_msg, const char * const lcd_msg);
545
+    static void min_temp_error(const int8_t e);
546
+    static void max_temp_error(const int8_t e);
547 547
 
548 548
     #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED
549 549
 

+ 6
- 6
Marlin/thermistortable_20.h Datei anzeigen

@@ -23,27 +23,27 @@
23 23
 // PT100 with INA826 amp on Ultimaker v2.0 electronics
24 24
 // The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature.
25 25
 // This does not match the normal thermistor behaviour so we need to set the following defines
26
-#if (THERMISTORHEATER_0 == 20)
26
+#if THERMISTORHEATER_0 == 20
27 27
   #define HEATER_0_RAW_HI_TEMP 16383
28 28
   #define HEATER_0_RAW_LO_TEMP 0
29 29
 #endif
30
-#if (THERMISTORHEATER_1 == 20)
30
+#if THERMISTORHEATER_1 == 20
31 31
   #define HEATER_1_RAW_HI_TEMP 16383
32 32
   #define HEATER_1_RAW_LO_TEMP 0
33 33
 #endif
34
-#if (THERMISTORHEATER_2 == 20)
34
+#if THERMISTORHEATER_2 == 20
35 35
   #define HEATER_2_RAW_HI_TEMP 16383
36 36
   #define HEATER_2_RAW_LO_TEMP 0
37 37
 #endif
38
-#if (THERMISTORHEATER_3 == 20)
38
+#if THERMISTORHEATER_3 == 20
39 39
   #define HEATER_3_RAW_HI_TEMP 16383
40 40
   #define HEATER_3_RAW_LO_TEMP 0
41 41
 #endif
42
-#if (THERMISTORHEATER_4 == 20)
42
+#if THERMISTORHEATER_4 == 20
43 43
   #define HEATER_4_RAW_HI_TEMP 16383
44 44
   #define HEATER_4_RAW_LO_TEMP 0
45 45
 #endif
46
-#if (THERMISTORBED == 20)
46
+#if THERMISTORBED == 20
47 47
   #define HEATER_BED_RAW_HI_TEMP 16383
48 48
   #define HEATER_BED_RAW_LO_TEMP 0
49 49
 #endif

+ 2
- 2
Marlin/ubl_G29.cpp Datei anzeigen

@@ -45,7 +45,7 @@
45 45
     void lcd_mesh_edit_setup(float initial);
46 46
     float lcd_mesh_edit();
47 47
     void lcd_z_offset_edit_setup(float);
48
-    #ifdef DOGLCD
48
+    #if ENABLED(DOGLCD)
49 49
       extern void _lcd_ubl_output_map_lcd();
50 50
     #endif
51 51
     float lcd_z_offset_edit();
@@ -1575,7 +1575,7 @@
1575 1575
       SERIAL_ECHOLNPGM("Done Editing Mesh");
1576 1576
 
1577 1577
       if (ubl_lcd_map_control) {
1578
-        #ifdef DOGLCD
1578
+        #if ENABLED(DOGLCD)
1579 1579
         lcd_goto_screen(_lcd_ubl_output_map_lcd);
1580 1580
         #endif
1581 1581
       }

+ 34
- 32
Marlin/ultralcd.cpp Datei anzeigen

@@ -257,7 +257,7 @@ uint16_t max_display_update_time = 0;
257 257
       _skipStatic = false; \
258 258
       _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \
259 259
       _MENU_ITEM_PART_2(TYPE, LABEL, ## __VA_ARGS__); \
260
-    } while(0)
260
+    }while(0)
261 261
 
262 262
   #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0)
263 263
 
@@ -289,13 +289,13 @@ uint16_t max_display_update_time = 0;
289 289
         encoderRateMultiplierEnabled = true; \
290 290
         lastEncoderMovementMillis = 0; \
291 291
         _MENU_ITEM_PART_2(type, label, ## __VA_ARGS__); \
292
-      } while(0)
292
+      }while(0)
293 293
 
294 294
   #else // !ENCODER_RATE_MULTIPLIER
295 295
     #define ENCODER_RATE_MULTIPLY(F) NOOP
296 296
   #endif // !ENCODER_RATE_MULTIPLIER
297 297
 
298
-  #define MENU_ITEM_DUMMY() do { _thisItemNr++; } while(0)
298
+  #define MENU_ITEM_DUMMY() do { _thisItemNr++; }while(0)
299 299
   #define MENU_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__)
300 300
   #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)
301 301
   #if ENABLED(ENCODER_RATE_MULTIPLIER)
@@ -1098,9 +1098,11 @@ void kill_screen(const char* lcd_msg) {
1098 1098
     #endif // HOTENDS > 1
1099 1099
   #endif // HAS_TEMP_HOTEND
1100 1100
 
1101
-  #if WATCH_THE_BED
1102
-    void watch_temp_callback_bed() { thermalManager.start_watching_bed(); }
1103
-  #endif
1101
+  void watch_temp_callback_bed() {
1102
+    #if WATCH_THE_BED
1103
+      thermalManager.start_watching_bed();
1104
+    #endif
1105
+  }
1104 1106
 
1105 1107
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
1106 1108
 
@@ -1162,7 +1164,7 @@ void kill_screen(const char* lcd_msg) {
1162 1164
     //
1163 1165
     // Bed:
1164 1166
     //
1165
-    #if WATCH_THE_BED
1167
+    #if HAS_TEMP_BED
1166 1168
       MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed);
1167 1169
     #endif
1168 1170
 
@@ -1810,7 +1812,7 @@ void kill_screen(const char* lcd_msg) {
1810 1812
     void _lcd_ubl_build_custom_mesh() {
1811 1813
       char UBL_LCD_GCODE[20];
1812 1814
       enqueue_and_echo_commands_P(PSTR("G28"));
1813
-      #if WATCH_THE_BED
1815
+      #if HAS_TEMP_BED
1814 1816
         sprintf_P(UBL_LCD_GCODE, PSTR("M190 S%i"), custom_bed_temp);
1815 1817
         enqueue_and_echo_command(UBL_LCD_GCODE);
1816 1818
       #endif
@@ -1826,7 +1828,7 @@ void kill_screen(const char* lcd_msg) {
1826 1828
       START_MENU();
1827 1829
       MENU_BACK(MSG_UBL_BUILD_MESH_MENU);
1828 1830
       MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_HOTEND_TEMP, &custom_hotend_temp, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP - 10));
1829
-      #if WATCH_THE_BED
1831
+      #if HAS_TEMP_BED
1830 1832
         MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_BED_TEMP, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 5));
1831 1833
       #endif
1832 1834
       MENU_ITEM(function, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh);
@@ -1875,7 +1877,7 @@ void kill_screen(const char* lcd_msg) {
1875 1877
     void _lcd_ubl_validate_custom_mesh() {
1876 1878
       char UBL_LCD_GCODE[24];
1877 1879
       const int temp =
1878
-        #if WATCH_THE_BED
1880
+        #if HAS_TEMP_BED
1879 1881
           custom_bed_temp
1880 1882
         #else
1881 1883
           0
@@ -1891,7 +1893,7 @@ void kill_screen(const char* lcd_msg) {
1891 1893
     void _lcd_ubl_validate_mesh() {
1892 1894
       START_MENU();
1893 1895
       MENU_BACK(MSG_UBL_TOOLS);
1894
-      #if WATCH_THE_BED
1896
+      #if HAS_TEMP_BED
1895 1897
         MENU_ITEM(gcode, MSG_UBL_VALIDATE_PLA_MESH, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_1_TEMP_BED) " H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P"));
1896 1898
         MENU_ITEM(gcode, MSG_UBL_VALIDATE_ABS_MESH, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_2_TEMP_BED) " H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P"));
1897 1899
       #else
@@ -1978,7 +1980,7 @@ void kill_screen(const char* lcd_msg) {
1978 1980
     void _lcd_ubl_build_mesh() {
1979 1981
       START_MENU();
1980 1982
       MENU_BACK(MSG_UBL_TOOLS);
1981
-      #if WATCH_THE_BED
1983
+      #if HAS_TEMP_BED
1982 1984
         MENU_ITEM(gcode, MSG_UBL_BUILD_PLA_MESH, PSTR(
1983 1985
           "G28\n"
1984 1986
           "M190 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\n"
@@ -2075,19 +2077,19 @@ void kill_screen(const char* lcd_msg) {
2075 2077
       enqueue_and_echo_command(ubl_lcd_gcode);
2076 2078
     }
2077 2079
 
2078
-  #ifdef DOGLCD
2080
+  #if ENABLED(DOGLCD)
2079 2081
 
2080 2082
     /**
2081 2083
      * UBL LCD "radar" map data
2082 2084
      */
2083
-  #define MAP_UPPER_LEFT_CORNER_X 35  // These probably should be moved to the .h file  But for now,
2084
-  #define MAP_UPPER_LEFT_CORNER_Y 8  // it is easier to play with things having them here
2085
-  #define MAP_MAX_PIXELS_X        53
2086
-  #define MAP_MAX_PIXELS_Y        49
2085
+    #define MAP_UPPER_LEFT_CORNER_X 35  // These probably should be moved to the .h file  But for now,
2086
+    #define MAP_UPPER_LEFT_CORNER_Y 8   // it is easier to play with things having them here
2087
+    #define MAP_MAX_PIXELS_X        53
2088
+    #define MAP_MAX_PIXELS_Y        49
2087 2089
 
2088 2090
     void _lcd_ubl_plot_drawing_prep() {
2089
-      uint8_t i, j, x_offset, y_offset, x_map_pixels, y_map_pixels;
2090
-      uint8_t pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt, inverted_y;
2091
+      uint8_t i, j, x_offset, y_offset, x_map_pixels, y_map_pixels,
2092
+              pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt, inverted_y;
2091 2093
 
2092 2094
       /*********************************************************/
2093 2095
       /************ Scale the box pixels appropriately *********/
@@ -2098,15 +2100,15 @@ void kill_screen(const char* lcd_msg) {
2098 2100
       pixels_per_X_mesh_pnt = x_map_pixels / GRID_MAX_POINTS_X;
2099 2101
       pixels_per_Y_mesh_pnt = y_map_pixels / GRID_MAX_POINTS_Y;
2100 2102
 
2101
-      x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X-x_map_pixels-2)/2;
2102
-      y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y-y_map_pixels-2)/2;
2103
+      x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X - x_map_pixels - 2) / 2;
2104
+      y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y - y_map_pixels - 2) / 2;
2103 2105
 
2104 2106
       /*********************************************************/
2105 2107
       /************ Clear the Mesh Map Box**********************/
2106 2108
       /*********************************************************/
2107 2109
 
2108 2110
       u8g.setColorIndex(1);  // First draw the bigger box in White so we have a border around the mesh map box
2109
-      u8g.drawBox(x_offset-2, y_offset-2, x_map_pixels+4, y_map_pixels+4);
2111
+      u8g.drawBox(x_offset - 2, y_offset - 2, x_map_pixels + 4, y_map_pixels + 4);
2110 2112
 
2111 2113
       u8g.setColorIndex(0);  // Now actually clear the mesh map box
2112 2114
       u8g.drawBox(x_offset, y_offset, x_map_pixels, y_map_pixels);
@@ -2118,8 +2120,8 @@ void kill_screen(const char* lcd_msg) {
2118 2120
       u8g.setColorIndex(1);
2119 2121
       for (i = 0; i < GRID_MAX_POINTS_X; i++) {
2120 2122
         for (j = 0; j < GRID_MAX_POINTS_Y; j++) {
2121
-          u8g.drawBox(x_offset+i*pixels_per_X_mesh_pnt+pixels_per_X_mesh_pnt/2,  
2122
-                      y_offset+j*pixels_per_Y_mesh_pnt+pixels_per_Y_mesh_pnt/2, 1, 1);
2123
+          u8g.drawBox(x_offset + i * pixels_per_X_mesh_pnt + pixels_per_X_mesh_pnt / 2,
2124
+                      y_offset + j * pixels_per_Y_mesh_pnt + pixels_per_Y_mesh_pnt / 2, 1, 1);
2123 2125
         }
2124 2126
       }
2125 2127
 
@@ -2127,9 +2129,9 @@ void kill_screen(const char* lcd_msg) {
2127 2129
       /************ Fill in the Specified Mesh Point ***********/
2128 2130
       /*********************************************************/
2129 2131
 
2130
-      inverted_y = GRID_MAX_POINTS_Y - y_plot - 1;    // The origin is typically in the lower right corner.  We need to 
2132
+      inverted_y = GRID_MAX_POINTS_Y - y_plot - 1;    // The origin is typically in the lower right corner.  We need to
2131 2133
                                                       // invert the Y to get it to plot in the right location.
2132
-      u8g.drawBox(x_offset+x_plot*pixels_per_X_mesh_pnt, y_offset+inverted_y*pixels_per_Y_mesh_pnt, 
2134
+      u8g.drawBox(x_offset + x_plot * pixels_per_X_mesh_pnt, y_offset + inverted_y * pixels_per_Y_mesh_pnt,
2133 2135
                     pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt);
2134 2136
 
2135 2137
       /*********************************************************/
@@ -2147,11 +2149,11 @@ void kill_screen(const char* lcd_msg) {
2147 2149
 
2148 2150
       // Print plot position
2149 2151
       u8g.setPrintPos(5, 64);
2150
-      lcd_print("(");
2152
+      lcd_print('(');
2151 2153
       u8g.print(x_plot);
2152
-      lcd_print(",");
2154
+      lcd_print(',');
2153 2155
       u8g.print(y_plot);
2154
-      lcd_print(")");
2156
+      lcd_print(')');
2155 2157
 
2156 2158
       // Show the location value
2157 2159
       u8g.setPrintPos(74, 64);
@@ -2262,7 +2264,7 @@ void kill_screen(const char* lcd_msg) {
2262 2264
     void _lcd_ubl_output_map_lcd_cmd() {
2263 2265
       if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]))
2264 2266
         enqueue_and_echo_commands_P(PSTR("G28"));
2265
-      lcd_goto_screen(_lcd_ubl_map_homing);     
2267
+      lcd_goto_screen(_lcd_ubl_map_homing);
2266 2268
     }
2267 2269
 
2268 2270
     /**
@@ -2968,7 +2970,7 @@ void kill_screen(const char* lcd_msg) {
2968 2970
     //
2969 2971
     // Bed:
2970 2972
     //
2971
-    #if WATCH_THE_BED
2973
+    #if HAS_TEMP_BED
2972 2974
       MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed);
2973 2975
     #endif
2974 2976
 
@@ -3624,7 +3626,7 @@ void kill_screen(const char* lcd_msg) {
3624 3626
         lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \
3625 3627
       } \
3626 3628
       ++_thisItemNr; \
3627
-    } while(0)
3629
+    }while(0)
3628 3630
 
3629 3631
     void lcd_advanced_pause_toocold_menu() {
3630 3632
       START_MENU();

+ 2
- 2
Marlin/ultralcd_impl_DOGM.h Datei anzeigen

@@ -424,10 +424,10 @@ inline void lcd_implementation_status_message() {
424 424
           lcd_print_utf(stat);                                  // The string leaves space
425 425
           chars -= slen - status_scroll_pos;                    // Amount of space left
426 426
         }
427
-        lcd.print('.');                                         // Always at 1+ spaces left, draw a dot
427
+        u8g.print('.');                                         // Always at 1+ spaces left, draw a dot
428 428
         if (--chars) {
429 429
           if (status_scroll_pos < slen + 1)                     // Draw a second dot if there's space
430
-            --chars, lcd.print('.');
430
+            --chars, u8g.print('.');
431 431
           if (chars) lcd_print_utf(lcd_status_message, chars);  // Print a second copy of the message
432 432
         }
433 433
       }

+ 1
- 1
Marlin/ultralcd_impl_HD44780.h Datei anzeigen

@@ -1012,7 +1012,7 @@ static void lcd_implementation_status_screen() {
1012 1012
 
1013 1013
   #endif // SDSUPPORT
1014 1014
 
1015
-  #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_UPLEVEL_CHAR,LCD_UPLEVEL_CHAR)
1015
+  #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_UPLEVEL_CHAR, LCD_UPLEVEL_CHAR)
1016 1016
   #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
1017 1017
   #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
1018 1018
   #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')

Laden…
Abbrechen
Speichern