diff options
-rw-r--r-- | apps/playback.c | 8 | ||||
-rw-r--r-- | firmware/kernel.c | 20 | ||||
-rw-r--r-- | firmware/pcm_record.c | 7 | ||||
-rw-r--r-- | uisimulator/sdl/kernel.c | 16 |
4 files changed, 36 insertions, 15 deletions
diff --git a/apps/playback.c b/apps/playback.c index 9bdcbac213..c58c5a6bf2 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -3598,8 +3598,6 @@ static void audio_thread(void) while (1) { - intptr_t result = 0; - if (filling) { queue_wait_w_tmo(&audio_queue, &ev, 0); @@ -3685,12 +3683,12 @@ static void audio_thread(void) case Q_AUDIO_REBUFFER_SEEK: LOGFQUEUE("audio < Q_AUDIO_REBUFFER_SEEK"); - result = audio_rebuffer_and_seek(ev.data); + queue_reply(&audio_queue, audio_rebuffer_and_seek(ev.data)); break; case Q_AUDIO_CHECK_NEW_TRACK: LOGFQUEUE("audio < Q_AUDIO_CHECK_NEW_TRACK"); - result = audio_check_new_track(); + queue_reply(&audio_queue, audio_check_new_track()); break; case Q_AUDIO_DIR_SKIP: @@ -3729,8 +3727,6 @@ static void audio_thread(void) default: LOGFQUEUE("audio < default"); } /* end switch */ - - queue_reply(&audio_queue, result); } /* end while */ } diff --git a/firmware/kernel.c b/firmware/kernel.c index 77b0c6ffef..03be6db624 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c @@ -38,8 +38,6 @@ void (*tick_funcs[MAX_NUM_TICK_TASKS])(void); static struct event_queue *all_queues[32] NOCACHEBSS_ATTR; static int num_queues NOCACHEBSS_ATTR; -void queue_wait(struct event_queue *q, struct event *ev) ICODE_ATTR; - /**************************************************************************** * Standard kernel stuff ****************************************************************************/ @@ -234,7 +232,15 @@ void queue_wait(struct event_queue *q, struct event *ev) int oldlevel; unsigned int rd; - oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); + oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); + +#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME + if(q->send && q->send->curr_sender) + { + /* auto-reply */ + queue_release_sender(&q->send->curr_sender, 0); + } +#endif if (q->read == q->write) { @@ -259,6 +265,14 @@ void queue_wait(struct event_queue *q, struct event *ev) void queue_wait_w_tmo(struct event_queue *q, struct event *ev, int ticks) { int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); + +#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME + if (q->send && q->send->curr_sender) + { + /* auto-reply */ + queue_release_sender(&q->send->curr_sender, 0); + } +#endif if (q->read == q->write && ticks > 0) { diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c index f3cb21e491..a5d0e51c30 100644 --- a/firmware/pcm_record.c +++ b/firmware/pcm_record.c @@ -1358,7 +1358,6 @@ static void pcmrec_stop(void) if (is_recording) { dma_lock = true; /* lock dma write position */ - queue_reply(&pcmrec_queue, 0); /* flush all available data first to avoid overflow while waiting for encoding to finish */ @@ -1519,15 +1518,11 @@ static void pcmrec_thread(void) if (is_recording) break; pcmrec_close(); - /* Be sure other threads are released if waiting */ - queue_clear(&pcmrec_queue); - flush_interrupts = 0; usb_acknowledge(SYS_USB_CONNECTED_ACK); usb_wait_for_disconnect(&pcmrec_queue); + flush_interrupts = 0; break; } /* end switch */ - - queue_reply(&pcmrec_queue, 0); } /* end while */ } /* pcmrec_thread */ diff --git a/uisimulator/sdl/kernel.c b/uisimulator/sdl/kernel.c index ff6c94933b..e2aa0d31c4 100644 --- a/uisimulator/sdl/kernel.c +++ b/uisimulator/sdl/kernel.c @@ -159,6 +159,14 @@ void queue_wait(struct event_queue *q, struct event *ev) { unsigned int rd; +#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME + if (q->send && q->send->curr_sender) + { + /* auto-reply */ + queue_release_sender(&q->send->curr_sender, 0); + } +#endif + if (q->read == q->write) { block_thread(&q->thread); @@ -178,6 +186,14 @@ void queue_wait(struct event_queue *q, struct event *ev) void queue_wait_w_tmo(struct event_queue *q, struct event *ev, int ticks) { +#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME + if (q->send && q->send->curr_sender) + { + /* auto-reply */ + queue_release_sender(&q->send->curr_sender, 0); + } +#endif + if (q->read == q->write && ticks > 0) { block_thread_w_tmo(&q->thread, ticks); |