From 7dc64efe672a1417b2aa49a72a27448e09f06d05 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Wed, 8 Apr 2015 20:52:48 +0200 Subject: [PATCH 1/5] Added sanity check for MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS --- Marlin/Configuration.h | 2 +- Marlin/SanityCheck.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b0d97f15e7..b99d4f426f 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -420,7 +420,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. //=========================================================================== -//============================ Manual Bed Leveling ========================== +//============================ Mesh Bed Leveling ============================ //=========================================================================== // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index d1be7703d9..7aeaa81a68 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -101,6 +101,9 @@ #ifdef ENABLE_AUTO_BED_LEVELING #error Select ENABLE_AUTO_BED_LEVELING or MESH_BED_LEVELING, not both #endif + #if MESH_NUM_X_POINTS > 7 || MESH_NUM_Y_POINTS > 7 + #error MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS need to be less than 8 + #endif #endif /** From ea897654a466d24d0511c331e6c1e6b12df1014f Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 8 Apr 2015 21:53:58 +0200 Subject: [PATCH 2/5] Moved the definitions of the LCD_STR_* to Conditionals.h to avoid errors in Marlin_main.cpp. #1860 In the include tree of Marlin_main.cpp the decision between the display types is not made. To include the right LCD_STR_* ether 'dogm_lcd_implementation.h' or 'ultralcd_implementation_hitachi_HD44780.h' with all their code. A 'dogm_lcd_implementation.h.h' would be a curiosity. So i moved both of the definition blocks to conditionals.h On the long term it could make sense to use the same numbering for the u8glib and the hitachi symbols. --- Marlin/Conditionals.h | 43 ++++++++++++++++--- Marlin/dogm_lcd_implementation.h | 16 ------- .../ultralcd_implementation_hitachi_HD44780.h | 12 ------ 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 5d3213e0e3..5b1024236e 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -144,16 +144,45 @@ #endif #else //no panel but just LCD #ifdef ULTRA_LCD - #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display - #define LCD_WIDTH 22 - #define LCD_HEIGHT 5 - #else - #define LCD_WIDTH 16 - #define LCD_HEIGHT 2 - #endif + #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display + #define LCD_WIDTH 22 + #define LCD_HEIGHT 5 + #else + #define LCD_WIDTH 16 + #define LCD_HEIGHT 2 + #endif #endif #endif + #ifdef DOGLCD + /* Custom characters defined in font font_6x10_marlin_symbols */ + // \x00 intentionally skipped to avoid problems in strings + #define LCD_STR_REFRESH "\x01" + #define LCD_STR_FOLDER "\x02" + #define LCD_STR_ARROW_RIGHT "\x03" + #define LCD_STR_UPLEVEL "\x04" + #define LCD_STR_CLOCK "\x05" + #define LCD_STR_FEEDRATE "\x06" + #define LCD_STR_BEDTEMP "\x07" + #define LCD_STR_THERMOMETER "\x08" + #define LCD_STR_DEGREE "\x09" + + #define LCD_STR_SPECIAL_MAX '\x09' + // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin. + // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. + #else + /* Custom characters defined in the first 8 characters of the LCD */ + #define LCD_STR_BEDTEMP "\x00" // this will have 'unexpected' results when used in a string! + #define LCD_STR_DEGREE "\x01" + #define LCD_STR_THERMOMETER "\x02" + #define LCD_STR_UPLEVEL "\x03" + #define LCD_STR_REFRESH "\x04" + #define LCD_STR_FOLDER "\x05" + #define LCD_STR_FEEDRATE "\x06" + #define LCD_STR_CLOCK "\x07" + #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ + #endif + /** * Default LCD contrast for dogm-like LCD displays */ diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 2a6d229b7f..fd52d645ed 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -108,22 +108,6 @@ #define START_ROW 0 -/* Custom characters defined in font font_6x10_marlin_symbols */ -// \x00 intentionally skipped to avoid problems in strings -#define LCD_STR_REFRESH "\x01" -#define LCD_STR_FOLDER "\x02" -#define LCD_STR_ARROW_RIGHT "\x03" -#define LCD_STR_UPLEVEL "\x04" -#define LCD_STR_CLOCK "\x05" -#define LCD_STR_FEEDRATE "\x06" -#define LCD_STR_BEDTEMP "\x07" -#define LCD_STR_THERMOMETER "\x08" -#define LCD_STR_DEGREE "\x09" - -#define LCD_STR_SPECIAL_MAX '\x09' -// Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin. -// Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. - // LCD selection #ifdef U8GLIB_ST7920 //U8GLIB_ST7920_128X64_RRD u8g(0,0,0); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 5698fd94b9..aa348018ef 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -201,18 +201,6 @@ #define LCD_STR_PROGRESS "\x03\x04\x05" #endif -/* Custom characters defined in the first 8 characters of the LCD */ -#define LCD_STR_BEDTEMP "\x00" // this will have 'unexpected' results when used in a string! -#define LCD_STR_DEGREE "\x01" -#define LCD_STR_THERMOMETER "\x02" -#define LCD_STR_UPLEVEL "\x03" -#define LCD_STR_REFRESH "\x04" -#define LCD_STR_FOLDER "\x05" -#define LCD_STR_FEEDRATE "\x06" -#define LCD_STR_CLOCK "\x07" -//#define LCD_STR_ARROW_RIGHT "\x7E" /* from the default character set. Only available on DISPLAY_CHARSET_HD44780_JAPAN - at this place!*/ -#define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ - static void lcd_set_custom_characters( #ifdef LCD_PROGRESS_BAR bool progress_bar_set=true From 14d4419e161b26cb70bd6d28101ca554f0f099fd Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 8 Apr 2015 23:59:01 +0200 Subject: [PATCH 3/5] Replaced SERIAL_PROTOCOLPGM(MSG_BED) with SERIAL_PROTOCOLPGM("Bed") Resolved some warnings in Marlin_main.cpp regarding compares of signed and unsigned integers by replacing 'int' or 'uint16_t' with 'uint8_t'. --- Marlin/Marlin_main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8bf0909886..b48cfd849e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2514,7 +2514,7 @@ inline void gcode_G28() { feedrate = homing_feedrate[Z_AXIS]; run_z_probe(); - SERIAL_PROTOCOLPGM(MSG_BED); + SERIAL_PROTOCOLPGM("Bed"); SERIAL_PROTOCOLPGM(" X: "); SERIAL_PROTOCOL(current_position[X_AXIS] + 0.0001); SERIAL_PROTOCOLPGM(" Y: "); @@ -2852,8 +2852,8 @@ inline void gcode_M42() { inline void gcode_M48() { double sum = 0.0, mean = 0.0, sigma = 0.0, sample_set[50]; - int verbose_level = 1, n_samples = 10, n_legs = 0; - + uint8_t verbose_level = 1, n_samples = 10, n_legs = 0; + if (code_seen('V') || code_seen('v')) { verbose_level = code_value_short(); if (verbose_level < 0 || verbose_level > 4 ) { @@ -2960,7 +2960,7 @@ inline void gcode_M42() { if (deploy_probe_for_each_reading) stow_z_probe(); - for (uint16_t n=0; n < n_samples; n++) { + for (uint8_t n=0; n < n_samples; n++) { do_blocking_move_to(X_probe_location, Y_probe_location, Z_start_location); // Make sure we are at the probe location @@ -2975,7 +2975,7 @@ inline void gcode_M42() { //SERIAL_ECHOPAIR(" direction: ",dir); //SERIAL_EOL; - for (int l = 0; l < n_legs - 1; l++) { + for (uint8_t l = 0; l < n_legs - 1; l++) { ms = millis(); theta += RADIANS(dir * (ms % 20L)); radius += (ms % 10L) - 5L; @@ -3014,7 +3014,7 @@ inline void gcode_M42() { // Get the current mean for the data points we have so far // sum = 0.0; - for (int j = 0; j <= n; j++) sum += sample_set[j]; + for (uint8_t j = 0; j <= n; j++) sum += sample_set[j]; mean = sum / (n + 1); // @@ -3022,7 +3022,7 @@ inline void gcode_M42() { // data points we have so far // sum = 0.0; - for (int j = 0; j <= n; j++) { + for (uint8_t j = 0; j <= n; j++) { float ss = sample_set[j] - mean; sum += ss * ss; } From 540dbb35e2c51767120c2765ae821a7e30e207c9 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 9 Apr 2015 01:16:06 +0200 Subject: [PATCH 4/5] And an other MSG_BED in Marlin_main.cpp --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b48cfd849e..b2e105809a 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1365,7 +1365,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, #endif if (verbose_level > 2) { - SERIAL_PROTOCOLPGM(MSG_BED); + SERIAL_PROTOCOLPGM("Bed"); SERIAL_PROTOCOLPGM(" X: "); SERIAL_PROTOCOL_F(x, 3); SERIAL_PROTOCOLPGM(" Y: "); From a95544f92ac7ab15d66f12ce46616d54a7dad3b8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Apr 2015 02:04:06 -0700 Subject: [PATCH 5/5] Spell adjustment --- Marlin/ConfigurationStore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/ConfigurationStore.cpp b/Marlin/ConfigurationStore.cpp index 56de816848..0154691de0 100644 --- a/Marlin/ConfigurationStore.cpp +++ b/Marlin/ConfigurationStore.cpp @@ -669,7 +669,7 @@ void Config_PrintSettings(bool forReplay) { #ifdef DELTA SERIAL_ECHO_START; if (!forReplay) { - SERIAL_ECHOLNPGM("Endstop adjustement (mm):"); + SERIAL_ECHOLNPGM("Endstop adjustment (mm):"); SERIAL_ECHO_START; } SERIAL_ECHOPAIR(" M666 X", endstop_adj[X_AXIS] ); @@ -686,7 +686,7 @@ void Config_PrintSettings(bool forReplay) { #elif defined(Z_DUAL_ENDSTOPS) SERIAL_ECHO_START; if (!forReplay) { - SERIAL_ECHOLNPGM("Z2 Endstop adjustement (mm):"); + SERIAL_ECHOLNPGM("Z2 Endstop adjustment (mm):"); SERIAL_ECHO_START; } SERIAL_ECHOPAIR(" M666 Z", z_endstop_adj );