Skip to content

Commit 94e90b8

Browse files
committed
audio_player: remove unused event bits
1 parent 8f99947 commit 94e90b8

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

main/inc/core/os.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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

4140
extern EventGroupHandle_t user_event_group;

main/src/user/audio_player.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)