Do not store a global mbl_z_probe_nr

flash: -6
sram: 0? (somehow)
This commit is contained in:
Alex Voinea 2023-05-11 17:37:40 +02:00
parent a984b2e609
commit 7740a81edb
No known key found for this signature in database
GPG Key ID: 37EDFD565CB33BAD
4 changed files with 3 additions and 5 deletions

View File

@ -22,7 +22,6 @@
#include "pins.h" #include "pins.h"
#include "Timer.h" #include "Timer.h"
#include "mmu2.h" #include "mmu2.h"
extern uint8_t mbl_z_probe_nr;
#ifndef AT90USB #ifndef AT90USB
#define HardwareSerial_h // trick to disable the standard HWserial #define HardwareSerial_h // trick to disable the standard HWserial

View File

@ -148,8 +148,6 @@
CardReader card; CardReader card;
#endif #endif
uint8_t mbl_z_probe_nr = 3; //numer of Z measurements for each point in mesh bed leveling calibration
//used for PINDA temp calibration and pause print //used for PINDA temp calibration and pause print
#define DEFAULT_RETRACTION 1 #define DEFAULT_RETRACTION 1
#define DEFAULT_RETRACTION_MM 4 //MM #define DEFAULT_RETRACTION_MM 4 //MM

View File

@ -3124,7 +3124,7 @@ void mbl_settings_init() {
//magnet elimination: use aaproximate Z-coordinate instead of measured values for points which are near magnets //magnet elimination: use aaproximate Z-coordinate instead of measured values for points which are near magnets
eeprom_init_default_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION, 1); eeprom_init_default_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION, 1);
eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3);
mbl_z_probe_nr = eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3);
} }
//parameter ix: index of mesh bed leveling point in X-axis (for meas_points == 7 is valid range from 0 to 6; for meas_points == 3 is valid range from 0 to 2 ) //parameter ix: index of mesh bed leveling point in X-axis (for meas_points == 7 is valid range from 0 to 6; for meas_points == 3 is valid range from 0 to 2 )

View File

@ -5457,7 +5457,7 @@ static void mbl_mesh_toggle() {
} }
static void mbl_probe_nr_toggle() { static void mbl_probe_nr_toggle() {
mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR);
switch (mbl_z_probe_nr) { switch (mbl_z_probe_nr) {
case 1: mbl_z_probe_nr = 3; break; case 1: mbl_z_probe_nr = 3; break;
case 3: mbl_z_probe_nr = 5; break; case 3: mbl_z_probe_nr = 5; break;
@ -5472,6 +5472,7 @@ static void lcd_mesh_bed_leveling_settings()
bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0);
uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR);
uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR);
char sToggle[4]; //enough for nxn format char sToggle[4]; //enough for nxn format
MENU_BEGIN(); MENU_BEGIN();