boot cfg: Allow Launching UMS from boot.

By using `BOOT_CFG_AUTOBOOT_EN` in `boot_cfg` and `EXTRA_CFG_NYX_UMS` in `extra_cfg` you can launch UMS from boot.

The `ums` variable must be populated with one of the following:

```
NYX_UMS_SD_CARD      0
NYX_UMS_EMMC_BOOT0   1
NYX_UMS_EMMC_BOOT1   2
NYX_UMS_EMMC_GPP     3
NYX_UMS_EMUMMC_BOOT0 4
NYX_UMS_EMUMMC_BOOT1 5
NYX_UMS_EMUMMC_GPP   6
```
This commit is contained in:
CTCaer
2020-04-30 14:44:27 +03:00
parent ac4bf9cf2c
commit abcb1dec46
8 changed files with 90 additions and 7 deletions

View File

@@ -592,6 +592,43 @@ static lv_res_t _action_ums_emuemmc_gpp(lv_obj_t *btn)
return LV_RES_OK;
}
void nyx_run_ums(void *param)
{
u32 *cfg = (u32 *)param;
u8 type = (*cfg) >> 24;
*cfg = *cfg & 0xFFFFFF;
// Disable read only flag.
usb_msc_emmc_read_only = false;
switch (type)
{
case NYX_UMS_SD_CARD:
action_ums_sd(NULL);
break;
case NYX_UMS_EMMC_BOOT0:
_action_ums_emmc_boot0(NULL);
break;
case NYX_UMS_EMMC_BOOT1:
_action_ums_emmc_boot1(NULL);
break;
case NYX_UMS_EMMC_GPP:
_action_ums_emmc_gpp(NULL);
break;
case NYX_UMS_EMUMMC_BOOT0:
_action_ums_emuemmc_boot0(NULL);
break;
case NYX_UMS_EMUMMC_BOOT1:
_action_ums_emuemmc_boot1(NULL);
break;
case NYX_UMS_EMUMMC_GPP:
_action_ums_emuemmc_gpp(NULL);
break;
}
}
static lv_res_t _emmc_read_only_toggle(lv_obj_t *btn)
{
nyx_generic_onoff_toggle(btn);