diff --git a/apps/misc.c b/apps/misc.c index 3d361f4ccb..3a47d2f1c9 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -800,6 +800,7 @@ static void car_adapter_mode_processing(bool inserted) else audio_pause(); } + waiting_to_resume_play = false; } } } @@ -812,7 +813,7 @@ static void car_adapter_tick(void) { if (audio_status() & AUDIO_STATUS_PAUSE) { - audio_resume(); + queue_broadcast(SYS_CAR_ADAPTER_RESUME, 0); } waiting_to_resume_play = false; } @@ -892,6 +893,10 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame case SYS_CHARGER_DISCONNECTED: car_adapter_mode_processing(false); return SYS_CHARGER_DISCONNECTED; + + case SYS_CAR_ADAPTER_RESUME: + audio_resume(); + return SYS_CAR_ADAPTER_RESUME; #endif #ifdef HAVE_HEADPHONE_DETECTION case SYS_PHONE_PLUGGED: diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h index 8d7ca95184..3d70e49a4c 100644 --- a/firmware/export/kernel.h +++ b/firmware/export/kernel.h @@ -70,6 +70,7 @@ #define SYS_REMOTE_PLUGGED MAKE_SYS_EVENT(SYS_EVENT_CLS_PLUG, 4) #define SYS_REMOTE_UNPLUGGED MAKE_SYS_EVENT(SYS_EVENT_CLS_PLUG, 5) #define SYS_SCREENDUMP MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 0) +#define SYS_CAR_ADAPTER_RESUME MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 1) struct event {