nyx: add new touch panel fw info

Additionally, do not alloc/free heap every time status bar update must run
This commit is contained in:
CTCaer
2021-10-26 10:55:11 +03:00
parent 4d91d2baff
commit b0fe84070f
2 changed files with 5 additions and 3 deletions

View File

@@ -1209,7 +1209,7 @@ static void _create_tab_about(lv_theme_t * th, lv_obj_t * parent)
static void _update_status_bar(void *params)
{
char *label = (char *)malloc(128);
static char *label = NULL;
u16 soc_temp = 0;
u32 batt_percent = 0;
@@ -1240,6 +1240,9 @@ static void _update_status_bar(void *params)
else if (soc_temp_dec < 40)
set_fan_duty(0);
if (!label)
label = (char *)malloc(512);
// Set time and SoC temperature.
s_printf(label, "%02d:%02d "SYMBOL_DOT" "SYMBOL_TEMPERATURE" %02d.%d",
time.hour, time.min, soc_temp_dec, (soc_temp & 0xFF) / 10);
@@ -1283,8 +1286,6 @@ static void _update_status_bar(void *params)
lv_label_set_text(status_bar.battery_more, label);
lv_obj_realign(status_bar.battery_more);
free(label);
}
static lv_res_t _create_mbox_payloads(lv_obj_t *btn)