File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ typedef enum user_event_group_bits {
3535
3636 AUDIO_PLAYER_RUN_BIT = BIT13 ,
3737 AUDIO_PLAYER_IDLE_BIT = BIT14 ,
38- AUDIO_PLAYER_EXIT_BIT = BIT15 ,
3938} user_event_group_bits_t ;
4039
4140extern EventGroupHandle_t user_event_group ;
Original file line number Diff line number Diff line change @@ -54,9 +54,9 @@ static void audio_player_task(void *pvParameters)
5454 while (1 ) {
5555 xEventGroupWaitBits (
5656 user_event_group ,
57- AUDIO_PLAYER_RUN_BIT | AUDIO_PLAYER_EXIT_BIT ,
58- pdFALSE ,
57+ AUDIO_PLAYER_RUN_BIT | AUDIO_RENDER_CLR_BIT ,
5958 pdFALSE ,
59+ pdTRUE ,
6060 portMAX_DELAY
6161 );
6262
@@ -128,25 +128,16 @@ void audio_player_play_file(uint8_t idx)
128128 if (mp3_file_ptr [idx ][0 ] == NULL || mp3_file_ptr [idx ][1 ] == NULL ) {
129129 return ;
130130 }
131+
131132 mp3_file_index = idx ;
133+
132134 EventBits_t uxBits = xEventGroupGetBits (user_event_group );
133- if (uxBits & AUDIO_PLAYER_EXIT_BIT ) {
134- return ;
135- }
136135 if (uxBits & AUDIO_PLAYER_RUN_BIT ) {
137- // previous playback is still not complete
138136 playback_pending = 1 ;
139137 } else {
140138 xEventGroupClearBits (user_event_group , AUDIO_PLAYER_IDLE_BIT );
141139 xEventGroupSetBits (user_event_group , AUDIO_PLAYER_RUN_BIT );
142140 }
143- xEventGroupWaitBits (
144- user_event_group ,
145- AUDIO_RENDER_CLR_BIT ,
146- pdFALSE ,
147- pdFALSE ,
148- portMAX_DELAY
149- );
150141#endif
151142}
152143
You can’t perform that action at this time.
0 commit comments