summaryrefslogtreecommitdiff
path: root/apps/voice_thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/voice_thread.c')
-rw-r--r--apps/voice_thread.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/apps/voice_thread.c b/apps/voice_thread.c
index 5a3ad46801..2f216cde9d 100644
--- a/apps/voice_thread.c
+++ b/apps/voice_thread.c
@@ -217,9 +217,6 @@ void mp3_play_data(const unsigned char* start, int size,
217/* Stop current voice clip from playing */ 217/* Stop current voice clip from playing */
218void mp3_play_stop(void) 218void mp3_play_stop(void)
219{ 219{
220 if(!audio_is_thread_ready())
221 return;
222
223 LOGFQUEUE("mp3 >| voice Q_VOICE_STOP"); 220 LOGFQUEUE("mp3 >| voice Q_VOICE_STOP");
224 queue_send(&voice_queue, Q_VOICE_STOP, 0); 221 queue_send(&voice_queue, Q_VOICE_STOP, 0);
225} 222}
@@ -419,12 +416,6 @@ static void NORETURN_ATTR voice_thread(void)
419 416
420 voice_data_init(&td); 417 voice_data_init(&td);
421 418
422 /* audio thread will only set this once after it finished the final
423 * audio hardware init so this little construct is safe - even
424 * cross-core. */
425 while (!audio_is_thread_ready())
426 sleep(0);
427
428 while (1) 419 while (1)
429 { 420 {
430 switch (state) 421 switch (state)
@@ -449,18 +440,11 @@ void voice_thread_init(void)
449 queue_init(&voice_queue, false); 440 queue_init(&voice_queue, false);
450 441
451 voice_thread_id = create_thread(voice_thread, voice_stack, 442 voice_thread_id = create_thread(voice_thread, voice_stack,
452 sizeof(voice_stack), CREATE_THREAD_FROZEN, 443 sizeof(voice_stack), 0, voice_thread_name
453 voice_thread_name IF_PRIO(, PRIORITY_VOICE) IF_COP(, CPU)); 444 IF_PRIO(, PRIORITY_VOICE) IF_COP(, CPU));
454 445
455 queue_enable_queue_send(&voice_queue, &voice_queue_sender_list, 446 queue_enable_queue_send(&voice_queue, &voice_queue_sender_list,
456 voice_thread_id); 447 voice_thread_id);
457} /* voice_thread_init */
458
459/* Unfreeze the voice thread */
460void voice_thread_resume(void)
461{
462 logf("Thawing voice thread");
463 thread_thaw(voice_thread_id);
464} 448}
465 449
466#ifdef HAVE_PRIORITY_SCHEDULING 450#ifdef HAVE_PRIORITY_SCHEDULING