From 690d08a1f93848ee8b467299b5d672d1f69f23c5 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 18 Feb 2011 08:00:36 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2743 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/USB_CDC/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 9868b00ab..49d744d5d 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -271,12 +271,14 @@ static void usb_event(USBDriver *usbp, usbevent_t event) { case USB_EVENT_ADDRESS: return; case USB_EVENT_CONFIGURED: - /* Enables the endpoints specified into the configuration.*/ - chSysLock(); + /* Enables the endpoints specified into the configuration. + Note, this callback is invoked from an ISR so I-Class functions + must be used.*/ + chSysLockFromIsr(); usbInitEndpointI(usbp, DATA_REQUEST_EP, &ep1config); usbInitEndpointI(usbp, INTERRUPT_REQUEST_EP, &ep2config); usbInitEndpointI(usbp, DATA_AVAILABLE_EP, &ep3config); - chSysUnlock(); + chSysUnlockFromIsr(); return; case USB_EVENT_SUSPEND: return; -- cgit v1.2.3