From 7daf6b2efd9726fbbefca02bb0c9ce4f48144e9c Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 23 Mar 2017 14:38:18 +0100 Subject: [PATCH] dont use blocking encoder for button press, lcd_update(false) added to setup function --- Firmware/Configuration.h | 2 +- Firmware/Marlin_main.cpp | 8 +++----- Firmware/ultralcd.cpp | 8 +++----- Firmware/ultralcd.h | 1 - 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index 5fd68384c..d1d0b8ab9 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -5,7 +5,7 @@ #include "Configuration_prusa.h" // Firmware version -#define FW_version "3.0.10-7" +#define FW_version "3.0.10-8" #define FW_PRUSA3D_MAGIC "PRUSA3DFW" #define FW_PRUSA3D_MAGIC_LEN 10 diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index abc47c2bd..dc00e4b72 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -1028,7 +1028,7 @@ void setup() SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(MSG_PLANNER_BUFFER_BYTES); SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); - + lcd_update_enable(false); // loads data from EEPROM if available else uses defaults (and resets step acceleration rate) Config_RetrieveSettings(); SdFatUtil::set_stack_guard(); //writes magic number at the end of static variables to protect against overwriting static memory by stack @@ -1041,7 +1041,7 @@ void setup() // Reset the machine correction matrix. // It does not make sense to load the correction matrix until the machine is homed. world2machine_reset(); - + lcd_init(); if (!READ(BTN_ENC)) { @@ -1166,16 +1166,14 @@ void setup() eeprom_update_word((uint16_t*)EEPROM_BABYSTEP_Z, 0); // Show the message. lcd_show_fullscreen_message_and_wait_P(MSG_FOLLOW_CALIBRATION_FLOW); - lcd_update_enable(true); } else if (calibration_status() == CALIBRATION_STATUS_LIVE_ADJUST) { // Show the message. lcd_show_fullscreen_message_and_wait_P(MSG_BABYSTEP_Z_NOT_SET); - lcd_update_enable(true); } else if (calibration_status() == CALIBRATION_STATUS_Z_CALIBRATION) { // Show the message. lcd_show_fullscreen_message_and_wait_P(MSG_FOLLOW_CALIBRATION_FLOW); - lcd_update_enable(true); } + lcd_update_enable(true); // Store the currently running firmware into an eeprom, // so the next time the firmware gets updated, it will know from which version it has been updated. diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 5d062c33e..aa22fe265 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -269,7 +269,6 @@ volatile uint8_t buttons_reprapworld_keypad; // to store the reprapworld_keypad volatile uint8_t slow_buttons;//Contains the bits of the currently pressed buttons. #endif uint8_t currentMenuViewOffset; /* scroll offset in the current menu */ -uint32_t blocking_enc; uint8_t lastEncoderBits; uint32_t encoderPosition; uint32_t savedEncoderPosition; @@ -4276,8 +4275,6 @@ static void lcd_selftest_screen_step(int _row, int _col, int _state, const char static void lcd_quick_feedback() { lcdDrawUpdate = 2; - blocking_enc = millis() + 500; - button_pressed = false; lcd_implementation_quick_feedback(); } @@ -4329,6 +4326,7 @@ static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, #endif//ULTIPANEL /** LCD API **/ + void lcd_init() { lcd_implementation_init(); @@ -4657,7 +4655,7 @@ void lcd_buttons_update() //return to previously active menu and previous encoder position lcd_goto_menu(savedMenu, savedEncoderPosition); } - else { + else { newbutton |= EN_C; } } @@ -4670,7 +4668,7 @@ void lcd_buttons_update() } else { //we are in modal mode if (READ(BTN_ENC) == 0) - newbutton |= EN_C; + newbutton |= EN_C; } #endif diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index 8a796687e..76136ff8f 100644 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -230,7 +230,6 @@ void lcd_farm_sdcard_menu_w(); void lcd_wait_for_cool_down(); void adjust_bed_reset(); void lcd_extr_cal_reset(); -//static void _lcd_move(const char *name, int axis, int min, int max, bool called_from_move_menu = true); union MenuData;