More optimization
This commit is contained in:
parent
8f4ac82273
commit
ef83fefce1
|
|
@ -390,12 +390,8 @@ void prusa_statistics_update_from_lcd_update() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void farm_mode_init() {
|
void farm_mode_init() {
|
||||||
farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE);
|
farm_mode = eeprom_init_default_byte((uint8_t*)EEPROM_FARM_MODE, 0);
|
||||||
if (farm_mode == 0xFF) {
|
if (farm_mode) {
|
||||||
farm_mode = false; //if farm_mode has not been stored to eeprom yet and farm number is set to zero or EEPROM is fresh, deactivate farm mode
|
|
||||||
eeprom_update_byte((uint8_t*)EEPROM_FARM_MODE, farm_mode);
|
|
||||||
}
|
|
||||||
else if (farm_mode) {
|
|
||||||
no_response = true; //we need confirmation by recieving PRUSA thx
|
no_response = true; //we need confirmation by recieving PRUSA thx
|
||||||
prusa_statistics(8);
|
prusa_statistics(8);
|
||||||
#ifdef HAS_SECOND_SERIAL_PORT
|
#ifdef HAS_SECOND_SERIAL_PORT
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,10 @@ void eeprom_update_block_P(const void *__src, void *__dst, size_t __n) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void eeprom_toggle(uint8_t *__p) {
|
||||||
|
eeprom_write_byte(__p, !eeprom_read_byte(__p));
|
||||||
|
}
|
||||||
|
|
||||||
void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) {
|
void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) {
|
||||||
eeprom_write_byte(__p, eeprom_read_byte(__p) + 1);
|
eeprom_write_byte(__p, eeprom_read_byte(__p) + 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -615,6 +615,7 @@ bool eeprom_is_sheet_initialized(uint8_t sheet_num);
|
||||||
|
|
||||||
bool eeprom_is_initialized_block(const void *__p, size_t __n);
|
bool eeprom_is_initialized_block(const void *__p, size_t __n);
|
||||||
void eeprom_update_block_P(const void *__src, void *__dst, size_t __n);
|
void eeprom_update_block_P(const void *__src, void *__dst, size_t __n);
|
||||||
|
void eeprom_toggle(uint8_t *__p);
|
||||||
|
|
||||||
void eeprom_increment_byte(uint8_t *__p);
|
void eeprom_increment_byte(uint8_t *__p);
|
||||||
void eeprom_increment_word(uint16_t *__p);
|
void eeprom_increment_word(uint16_t *__p);
|
||||||
|
|
|
||||||
|
|
@ -3125,11 +3125,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_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR);
|
mbl_z_probe_nr = eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3);
|
||||||
if (mbl_z_probe_nr == 0xFF) {
|
|
||||||
mbl_z_probe_nr = 3;
|
|
||||||
eeprom_update_byte((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//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 )
|
||||||
|
|
|
||||||
|
|
@ -4605,12 +4605,7 @@ void lcd_hw_setup_menu(void) // can not be "static"
|
||||||
if (_md->status == 0 || lcd_draw_update)
|
if (_md->status == 0 || lcd_draw_update)
|
||||||
{
|
{
|
||||||
_md->status = 1;
|
_md->status = 1;
|
||||||
_md->experimental_menu_visibility = eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY);
|
_md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0);
|
||||||
if (_md->experimental_menu_visibility == EEPROM_EMPTY_VALUE)
|
|
||||||
{
|
|
||||||
_md->experimental_menu_visibility = 0;
|
|
||||||
eeprom_update_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, _md->experimental_menu_visibility);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -7527,7 +7522,7 @@ void menu_lcd_longpress_func(void)
|
||||||
{
|
{
|
||||||
// only toggle the experimental menu visibility flag
|
// only toggle the experimental menu visibility flag
|
||||||
lcd_quick_feedback();
|
lcd_quick_feedback();
|
||||||
lcd_experimental_toggle();
|
eeprom_toggle((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7690,16 +7685,6 @@ void lcd_crash_detect_disable()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void lcd_experimental_toggle()
|
|
||||||
{
|
|
||||||
uint8_t oldVal = eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY);
|
|
||||||
if (oldVal == EEPROM_EMPTY_VALUE)
|
|
||||||
oldVal = 0;
|
|
||||||
else
|
|
||||||
oldVal = !oldVal;
|
|
||||||
eeprom_update_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, oldVal);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
void UserECool_toggle(){
|
void UserECool_toggle(){
|
||||||
// this is only called when the experimental menu is visible, thus the first condition for enabling of the ECool mode is met in this place
|
// this is only called when the experimental menu is visible, thus the first condition for enabling of the ECool mode is met in this place
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,6 @@ enum class WizState : uint8_t
|
||||||
|
|
||||||
void lcd_wizard(WizState state);
|
void lcd_wizard(WizState state);
|
||||||
|
|
||||||
extern void lcd_experimental_toggle();
|
|
||||||
extern void lcd_experimental_menu();
|
extern void lcd_experimental_menu();
|
||||||
|
|
||||||
uint8_t lcdui_print_extruder(void);
|
uint8_t lcdui_print_extruder(void);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue