mirror of
https://github.com/CTCaer/hekate
synced 2024-12-22 03:11:16 +00:00
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:
parent
4d91d2baff
commit
b0fe84070f
2 changed files with 5 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -946,6 +946,7 @@ static lv_res_t _create_window_fuses_info_status(lv_obj_t *btn)
|
|||
panel_ic_paired = touch_panel->idx == 0; // NISSHA NFT-K12D.
|
||||
break;
|
||||
case 0x98000004: // New 6.2" panel?
|
||||
case 0x50000001:
|
||||
strcat(txt_buf, "FST2 UNK");
|
||||
if (touch_panel)
|
||||
panel_ic_paired = touch_panel->idx == 0;
|
||||
|
|
Loading…
Reference in a new issue