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.).

This commit is contained in:
Marek Bel 2018-09-18 10:17:09 +02:00
parent f532da4b17
commit 6ee97468ee
2 changed files with 0 additions and 6 deletions

View file

@ -730,7 +730,6 @@ void lcd_update(uint8_t lcdDrawUpdateOverride)
lcd_draw_update = lcdDrawUpdateOverride; lcd_draw_update = lcdDrawUpdateOverride;
if (!lcd_update_enabled) if (!lcd_update_enabled)
return; return;
lcd_buttons_update();
if (lcd_lcdupdate_func) if (lcd_lcdupdate_func)
lcd_lcdupdate_func(); lcd_lcdupdate_func();
} }
@ -764,9 +763,6 @@ void lcd_update_enable(uint8_t enabled)
extern LongTimer safetyTimer; extern LongTimer safetyTimer;
void lcd_buttons_update(void) void lcd_buttons_update(void)
{ {
static bool _lock = false;
if (_lock) return;
_lock = true;
uint8_t newbutton = 0; uint8_t newbutton = 0;
if (READ(BTN_EN1) == 0) newbutton |= EN_A; if (READ(BTN_EN1) == 0) newbutton |= EN_A;
if (READ(BTN_EN2) == 0) newbutton |= EN_B; if (READ(BTN_EN2) == 0) newbutton |= EN_B;
@ -843,7 +839,6 @@ void lcd_buttons_update(void)
} }
} }
lcd_encoder_bits = enc; lcd_encoder_bits = enc;
_lock = false;
} }

View file

@ -7106,7 +7106,6 @@ void ultralcd_init()
WRITE(SDCARDDETECT, HIGH); WRITE(SDCARDDETECT, HIGH);
lcd_oldcardstatus = IS_SD_INSERTED; lcd_oldcardstatus = IS_SD_INSERTED;
#endif//(SDCARDDETECT > 0) #endif//(SDCARDDETECT > 0)
lcd_buttons_update();
lcd_encoder_diff = 0; lcd_encoder_diff = 0;
} }