UBL_LCD_storage_corrections (#7517)

Correcting the storage selection.
Also EEPROM error handling on the LCD.
This commit is contained in:
Tannoo 2017-08-15 20:01:11 -06:00 committed by Roxy-3D
parent be5ca34215
commit ab2ac1af71

View file

@ -2118,18 +2118,22 @@ void kill_screen(const char* lcd_msg) {
* UBL Load Mesh Command * UBL Load Mesh Command
*/ */
void _lcd_ubl_load_mesh_cmd() { void _lcd_ubl_load_mesh_cmd() {
char UBL_LCD_GCODE[8]; char UBL_LCD_GCODE[25];
sprintf_P(UBL_LCD_GCODE, PSTR("G29 L%i"), ubl_storage_slot); sprintf_P(UBL_LCD_GCODE, PSTR("G29 L%i"), ubl_storage_slot);
enqueue_and_echo_command(UBL_LCD_GCODE); enqueue_and_echo_command(UBL_LCD_GCODE);
sprintf_P(UBL_LCD_GCODE, PSTR("M117 Map %i loaded."), ubl_storage_slot);
enqueue_and_echo_command(UBL_LCD_GCODE);
} }
/** /**
* UBL Save Mesh Command * UBL Save Mesh Command
*/ */
void _lcd_ubl_save_mesh_cmd() { void _lcd_ubl_save_mesh_cmd() {
char UBL_LCD_GCODE[8]; char UBL_LCD_GCODE[25];
sprintf_P(UBL_LCD_GCODE, PSTR("G29 S%i"), ubl_storage_slot); sprintf_P(UBL_LCD_GCODE, PSTR("G29 S%i"), ubl_storage_slot);
enqueue_and_echo_command(UBL_LCD_GCODE); enqueue_and_echo_command(UBL_LCD_GCODE);
sprintf_P(UBL_LCD_GCODE, PSTR("M117 Map %i saved."), ubl_storage_slot);
enqueue_and_echo_command(UBL_LCD_GCODE);
} }
/** /**
@ -2141,11 +2145,18 @@ void kill_screen(const char* lcd_msg) {
* Save Bed Mesh * Save Bed Mesh
*/ */
void _lcd_ubl_storage_mesh() { void _lcd_ubl_storage_mesh() {
int16_t a = settings.calc_num_meshes();
START_MENU(); START_MENU();
MENU_BACK(MSG_UBL_LEVEL_BED); MENU_BACK(MSG_UBL_LEVEL_BED);
MENU_ITEM_EDIT(int3, MSG_UBL_STORAGE_SLOT, &ubl_storage_slot, 0, 9); if (!WITHIN(ubl_storage_slot, 0, a - 1)) {
STATIC_ITEM("No storage");
STATIC_ITEM("Initialize EEPROM");
}
else {
MENU_ITEM_EDIT(int3, MSG_UBL_STORAGE_SLOT, &ubl_storage_slot, 0, a - 1);
MENU_ITEM(function, MSG_UBL_LOAD_MESH, _lcd_ubl_load_mesh_cmd); MENU_ITEM(function, MSG_UBL_LOAD_MESH, _lcd_ubl_load_mesh_cmd);
MENU_ITEM(function, MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd); MENU_ITEM(function, MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd);
}
END_MENU(); END_MENU();
} }