From a9d5af4a0741fbd2e7bbfab9f6fe24eda1072406 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 20 Dec 2017 13:33:45 +0100 Subject: [PATCH] Wizard: dont ask if color is clear and dont use automatic filament load; multiscreen messages update --- Firmware/fsensor.cpp | 8 ++++++++ Firmware/fsensor.h | 4 ++++ Firmware/ultralcd.cpp | 21 +++++++++++++++------ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Firmware/fsensor.cpp b/Firmware/fsensor.cpp index 5edec1d8..64ac1a0b 100644 --- a/Firmware/fsensor.cpp +++ b/Firmware/fsensor.cpp @@ -47,6 +47,14 @@ uint16_t fsensor_autoload_y = 0; uint8_t fsensor_autoload_c = 0; uint32_t fsensor_autoload_last_millis = 0; +void fsensor_block() +{ + fsensor_enabled = false; +} + +void fsensor_unblock() { + fsensor_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FSENSOR) == 0x01); +} bool fsensor_enable() { diff --git a/Firmware/fsensor.h b/Firmware/fsensor.h index ee02f16f..0c5543bc 100644 --- a/Firmware/fsensor.h +++ b/Firmware/fsensor.h @@ -7,6 +7,10 @@ extern void fsensor_stop_and_save_print(); extern void fsensor_restore_print_and_continue(); +//temporarily enable/disable without writing to eeprom +extern void fsensor_block(); +extern void fsensor_unblock(); + //enable/disable extern bool fsensor_enable(); extern void fsensor_disable(); diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 598cbb23..21aaeb01 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -110,6 +110,9 @@ int8_t FSensorStateMenu = 1; int8_t CrashDetectMenu = 1; +extern void fsensor_block(); +extern void fsensor_unblock(); + extern bool fsensor_enable(); extern void fsensor_disable(); @@ -2646,11 +2649,16 @@ void lcd_show_fullscreen_message_and_wait_P(const char *msg) while (lcd_clicked()) ; delay(10); while (lcd_clicked()) ; - KEEPALIVE_STATE(IN_HANDLER); - lcd_set_custom_characters(); - lcd_update_enable(true); - lcd_update(2); - return; + if (msg_next == NULL) { + KEEPALIVE_STATE(IN_HANDLER); + lcd_set_custom_characters(); + lcd_update_enable(true); + lcd_update(2); + return; + } + else { + break; + } } } if (multi_screen) { @@ -3618,15 +3626,16 @@ void lcd_wizard(int state) { state = 7; break; case 7: //load filament + fsensor_block(); lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_LOAD_FILAMENT); lcd_update_enable(false); lcd_implementation_clear(); lcd_print_at_PGM(0, 2, MSG_LOADING_FILAMENT); - loading_flag = true; #ifdef SNMM change_extr(0); #endif gcode_M701(); + fsensor_unblock(); state = 9; break; case 8: