Browse Source

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

Marek Bel 5 năm trước cách đây
mục cha
commit
6ee97468ee
2 tập tin đã thay đổi với 0 bổ sung6 xóa
  1. 0 5
      Firmware/lcd.cpp
  2. 0 1
      Firmware/ultralcd.cpp

+ 0 - 5
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;
 }
 
 

+ 0 - 1
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;
 }