nyx: do not allow joycon pairing info dump on Hoag

This commit is contained in:
CTCaer 2022-05-16 13:12:45 +03:00
parent 1649d446cd
commit 796207a41b

View file

@ -777,12 +777,13 @@ static lv_res_t _joycon_info_dump_action(lv_obj_t * btn)
int error; int error;
bool is_l_hos = false; bool is_l_hos = false;
bool is_r_hos = false; bool is_r_hos = false;
bool nx_hoag = fuse_read_hw_type() == FUSE_NX_HW_TYPE_HOAG;
jc_gamepad_rpt_t *jc_pad = jc_get_bt_pairing_info(&is_l_hos, &is_r_hos); jc_gamepad_rpt_t *jc_pad = jc_get_bt_pairing_info(&is_l_hos, &is_r_hos);
char *data = (char *)malloc(SZ_16K); char *data = (char *)malloc(SZ_16K);
char *txt_buf = (char *)malloc(SZ_4K); char *txt_buf = (char *)malloc(SZ_4K);
if (!jc_pad) if (!jc_pad || nx_hoag)
{ {
error = 255; error = 255;
goto disabled; goto disabled;
@ -891,7 +892,12 @@ disabled:;
"#FFDD00 and that you paired them in HOS!#"); "#FFDD00 and that you paired them in HOS!#");
} }
else else
s_printf(txt_buf, "#FFDD00 Failed to dump Joy-Con pairing info!#\n#FFDD00 Error: %d#", error); {
if (!nx_hoag)
s_printf(txt_buf, "#FFDD00 Failed to dump Joy-Con pairing info!#\n#FFDD00 Error: %d#", error);
else
s_printf(txt_buf, "#FFDD00 Not supported on Switch Lite!#\n");
}
lv_mbox_set_text(mbox, txt_buf); lv_mbox_set_text(mbox, txt_buf);