summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c b/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c
index ed7dab1572..01acc6905e 100644
--- a/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c
+++ b/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c
@@ -818,7 +818,19 @@ void avr_thread(void)
818 818
819 while (1) 819 while (1)
820 { 820 {
821 queue_wait(&avr_queue, &ev); 821 if (avr_state_changed())
822 {
823 /* We have to read AVR state, simply check if there's any event
824 * pending but do not block. It is possible that AVR interrupt
825 * line is held active even though we read the state (change
826 * occured during read).
827 */
828 queue_wait_w_tmo(&avr_queue, &ev, 0);
829 }
830 else
831 {
832 queue_wait(&avr_queue, &ev);
833 }
822 834
823 if (ev.id == SYS_USB_CONNECTED) 835 if (ev.id == SYS_USB_CONNECTED)
824 { 836 {