Add static blocking write function to gui. This allows us to set a updating... status on the display when starting the updater.

This commit is contained in:
Mario Hüttel 2021-05-22 11:34:33 +02:00
parent afadd539c8
commit 708fdea058
4 changed files with 21 additions and 0 deletions

View File

@ -21,6 +21,8 @@
#ifndef _GUI_H_
#define _GUI_H_
#include <stdint.h>
/**
* @brief Handle the reflow controller's LCD Menu
* @return 0 if no delay is requested, 1 if delay is requested
@ -31,4 +33,6 @@ void gui_init(void);
void gui_root_menu_message_set(const char *heading, const char *text);
void gui_lcd_write_direct_blocking(uint8_t line, const char *text);
#endif /* _GUI_H_ */

View File

@ -21,6 +21,8 @@
#ifndef __LCD_H__
#define __LCD_H__
#include <stdint.h>
#define LCD_DPORT (GPIOD)
#define LCD_RCC_MASK RCC_AHB1ENR_GPIODEN
#define LCD_DATA_BIT_OFFSET (8)
@ -48,6 +50,8 @@ void lcd_init(void);
void lcd_string(const char *data);
void lcd_setcursor(uint8_t x, uint8_t y);
void lcd_home(void);
enum lcd_fsm_ret lcd_fsm_write_buffer(const char (*display_buffer)[21]);

View File

@ -162,6 +162,8 @@ static inline void handle_boot_status(void)
led_set(0, 1);
led_set(1, 1);
gui_lcd_write_direct_blocking(0, "Updating...");
start_updater_ram_code();
}

View File

@ -842,3 +842,14 @@ void gui_root_menu_message_set(const char *heading, const char *text)
strcpy(overlay_text, text);
}
}
void gui_lcd_write_direct_blocking(uint8_t line, const char *text)
{
if (!text)
return;
if (line > 3)
return;
lcd_setcursor(0, line);
lcd_string(text);
}