Fix lcd_update() FW crashes

Change in memory:
Flash: +10 bytes
SRAM: 0 bytes
This commit is contained in:
Guðni Már Gilbert 2023-04-14 21:31:12 +00:00
parent 8241be273b
commit 95acdba5fa
4 changed files with 19 additions and 9 deletions

View File

@ -9464,6 +9464,9 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
check_axes_activity();
MMU2::mmu2.mmu_loop();
lcd_knob_update();
backlight_update();
// handle longpress
if(lcd_longpress_trigger)
{

View File

@ -690,11 +690,7 @@ void lcd_quick_feedback(void)
lcd_beeper_quick_feedback();
}
void lcd_update(uint8_t lcdDrawUpdateOverride)
{
if (lcd_draw_update < lcdDrawUpdateOverride)
lcd_draw_update = lcdDrawUpdateOverride;
void lcd_knob_update() {
if (lcd_backlight_wake_trigger) {
lcd_backlight_wake_trigger = false;
backlight_wake();
@ -711,8 +707,12 @@ void lcd_update(uint8_t lcdDrawUpdateOverride)
lcd_draw_update = 1;
}
}
}
backlight_update();
void lcd_update(uint8_t lcdDrawUpdateOverride)
{
if (lcd_draw_update < lcdDrawUpdateOverride)
lcd_draw_update = lcdDrawUpdateOverride;
if (!lcd_update_enabled) return;

View File

@ -123,6 +123,10 @@ extern void lcd_beeper_quick_feedback(void);
//Cause an LCD refresh, and give the user visual or audible feedback that something has happened
extern void lcd_quick_feedback(void);
/// @brief Check whether knob is rotated or clicked and update relevant
///variables. Flags are set by lcd_buttons_update in ISR context.
extern void lcd_knob_update();
extern void lcd_update(uint8_t lcdDrawUpdateOverride);
extern void lcd_update_enable(uint8_t enabled);

View File

@ -2213,7 +2213,8 @@ uint8_t lcd_alright() {
lcd_consume_click();
while (1)
{
delay_keep_alive(0);
manage_heater();
manage_inactivity(true);
if (lcd_encoder)
{
@ -4713,7 +4714,8 @@ uint8_t choose_menu_P(const char *header, const char *item, const char *last_ite
KEEPALIVE_STATE(PAUSED_FOR_USER);
while (1)
{
delay_keep_alive(0);
manage_heater();
manage_inactivity(true);
if (lcd_encoder)
{
@ -4805,7 +4807,8 @@ char reset_menu() {
lcd_puts_at_P(1, i, item[first + i]);
}
delay_keep_alive(0);
manage_heater();
manage_inactivity(true);
if (lcd_encoder) {
if (lcd_encoder < 0) {