Skip to content

Commit 6d1044c

Browse files
committed
Show empty battery symbol in order to entice user to connect power.
1 parent cec317a commit 6d1044c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/Braccio.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ bool BraccioClass::begin(voidFuncPtr customMenu) {
127127

128128
splashScreen();
129129

130+
{
131+
lv_style_set_text_font(&_lv_style, &lv_font_montserrat_48);
132+
lv_obj_t * label1 = lv_label_create(lv_scr_act());
133+
lv_obj_add_style(label1, &_lv_style, 0);
134+
lv_label_set_text(label1, LV_SYMBOL_BATTERY_EMPTY);
135+
lv_obj_set_align(label1, LV_ALIGN_CENTER);
136+
lv_obj_set_pos(label1, 0, 0);
137+
}
138+
130139
for(auto const now = millis();
131140
((millis() - now) < 5000) && !PD_UFP.is_PPS_ready();)
132141
{
@@ -137,6 +146,8 @@ bool BraccioClass::begin(voidFuncPtr customMenu) {
137146
i2c_mutex.unlock();
138147
}
139148

149+
lv_obj_clean(lv_scr_act());
150+
140151
if (!PD_UFP.is_PPS_ready())
141152
{
142153
lv_style_set_text_font(&_lv_style, &lv_font_montserrat_32);

src/lv_conf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
282282
#define LV_FONT_MONTSERRAT_42 0
283283
#define LV_FONT_MONTSERRAT_44 0
284284
#define LV_FONT_MONTSERRAT_46 0
285-
#define LV_FONT_MONTSERRAT_48 0
285+
#define LV_FONT_MONTSERRAT_48 1
286286

287287
/*Demonstrate special features*/
288288
#define LV_FONT_MONTSERRAT_12_SUBPX 0

0 commit comments

Comments
 (0)