From fbdfdff31c8859222f8facac7f193eb29065fc6a Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Thu, 20 Feb 2014 13:31:28 +0000 Subject: [PATCH] Added use of GET_SHARED_GLOBAL macro rather than direct inline ASM when getting bus-speed in interrupt handler. --- module_usb_audio/usb_buffer/decouple.xc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module_usb_audio/usb_buffer/decouple.xc b/module_usb_audio/usb_buffer/decouple.xc index bace5f67..9f0a2449 100644 --- a/module_usb_audio/usb_buffer/decouple.xc +++ b/module_usb_audio/usb_buffer/decouple.xc @@ -122,9 +122,10 @@ void handle_audio_request(chanend c_mix_out) /* Reply with underflow */ outuint(c_mix_out, outUnderflow); - asm("ldw %0, dp[g_curUsbSpeed]" : "=r" (usb_speed) :); + GET_SHARED_GLOBAL(usb_speed, g_curUsbSpeed); /* slotSize different for Audio Class 1.0/2.0. */ + /* TODO It is quite wasteful to run this check every interrupt. Perhaps on stream start is good enough */ #if defined(AUDIO_CLASS_FALLBACK) || defined (FULL_SPEED_AUDIO_2) if (usb_speed == XUD_SPEED_HS) {