diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5a874bedc..69296edda 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -752,7 +752,7 @@ void report_current_position_detail(); #endif #define DEBUG_POS(SUFFIX,VAR) do { \ - print_xyz(PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0) + print_xyz(PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); }while(0) #endif /** @@ -3492,20 +3492,20 @@ inline void gcode_G4() { SERIAL_ECHOPAIR("Probe Offset X:", X_PROBE_OFFSET_FROM_EXTRUDER); SERIAL_ECHOPAIR(" Y:", Y_PROBE_OFFSET_FROM_EXTRUDER); SERIAL_ECHOPAIR(" Z:", zprobe_zoffset); - #if (X_PROBE_OFFSET_FROM_EXTRUDER > 0) + #if X_PROBE_OFFSET_FROM_EXTRUDER > 0 SERIAL_ECHOPGM(" (Right"); - #elif (X_PROBE_OFFSET_FROM_EXTRUDER < 0) + #elif X_PROBE_OFFSET_FROM_EXTRUDER < 0 SERIAL_ECHOPGM(" (Left"); - #elif (Y_PROBE_OFFSET_FROM_EXTRUDER != 0) + #elif Y_PROBE_OFFSET_FROM_EXTRUDER != 0 SERIAL_ECHOPGM(" (Middle"); #else SERIAL_ECHOPGM(" (Aligned With"); #endif - #if (Y_PROBE_OFFSET_FROM_EXTRUDER > 0) + #if Y_PROBE_OFFSET_FROM_EXTRUDER > 0 SERIAL_ECHOPGM("-Back"); - #elif (Y_PROBE_OFFSET_FROM_EXTRUDER < 0) + #elif Y_PROBE_OFFSET_FROM_EXTRUDER < 0 SERIAL_ECHOPGM("-Front"); - #elif (X_PROBE_OFFSET_FROM_EXTRUDER != 0) + #elif X_PROBE_OFFSET_FROM_EXTRUDER != 0 SERIAL_ECHOPGM("-Center"); #endif if (zprobe_zoffset < 0) @@ -11279,7 +11279,7 @@ void ok_to_send() { delta[A_AXIS] = DELTA_Z(A_AXIS); \ delta[B_AXIS] = DELTA_Z(B_AXIS); \ delta[C_AXIS] = DELTA_Z(C_AXIS); \ - } while(0) + }while(0) #define DELTA_LOGICAL_IK() do { \ const float raw[XYZ] = { \ @@ -11288,7 +11288,7 @@ void ok_to_send() { RAW_Z_POSITION(logical[Z_AXIS]) \ }; \ DELTA_RAW_IK(); \ - } while(0) + }while(0) #define DELTA_DEBUG() do { \ SERIAL_ECHOPAIR("cartesian X:", raw[X_AXIS]); \ @@ -11297,7 +11297,7 @@ void ok_to_send() { SERIAL_ECHOPAIR("delta A:", delta[A_AXIS]); \ SERIAL_ECHOPAIR(" B:", delta[B_AXIS]); \ SERIAL_ECHOLNPAIR(" C:", delta[C_AXIS]); \ - } while(0) + }while(0) void inverse_kinematics(const float logical[XYZ]) { DELTA_LOGICAL_IK(); @@ -11847,7 +11847,7 @@ void prepare_move_to_destination() { SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); } #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - if (labs(destination[E_AXIS] - current_position[E_AXIS]) > EXTRUDE_MAXLENGTH) { + if (destination[E_AXIS] - current_position[E_AXIS] > EXTRUDE_MAXLENGTH) { current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); @@ -11859,16 +11859,12 @@ void prepare_move_to_destination() { #endif if ( - #if IS_KINEMATIC - #if UBL_DELTA - ubl.prepare_segmented_line_to(destination, feedrate_mm_s) - #else - prepare_kinematic_move_to(destination) - #endif + #if UBL_DELTA // Also works for CARTESIAN (smaller segments follow mesh more closely) + ubl.prepare_segmented_line_to(destination, feedrate_mm_s) + #elif IS_KINEMATIC + prepare_kinematic_move_to(destination) #elif ENABLED(DUAL_X_CARRIAGE) prepare_move_to_destination_dualx() - #elif UBL_DELTA // will work for CARTESIAN too (smaller segments follow mesh more closely) - ubl.prepare_segmented_line_to(destination, feedrate_mm_s) #else prepare_move_to_destination_cartesian() #endif diff --git a/Marlin/fastio.h b/Marlin/fastio.h index 035c9c3a2..d5ae8f2cc 100644 --- a/Marlin/fastio.h +++ b/Marlin/fastio.h @@ -215,10 +215,6 @@ typedef enum { // Set Compare Mode bits #define _SET_COM(T,Q,V) (TCCR##T##Q = (TCCR##T##Q & ~(0x3 << COM##T##Q##0)) | (int(V) << COM##T##Q##0)) -#define _SET_COMA(T,V) _SET_COM(T,A,V) -#define _SET_COMB(T,V) _SET_COM(T,B,V) -#define _SET_COMC(T,V) _SET_COM(T,C,V) -#define _SET_COMS(T,V1,V2,V3) do{ _SET_COMA(T,V1); _SET_COMB(T,V2); _SET_COMC(T,V3); }while(0) #define SET_COM(T,Q,V) _SET_COM(T,Q,COM_##V) #define SET_COMA(T,V) SET_COM(T,A,V) #define SET_COMB(T,V) SET_COM(T,B,V) diff --git a/Marlin/pinsDebug_plus_70.h b/Marlin/pinsDebug_plus_70.h index e02721f81..1a905bd46 100644 --- a/Marlin/pinsDebug_plus_70.h +++ b/Marlin/pinsDebug_plus_70.h @@ -25,9 +25,9 @@ * structurs for 2560 family boards that use morre than 70 pins */ -#ifndef Plus_70_h - #define Plus_70_h - +#ifndef __PINSDEBUG_PLUS_70_H__ +#define __PINSDEBUG_PLUS_70_H__ + #undef NUM_DIGITAL_PINS #if MOTHERBOARD == BOARD_BQ_ZUM_MEGA_3D #define NUM_DIGITAL_PINS 85 @@ -124,22 +124,22 @@ const uint8_t PROGMEM digital_pin_to_port_PGM_plus_70[] = { PK , // PK 5 ** 67 ** A13 PK , // PK 6 ** 68 ** A14 PK , // PK 7 ** 69 ** A15 - PG , // PG 4 ** 70 ** - PG , // PG 3 ** 71 ** - PJ , // PJ 2 ** 72 ** - PJ , // PJ 3 ** 73 ** - PJ , // PJ 7 ** 74 ** - PJ , // PJ 4 ** 75 ** - PJ , // PJ 5 ** 76 ** - PJ , // PJ 6 ** 77 ** - PE , // PE 2 ** 78 ** - PE , // PE 6 ** 79 ** - PE , // PE 7 ** 80 ** - PD , // PD 4 ** 81 ** - PD , // PD 5 ** 82 ** - PD , // PD 6 ** 83 ** - PH , // PH 2 ** 84 ** - PH , // PH 7 ** 85 ** + PG , // PG 4 ** 70 ** + PG , // PG 3 ** 71 ** + PJ , // PJ 2 ** 72 ** + PJ , // PJ 3 ** 73 ** + PJ , // PJ 7 ** 74 ** + PJ , // PJ 4 ** 75 ** + PJ , // PJ 5 ** 76 ** + PJ , // PJ 6 ** 77 ** + PE , // PE 2 ** 78 ** + PE , // PE 6 ** 79 ** + PE , // PE 7 ** 80 ** + PD , // PD 4 ** 81 ** + PD , // PD 5 ** 82 ** + PD , // PD 6 ** 83 ** + PH , // PH 2 ** 84 ** + PH , // PH 7 ** 85 ** }; #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[] = { _BV( 5 ) , // PK 5 ** 67 ** A13 _BV( 6 ) , // PK 6 ** 68 ** A14 _BV( 7 ) , // PK 7 ** 69 ** A15 - _BV( 4 ) , // PG 4 ** 70 ** - _BV( 3 ) , // PG 3 ** 71 ** - _BV( 2 ) , // PJ 2 ** 72 ** - _BV( 3 ) , // PJ 3 ** 73 ** - _BV( 7 ) , // PJ 7 ** 74 ** - _BV( 4 ) , // PJ 4 ** 75 ** - _BV( 5 ) , // PJ 5 ** 76 ** - _BV( 6 ) , // PJ 6 ** 77 ** - _BV( 2 ) , // PE 2 ** 78 ** - _BV( 6 ) , // PE 6 ** 79 ** - _BV( 7 ) , // PE 7 ** 80 ** - _BV( 4 ) , // PD 4 ** 81 ** - _BV( 5 ) , // PD 5 ** 82 ** - _BV( 6 ) , // PD 6 ** 83 ** - _BV( 2 ) , // PH 2 ** 84 ** - _BV( 7 ) , // PH 7 ** 85 ** + _BV( 4 ) , // PG 4 ** 70 ** + _BV( 3 ) , // PG 3 ** 71 ** + _BV( 2 ) , // PJ 2 ** 72 ** + _BV( 3 ) , // PJ 3 ** 73 ** + _BV( 7 ) , // PJ 7 ** 74 ** + _BV( 4 ) , // PJ 4 ** 75 ** + _BV( 5 ) , // PJ 5 ** 76 ** + _BV( 6 ) , // PJ 6 ** 77 ** + _BV( 2 ) , // PE 2 ** 78 ** + _BV( 6 ) , // PE 6 ** 79 ** + _BV( 7 ) , // PE 7 ** 80 ** + _BV( 4 ) , // PD 4 ** 81 ** + _BV( 5 ) , // PD 5 ** 82 ** + _BV( 6 ) , // PD 6 ** 83 ** + _BV( 2 ) , // PH 2 ** 84 ** + _BV( 7 ) , // PH 7 ** 85 ** }; #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[] = { */ -#endif - +#endif // __PINSDEBUG_PLUS_70_H__ diff --git a/Marlin/pins_SETHI.h b/Marlin/pins_SETHI.h index a05bb9eb2..ac570fd27 100644 --- a/Marlin/pins_SETHI.h +++ b/Marlin/pins_SETHI.h @@ -99,7 +99,7 @@ #define HEATER_BED_PIN 3 -#if (GEN7_VERSION >= 13) +#if GEN7_VERSION >= 13 // Gen7 v1.3 removed the fan pin #define FAN_PIN -1 #else diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 4b9167b66..f3c2ff1d6 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -370,7 +370,7 @@ void Stepper::isr() { ocr_val = (remainder < OCR_VAL_TOLERANCE) ? ENDSTOP_NOMINAL_OCR_VAL + remainder : ENDSTOP_NOMINAL_OCR_VAL; \ step_remaining = (uint16_t)L - ocr_val; \ } \ - } while(0) + }while(0) if (step_remaining && ENDSTOPS_ENABLED) { // Just check endstops - not yet time for a step endstops.update(); @@ -862,6 +862,9 @@ void Stepper::isr() { SET_E_STEP_DIR(2); #if E_STEPPERS > 3 SET_E_STEP_DIR(3); + #if E_STEPPERS > 4 + SET_E_STEP_DIR(4); + #endif #endif #endif #endif @@ -880,6 +883,9 @@ void Stepper::isr() { START_E_PULSE(2); #if E_STEPPERS > 3 START_E_PULSE(3); + #if E_STEPPERS > 4 + START_E_PULSE(4); + #endif #endif #endif #endif @@ -899,6 +905,9 @@ void Stepper::isr() { STOP_E_PULSE(2); #if E_STEPPERS > 3 STOP_E_PULSE(3); + #if E_STEPPERS > 4 + STOP_E_PULSE(4); + #endif #endif #endif #endif diff --git a/Marlin/stepper_indirection.cpp b/Marlin/stepper_indirection.cpp index 0fe3a801c..c2f302704 100644 --- a/Marlin/stepper_indirection.cpp +++ b/Marlin/stepper_indirection.cpp @@ -296,7 +296,7 @@ stepper##A.setMicroSteps(A##_MICROSTEPS); \ stepper##A.setOverCurrent(A##_OVERCURRENT); \ stepper##A.setStallCurrent(A##_STALLCURRENT); \ - } while(0) + }while(0) void L6470_init() { #if ENABLED(X_IS_L6470) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 56be635da..5eb8f05b4 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -421,13 +421,13 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS], bedKp = workKp; \ bedKi = scalePID_i(workKi); \ bedKd = scalePID_d(workKd); \ - updatePID(); } while(0) + updatePID(); }while(0) #define _SET_EXTRUDER_PID() do { \ PID_PARAM(Kp, hotend) = workKp; \ PID_PARAM(Ki, hotend) = scalePID_i(workKi); \ PID_PARAM(Kd, hotend) = scalePID_d(workKd); \ - updatePID(); } while(0) + updatePID(); }while(0) // Use the result? (As with "M303 U1") if (set_result) { @@ -505,7 +505,7 @@ int Temperature::getHeaterPower(int heater) { // // Temperature Error Handlers // -void Temperature::_temp_error(int e, const char* serial_msg, const char* lcd_msg) { +void Temperature::_temp_error(const int8_t e, const char * const serial_msg, const char * const lcd_msg) { static bool killed = false; if (IsRunning()) { SERIAL_ERROR_START(); @@ -524,7 +524,7 @@ void Temperature::_temp_error(int e, const char* serial_msg, const char* lcd_msg #endif } -void Temperature::max_temp_error(int8_t e) { +void Temperature::max_temp_error(const int8_t e) { #if HAS_TEMP_BED _temp_error(e, PSTR(MSG_T_MAXTEMP), e >= 0 ? PSTR(MSG_ERR_MAXTEMP) : PSTR(MSG_ERR_MAXTEMP_BED)); #else @@ -534,7 +534,7 @@ void Temperature::max_temp_error(int8_t e) { #endif #endif } -void Temperature::min_temp_error(int8_t e) { +void Temperature::min_temp_error(const int8_t e) { #if HAS_TEMP_BED _temp_error(e, PSTR(MSG_T_MINTEMP), e >= 0 ? PSTR(MSG_ERR_MINTEMP) : PSTR(MSG_ERR_MINTEMP_BED)); #else @@ -545,7 +545,7 @@ void Temperature::min_temp_error(int8_t e) { #endif } -float Temperature::get_pid_output(int e) { +float Temperature::get_pid_output(const int8_t e) { #if HOTENDS == 1 UNUSED(e); #define _HOTEND_TEST true @@ -890,7 +890,7 @@ float Temperature::analog2temp(int raw, uint8_t e) { // Derived from RepRap FiveD extruder::getTemperature() // For bed temperature measurement. -float Temperature::analog2tempBed(int raw) { +float Temperature::analog2tempBed(const int raw) { #if ENABLED(BED_USES_THERMISTOR) float celsius = 0; byte i; @@ -1148,7 +1148,7 @@ void Temperature::init() { #define TEMP_MIN_ROUTINE(NR) \ minttemp[NR] = HEATER_ ##NR## _MINTEMP; \ - while(analog2temp(minttemp_raw[NR], 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 \ @@ -1156,7 +1156,7 @@ void Temperature::init() { } #define TEMP_MAX_ROUTINE(NR) \ maxttemp[NR] = HEATER_ ##NR## _MAXTEMP; \ - while(analog2temp(maxttemp_raw[NR], 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 \ @@ -1203,7 +1203,7 @@ void Temperature::init() { #endif // HOTENDS > 1 #ifdef BED_MINTEMP - while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { + while (analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else @@ -1292,7 +1292,7 @@ void Temperature::init() { SERIAL_EOL(); */ - int heater_index = heater_id >= 0 ? heater_id : HOTENDS; + const int heater_index = heater_id >= 0 ? heater_id : HOTENDS; #if HEATER_IDLE_HANDLER // If the heater idle timeout expires, restart @@ -1922,7 +1922,7 @@ void Temperature::isr() { case SensorsReady: { // All sensors have been read. Stay in this state for a few // ISRs to save on calls to temp update/checking code below. - constexpr int extra_loops = MIN_ADC_ISR_LOOPS - (int)SensorsReady; + constexpr int8_t extra_loops = MIN_ADC_ISR_LOOPS - (int8_t)SensorsReady; static uint8_t delay_count = 0; if (extra_loops > 0) { if (delay_count == 0) delay_count = extra_loops; // Init this delay diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 2eff17619..943768578 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -535,15 +535,15 @@ class Temperature { static void checkExtruderAutoFans(); - static float get_pid_output(int e); + static float get_pid_output(const int8_t e); #if ENABLED(PIDTEMPBED) static float get_pid_output_bed(); #endif - static void _temp_error(int e, const char* serial_msg, const char* lcd_msg); - static void min_temp_error(int8_t e); - static void max_temp_error(int8_t e); + static void _temp_error(const int8_t e, const char * const serial_msg, const char * const lcd_msg); + static void min_temp_error(const int8_t e); + static void max_temp_error(const int8_t e); #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED diff --git a/Marlin/thermistortable_20.h b/Marlin/thermistortable_20.h index 9ec51d238..1c2741959 100644 --- a/Marlin/thermistortable_20.h +++ b/Marlin/thermistortable_20.h @@ -23,27 +23,27 @@ // PT100 with INA826 amp on Ultimaker v2.0 electronics // The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature. // This does not match the normal thermistor behaviour so we need to set the following defines -#if (THERMISTORHEATER_0 == 20) +#if THERMISTORHEATER_0 == 20 #define HEATER_0_RAW_HI_TEMP 16383 #define HEATER_0_RAW_LO_TEMP 0 #endif -#if (THERMISTORHEATER_1 == 20) +#if THERMISTORHEATER_1 == 20 #define HEATER_1_RAW_HI_TEMP 16383 #define HEATER_1_RAW_LO_TEMP 0 #endif -#if (THERMISTORHEATER_2 == 20) +#if THERMISTORHEATER_2 == 20 #define HEATER_2_RAW_HI_TEMP 16383 #define HEATER_2_RAW_LO_TEMP 0 #endif -#if (THERMISTORHEATER_3 == 20) +#if THERMISTORHEATER_3 == 20 #define HEATER_3_RAW_HI_TEMP 16383 #define HEATER_3_RAW_LO_TEMP 0 #endif -#if (THERMISTORHEATER_4 == 20) +#if THERMISTORHEATER_4 == 20 #define HEATER_4_RAW_HI_TEMP 16383 #define HEATER_4_RAW_LO_TEMP 0 #endif -#if (THERMISTORBED == 20) +#if THERMISTORBED == 20 #define HEATER_BED_RAW_HI_TEMP 16383 #define HEATER_BED_RAW_LO_TEMP 0 #endif diff --git a/Marlin/ubl_G29.cpp b/Marlin/ubl_G29.cpp index 7ae5b3099..e15c8d772 100644 --- a/Marlin/ubl_G29.cpp +++ b/Marlin/ubl_G29.cpp @@ -45,7 +45,7 @@ void lcd_mesh_edit_setup(float initial); float lcd_mesh_edit(); void lcd_z_offset_edit_setup(float); - #ifdef DOGLCD + #if ENABLED(DOGLCD) extern void _lcd_ubl_output_map_lcd(); #endif float lcd_z_offset_edit(); @@ -1575,7 +1575,7 @@ SERIAL_ECHOLNPGM("Done Editing Mesh"); if (ubl_lcd_map_control) { - #ifdef DOGLCD + #if ENABLED(DOGLCD) lcd_goto_screen(_lcd_ubl_output_map_lcd); #endif } diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 865a6e3db..749274486 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -257,7 +257,7 @@ uint16_t max_display_update_time = 0; _skipStatic = false; \ _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \ _MENU_ITEM_PART_2(TYPE, LABEL, ## __VA_ARGS__); \ - } while(0) + }while(0) #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0) @@ -289,13 +289,13 @@ uint16_t max_display_update_time = 0; encoderRateMultiplierEnabled = true; \ lastEncoderMovementMillis = 0; \ _MENU_ITEM_PART_2(type, label, ## __VA_ARGS__); \ - } while(0) + }while(0) #else // !ENCODER_RATE_MULTIPLIER #define ENCODER_RATE_MULTIPLY(F) NOOP #endif // !ENCODER_RATE_MULTIPLIER - #define MENU_ITEM_DUMMY() do { _thisItemNr++; } while(0) + #define MENU_ITEM_DUMMY() do { _thisItemNr++; }while(0) #define MENU_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__) #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__) #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1098,9 +1098,11 @@ void kill_screen(const char* lcd_msg) { #endif // HOTENDS > 1 #endif // HAS_TEMP_HOTEND - #if WATCH_THE_BED - void watch_temp_callback_bed() { thermalManager.start_watching_bed(); } - #endif + void watch_temp_callback_bed() { + #if WATCH_THE_BED + thermalManager.start_watching_bed(); + #endif + } #if ENABLED(ADVANCED_PAUSE_FEATURE) @@ -1162,7 +1164,7 @@ void kill_screen(const char* lcd_msg) { // // Bed: // - #if WATCH_THE_BED + #if HAS_TEMP_BED MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); #endif @@ -1810,7 +1812,7 @@ void kill_screen(const char* lcd_msg) { void _lcd_ubl_build_custom_mesh() { char UBL_LCD_GCODE[20]; enqueue_and_echo_commands_P(PSTR("G28")); - #if WATCH_THE_BED + #if HAS_TEMP_BED sprintf_P(UBL_LCD_GCODE, PSTR("M190 S%i"), custom_bed_temp); enqueue_and_echo_command(UBL_LCD_GCODE); #endif @@ -1826,7 +1828,7 @@ void kill_screen(const char* lcd_msg) { START_MENU(); MENU_BACK(MSG_UBL_BUILD_MESH_MENU); MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_HOTEND_TEMP, &custom_hotend_temp, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP - 10)); - #if WATCH_THE_BED + #if HAS_TEMP_BED MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_BED_TEMP, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 5)); #endif MENU_ITEM(function, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh); @@ -1875,7 +1877,7 @@ void kill_screen(const char* lcd_msg) { void _lcd_ubl_validate_custom_mesh() { char UBL_LCD_GCODE[24]; const int temp = - #if WATCH_THE_BED + #if HAS_TEMP_BED custom_bed_temp #else 0 @@ -1891,7 +1893,7 @@ void kill_screen(const char* lcd_msg) { void _lcd_ubl_validate_mesh() { START_MENU(); MENU_BACK(MSG_UBL_TOOLS); - #if WATCH_THE_BED + #if HAS_TEMP_BED 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")); 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")); #else @@ -1978,7 +1980,7 @@ void kill_screen(const char* lcd_msg) { void _lcd_ubl_build_mesh() { START_MENU(); MENU_BACK(MSG_UBL_TOOLS); - #if WATCH_THE_BED + #if HAS_TEMP_BED MENU_ITEM(gcode, MSG_UBL_BUILD_PLA_MESH, PSTR( "G28\n" "M190 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\n" @@ -2075,19 +2077,19 @@ void kill_screen(const char* lcd_msg) { enqueue_and_echo_command(ubl_lcd_gcode); } - #ifdef DOGLCD + #if ENABLED(DOGLCD) /** * UBL LCD "radar" map data */ - #define MAP_UPPER_LEFT_CORNER_X 35 // These probably should be moved to the .h file But for now, - #define MAP_UPPER_LEFT_CORNER_Y 8 // it is easier to play with things having them here - #define MAP_MAX_PIXELS_X 53 - #define MAP_MAX_PIXELS_Y 49 + #define MAP_UPPER_LEFT_CORNER_X 35 // These probably should be moved to the .h file But for now, + #define MAP_UPPER_LEFT_CORNER_Y 8 // it is easier to play with things having them here + #define MAP_MAX_PIXELS_X 53 + #define MAP_MAX_PIXELS_Y 49 void _lcd_ubl_plot_drawing_prep() { - uint8_t i, j, x_offset, y_offset, x_map_pixels, y_map_pixels; - uint8_t pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt, inverted_y; + uint8_t i, j, x_offset, y_offset, x_map_pixels, y_map_pixels, + pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt, inverted_y; /*********************************************************/ /************ Scale the box pixels appropriately *********/ @@ -2098,15 +2100,15 @@ void kill_screen(const char* lcd_msg) { pixels_per_X_mesh_pnt = x_map_pixels / GRID_MAX_POINTS_X; pixels_per_Y_mesh_pnt = y_map_pixels / GRID_MAX_POINTS_Y; - x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X-x_map_pixels-2)/2; - y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y-y_map_pixels-2)/2; + x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X - x_map_pixels - 2) / 2; + y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y - y_map_pixels - 2) / 2; /*********************************************************/ /************ Clear the Mesh Map Box**********************/ /*********************************************************/ u8g.setColorIndex(1); // First draw the bigger box in White so we have a border around the mesh map box - u8g.drawBox(x_offset-2, y_offset-2, x_map_pixels+4, y_map_pixels+4); + u8g.drawBox(x_offset - 2, y_offset - 2, x_map_pixels + 4, y_map_pixels + 4); u8g.setColorIndex(0); // Now actually clear the mesh map box u8g.drawBox(x_offset, y_offset, x_map_pixels, y_map_pixels); @@ -2118,8 +2120,8 @@ void kill_screen(const char* lcd_msg) { u8g.setColorIndex(1); for (i = 0; i < GRID_MAX_POINTS_X; i++) { for (j = 0; j < GRID_MAX_POINTS_Y; j++) { - u8g.drawBox(x_offset+i*pixels_per_X_mesh_pnt+pixels_per_X_mesh_pnt/2, - y_offset+j*pixels_per_Y_mesh_pnt+pixels_per_Y_mesh_pnt/2, 1, 1); + u8g.drawBox(x_offset + i * pixels_per_X_mesh_pnt + pixels_per_X_mesh_pnt / 2, + y_offset + j * pixels_per_Y_mesh_pnt + pixels_per_Y_mesh_pnt / 2, 1, 1); } } @@ -2127,9 +2129,9 @@ void kill_screen(const char* lcd_msg) { /************ Fill in the Specified Mesh Point ***********/ /*********************************************************/ - inverted_y = GRID_MAX_POINTS_Y - y_plot - 1; // The origin is typically in the lower right corner. We need to + inverted_y = GRID_MAX_POINTS_Y - y_plot - 1; // The origin is typically in the lower right corner. We need to // invert the Y to get it to plot in the right location. - u8g.drawBox(x_offset+x_plot*pixels_per_X_mesh_pnt, y_offset+inverted_y*pixels_per_Y_mesh_pnt, + u8g.drawBox(x_offset + x_plot * pixels_per_X_mesh_pnt, y_offset + inverted_y * pixels_per_Y_mesh_pnt, pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt); /*********************************************************/ @@ -2147,11 +2149,11 @@ void kill_screen(const char* lcd_msg) { // Print plot position u8g.setPrintPos(5, 64); - lcd_print("("); + lcd_print('('); u8g.print(x_plot); - lcd_print(","); + lcd_print(','); u8g.print(y_plot); - lcd_print(")"); + lcd_print(')'); // Show the location value u8g.setPrintPos(74, 64); @@ -2262,7 +2264,7 @@ void kill_screen(const char* lcd_msg) { void _lcd_ubl_output_map_lcd_cmd() { if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) enqueue_and_echo_commands_P(PSTR("G28")); - lcd_goto_screen(_lcd_ubl_map_homing); + lcd_goto_screen(_lcd_ubl_map_homing); } /** @@ -2968,7 +2970,7 @@ void kill_screen(const char* lcd_msg) { // // Bed: // - #if WATCH_THE_BED + #if HAS_TEMP_BED MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); #endif @@ -3624,7 +3626,7 @@ void kill_screen(const char* lcd_msg) { lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ } \ ++_thisItemNr; \ - } while(0) + }while(0) void lcd_advanced_pause_toocold_menu() { START_MENU(); diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 676dfcacf..295e27676 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -424,10 +424,10 @@ inline void lcd_implementation_status_message() { lcd_print_utf(stat); // The string leaves space chars -= slen - status_scroll_pos; // Amount of space left } - lcd.print('.'); // Always at 1+ spaces left, draw a dot + u8g.print('.'); // Always at 1+ spaces left, draw a dot if (--chars) { if (status_scroll_pos < slen + 1) // Draw a second dot if there's space - --chars, lcd.print('.'); + --chars, u8g.print('.'); if (chars) lcd_print_utf(lcd_status_message, chars); // Print a second copy of the message } } diff --git a/Marlin/ultralcd_impl_HD44780.h b/Marlin/ultralcd_impl_HD44780.h index 93a623d0e..0521cb2f2 100644 --- a/Marlin/ultralcd_impl_HD44780.h +++ b/Marlin/ultralcd_impl_HD44780.h @@ -1012,7 +1012,7 @@ static void lcd_implementation_status_screen() { #endif // SDSUPPORT - #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_UPLEVEL_CHAR,LCD_UPLEVEL_CHAR) + #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_UPLEVEL_CHAR, LCD_UPLEVEL_CHAR) #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]) #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')