Announce_status plugin make USB plug aware
Announce_status was blocking USB from working it now quits on USB plug Change-Id: I0b7e5e9c1ef118582febd459e706c9b61cf7fe25
This commit is contained in:
parent
10b6707131
commit
03ae4e6019
1 changed files with 13 additions and 3 deletions
|
@ -411,13 +411,15 @@ void thread(void)
|
||||||
interval = gAnnounce.interval * HZ;
|
interval = gAnnounce.interval * HZ;
|
||||||
switch (ev.id)
|
switch (ev.id)
|
||||||
{
|
{
|
||||||
|
case SYS_USB_CONNECTED:
|
||||||
|
rb->usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
||||||
case EV_EXIT:
|
case EV_EXIT:
|
||||||
return;
|
return;
|
||||||
case EV_OTHINSTANCE:
|
case EV_OTHINSTANCE:
|
||||||
if (*rb->current_tick - last_tick >= interval)
|
if (*rb->current_tick - last_tick >= interval)
|
||||||
{
|
{
|
||||||
last_tick += interval;
|
last_tick += interval;
|
||||||
rb->sleep(0);
|
rb->sleep(HZ / 10);
|
||||||
announce();
|
announce();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -425,7 +427,7 @@ void thread(void)
|
||||||
rb->beep_play(1500, 100, 1000);
|
rb->beep_play(1500, 100, 1000);
|
||||||
break;
|
break;
|
||||||
case EV_TRACKCHANGE:
|
case EV_TRACKCHANGE:
|
||||||
rb->sleep(0);
|
rb->sleep(HZ / 10);
|
||||||
announce();
|
announce();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -509,7 +511,7 @@ int plugin_main(const void* parameter)
|
||||||
gAnnounce.index = 0;
|
gAnnounce.index = 0;
|
||||||
gAnnounce.timeout = 0;
|
gAnnounce.timeout = 0;
|
||||||
|
|
||||||
rb->talk_id(LANG_HOLD_FOR_SETTINGS, false);
|
|
||||||
rb->splash(HZ / 2, "Announce Status");
|
rb->splash(HZ / 2, "Announce Status");
|
||||||
|
|
||||||
if (configfile_load(CFG_FILE, config, gCfg_sz, CFG_VER) < 0)
|
if (configfile_load(CFG_FILE, config, gCfg_sz, CFG_VER) < 0)
|
||||||
|
@ -518,6 +520,14 @@ int plugin_main(const void* parameter)
|
||||||
config_set_defaults();
|
config_set_defaults();
|
||||||
configfile_save(CFG_FILE, config, gCfg_sz, CFG_VER);
|
configfile_save(CFG_FILE, config, gCfg_sz, CFG_VER);
|
||||||
|
|
||||||
|
if (rb->mixer_channel_status(PCM_MIXER_CHAN_PLAYBACK) == CHANNEL_PLAYING)
|
||||||
|
{
|
||||||
|
while (rb->mixer_channel_get_bytes_waiting(PCM_MIXER_CHAN_PLAYBACK) > 0)
|
||||||
|
rb->sleep(HZ / 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
rb->talk_id(LANG_HOLD_FOR_SETTINGS, false);
|
||||||
|
|
||||||
rb->splash(HZ, ID2P(LANG_HOLD_FOR_SETTINGS));
|
rb->splash(HZ, ID2P(LANG_HOLD_FOR_SETTINGS));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue