From 6ee97468ee461046dd13090c27fb23077365fcaf Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Tue, 18 Sep 2018 10:17:09 +0200 Subject: [PATCH] Remove lcd_buttons_update() call from all other places than interrupt. There is no known reason, why lcd_buttons_update() should be called from multiple places and multiple contexts. Remove mutex, which is not needed anymore, and wasn't implemented properly anyway (Operation was not atomic.). --- Firmware/lcd.cpp | 5 ----- Firmware/ultralcd.cpp | 1 - 2 files changed, 6 deletions(-) diff --git a/Firmware/lcd.cpp b/Firmware/lcd.cpp index 7cd67fe3..31c7183e 100644 --- a/Firmware/lcd.cpp +++ b/Firmware/lcd.cpp @@ -730,7 +730,6 @@ void lcd_update(uint8_t lcdDrawUpdateOverride) lcd_draw_update = lcdDrawUpdateOverride; if (!lcd_update_enabled) return; - lcd_buttons_update(); if (lcd_lcdupdate_func) lcd_lcdupdate_func(); } @@ -764,9 +763,6 @@ void lcd_update_enable(uint8_t enabled) extern LongTimer safetyTimer; void lcd_buttons_update(void) { - static bool _lock = false; - if (_lock) return; - _lock = true; uint8_t newbutton = 0; if (READ(BTN_EN1) == 0) newbutton |= EN_A; if (READ(BTN_EN2) == 0) newbutton |= EN_B; @@ -843,7 +839,6 @@ void lcd_buttons_update(void) } } lcd_encoder_bits = enc; - _lock = false; } diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index edadda67..35426147 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -7106,7 +7106,6 @@ void ultralcd_init() WRITE(SDCARDDETECT, HIGH); lcd_oldcardstatus = IS_SD_INSERTED; #endif//(SDCARDDETECT > 0) - lcd_buttons_update(); lcd_encoder_diff = 0; }