diff --git a/Firmware/LiquidCrystal.cpp b/Firmware/LiquidCrystal.cpp index 88ac6deac..b77e3cc24 100644 --- a/Firmware/LiquidCrystal.cpp +++ b/Firmware/LiquidCrystal.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "Arduino.h" +#include "Marlin.h" // When the display powers up, it is configured as follows: // @@ -83,6 +83,8 @@ void LiquidCrystal::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t en } void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) { + UNUSED(cols); + if (lines > 1) { _displayfunction |= LCD_2LINE; } @@ -161,6 +163,8 @@ void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) { void LiquidCrystal::begin_noclear(uint8_t cols, uint8_t lines, uint8_t dotsize) { + UNUSED(cols); + if (lines > 1) { _displayfunction |= LCD_2LINE; } diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index ff3ed9aa0..0c10ee3d6 100644 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -122,8 +122,8 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON) #define disable_x() { WRITE(X_ENABLE_PIN,!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } #else - #define enable_x() ; - #define disable_x() ; + #define enable_x() {} + #define disable_x() {} #endif #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1 @@ -135,8 +135,8 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define disable_y() { WRITE(Y_ENABLE_PIN,!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; } #endif #else - #define enable_y() ; - #define disable_y() ; + #define enable_y() {} + #define disable_y() {} #endif #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1 @@ -146,7 +146,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define disable_z() { WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON); WRITE(Z2_ENABLE_PIN,!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; } #else #define enable_z() WRITE(Z_ENABLE_PIN, Z_ENABLE_ON) - #define disable_z() ; + #define disable_z() {} #endif #else #ifdef Z_DUAL_STEPPER_DRIVERS @@ -158,8 +158,8 @@ void manage_inactivity(bool ignore_stepper_queue=false); #endif #endif #else - #define enable_z() ; - #define disable_z() ; + #define enable_z() {} + #define disable_z() {} #endif @@ -183,24 +183,24 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define enable_e0() WRITE(E0_ENABLE_PIN, E_ENABLE_ON) #define disable_e0() WRITE(E0_ENABLE_PIN,!E_ENABLE_ON) #else - #define enable_e0() /* nothing */ - #define disable_e0() /* nothing */ + #define enable_e0() {/* nothing */} + #define disable_e0() {/* nothing */} #endif #if (EXTRUDERS > 1) && defined(E1_ENABLE_PIN) && (E1_ENABLE_PIN > -1) #define enable_e1() WRITE(E1_ENABLE_PIN, E_ENABLE_ON) #define disable_e1() WRITE(E1_ENABLE_PIN,!E_ENABLE_ON) #else - #define enable_e1() /* nothing */ - #define disable_e1() /* nothing */ + #define enable_e1() {/* nothing */} + #define disable_e1() {/* nothing */} #endif #if (EXTRUDERS > 2) && defined(E2_ENABLE_PIN) && (E2_ENABLE_PIN > -1) #define enable_e2() WRITE(E2_ENABLE_PIN, E_ENABLE_ON) #define disable_e2() WRITE(E2_ENABLE_PIN,!E_ENABLE_ON) #else - #define enable_e2() /* nothing */ - #define disable_e2() /* nothing */ + #define enable_e2() {/* nothing */} + #define disable_e2() {/* nothing */} #endif @@ -385,6 +385,7 @@ extern MarlinBusyState busy_state; bool gcode_M45(bool onlyZ); void gcode_M701(); +#define UNUSED(x) (void)(x) #endif //ifndef marlin.h diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index dda630d98..c64bf2cfd 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -931,6 +931,8 @@ void servo_init() int er_progress = 0; void factory_reset(char level, bool quiet) { + UNUSED(quiet); + lcd_implementation_clear(); switch (level) { @@ -3370,7 +3372,7 @@ void process_commands() clamped ? SERIAL_PROTOCOLPGM("First calibration point clamped.\n") : SERIAL_PROTOCOLPGM("No clamping for first calibration point.\n"); } #endif // SUPPORT_VERBOSITY - // mbl.get_meas_xy(0, 0, current_position[X_AXIS], current_position[Y_AXIS], false); + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[X_AXIS] / 30, active_extruder); // Wait until the move is finished. st_synchronize(); diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 1c00651a8..a3fd741f1 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -2436,6 +2436,8 @@ bool sample_mesh_and_store_reference() bool scan_bed_induction_points(int8_t verbosity_level) { + UNUSED(verbosity_level); + // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); diff --git a/Firmware/mesh_bed_leveling.cpp b/Firmware/mesh_bed_leveling.cpp index 506d3746a..344d41e3f 100644 --- a/Firmware/mesh_bed_leveling.cpp +++ b/Firmware/mesh_bed_leveling.cpp @@ -21,78 +21,6 @@ static inline bool vec_undef(const float v[2]) return vx[0] == 0x0FFFFFFFF || vx[1] == 0x0FFFFFFFF; } -void mesh_bed_leveling::get_meas_xy(int ix, int iy, float &x, float &y, bool use_default) -{ -#if 0 - float cntr[2] = { - eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+0)), - eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4)) - }; - float vec_x[2] = { - eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_X +0)), - eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_X +4)) - }; - float vec_y[2] = { - eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_Y +0)), - eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_Y +4)) - }; - - if (use_default || vec_undef(cntr) || vec_undef(vec_x) || vec_undef(vec_y)) { - // Default, uncorrected positions of the calibration points. Works well for correctly built printers. - x = float(MESH_MIN_X) + float(MEAS_NUM_X_DIST) * float(ix) - X_PROBE_OFFSET_FROM_EXTRUDER; - //FIXME - //x -= 5.f; - y = float(MESH_MIN_Y) + float(MEAS_NUM_Y_DIST) * float(iy) - Y_PROBE_OFFSET_FROM_EXTRUDER; - } else { -#if 0 - SERIAL_ECHO("Running bed leveling. Calibration data: "); - SERIAL_ECHO(cntr[0]); - SERIAL_ECHO(","); - SERIAL_ECHO(cntr[1]); - SERIAL_ECHO(", x: "); - SERIAL_ECHO(vec_x[0]); - SERIAL_ECHO(","); - SERIAL_ECHO(vec_x[1]); - SERIAL_ECHO(", y: "); - SERIAL_ECHO(vec_y[0]); - SERIAL_ECHO(","); - SERIAL_ECHO(vec_y[1]); - SERIAL_ECHOLN(""); -#endif - - x = cntr[0]; - y = cntr[1]; - if (ix < 1) { - x -= vec_x[0]; - y -= vec_x[1]; - } else if (ix > 1) { - x += vec_x[0]; - y += vec_x[1]; - } - if (iy < 1) { - x -= vec_y[0]; - y -= vec_y[1]; - } else if (iy > 1) { - x += vec_y[0]; - y += vec_y[1]; - } - -#if 0 - SERIAL_ECHO("Calibration point position: "); - SERIAL_ECHO(x); - SERIAL_ECHO(","); - SERIAL_ECHO(y); - SERIAL_ECHOLN(""); -#endif - } -#else - // Default, uncorrected positions of the calibration points. - // This coordinate will be corrected by the planner. - x = pgm_read_float(bed_ref_points + 2 * (iy * 3 + ix)); - y = pgm_read_float(bed_ref_points + 2 * (iy * 3 + ix) + 1); -#endif -} - #if MESH_NUM_X_POINTS>=5 && MESH_NUM_Y_POINTS>=5 && (MESH_NUM_X_POINTS&1)==1 && (MESH_NUM_Y_POINTS&1)==1 // Works for an odd number of MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS diff --git a/Firmware/mesh_bed_leveling.h b/Firmware/mesh_bed_leveling.h index bf3729558..a600c3a17 100644 --- a/Firmware/mesh_bed_leveling.h +++ b/Firmware/mesh_bed_leveling.h @@ -24,11 +24,6 @@ public: static float get_x(int i) { return float(MESH_MIN_X) + float(MESH_X_DIST) * float(i); } static float get_y(int i) { return float(MESH_MIN_Y) + float(MESH_Y_DIST) * float(i); } - // Measurement point for the Z probe. - // If use_default=true, then the default positions for a correctly built printer are used. - // Otherwise a correction matrix is pulled from the EEPROM if available. - static void get_meas_xy(int ix, int iy, float &x, float &y, bool use_default); - void set_z(int ix, int iy, float z) { z_values[iy][ix] = z; } int select_x_index(float x) { diff --git a/Firmware/stepper.cpp b/Firmware/stepper.cpp index 0605e3abb..75a663325 100644 --- a/Firmware/stepper.cpp +++ b/Firmware/stepper.cpp @@ -1146,6 +1146,8 @@ void digitalPotWrite(int address, int value) // From Arduino DigitalPotControl e SPI.transfer(value); digitalWrite(DIGIPOTSS_PIN,HIGH); // take the SS pin high to de-select the chip: //delay(10); + #else + UNUSED(address); UNUSED(value); #endif } diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 958cee709..a6cb5ce1a 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5787,6 +5787,8 @@ static bool check_file(const char* filename) { static void menu_action_sdfile(const char* filename, char* longFilename) { + UNUSED(longFilename); + loading_flag = false; char cmd[30]; char* c; @@ -5806,6 +5808,8 @@ static void menu_action_sdfile(const char* filename, char* longFilename) } static void menu_action_sddirectory(const char* filename, char* longFilename) { + UNUSED(longFilename); + card.chdir(filename); encoderPosition = 0; } @@ -6301,12 +6305,12 @@ bool lcd_detected(void) #endif } +#ifdef LCD_USE_I2C_BUZZER void lcd_buzz(long duration, uint16_t freq) { -#ifdef LCD_USE_I2C_BUZZER lcd.buzz(duration, freq); -#endif } +#endif bool lcd_clicked() { diff --git a/Firmware/ultralcd_implementation_hitachi_HD44780.h b/Firmware/ultralcd_implementation_hitachi_HD44780.h index 275c96d27..f55be0722 100644 --- a/Firmware/ultralcd_implementation_hitachi_HD44780.h +++ b/Firmware/ultralcd_implementation_hitachi_HD44780.h @@ -1189,6 +1189,8 @@ void lcd_implementation_drawedit_2(const char* pstr, char* value) static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename) { + UNUSED(pstr); UNUSED(filename); + char c; int enc_dif = encoderDiff; uint8_t n = LCD_WIDTH - 1; @@ -1242,6 +1244,8 @@ static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char* } static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* pstr, const char* filename, char* longFilename) { + UNUSED(pstr); + char c; uint8_t n = LCD_WIDTH - 1; lcd.setCursor(0, row); @@ -1262,6 +1266,8 @@ static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* pstr, co } static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename) { + UNUSED(pstr); + char c; uint8_t n = LCD_WIDTH - 2; lcd.setCursor(0, row); @@ -1283,6 +1289,8 @@ static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const } static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* pstr, const char* filename, char* longFilename) { + UNUSED(pstr); + char c; uint8_t n = LCD_WIDTH - 2; lcd.setCursor(0, row);