diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-02-18 08:00:36 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-02-18 08:00:36 +0000 |
commit | 690d08a1f93848ee8b467299b5d672d1f69f23c5 (patch) | |
tree | 9b9be718923ff4f6d7d297c3965b9fe9bca0168a /testhal/STM32/USB_CDC/main.c | |
parent | 60d8f68906f28d369f35b624e129deee5092c86d (diff) | |
download | ChibiOS-690d08a1f93848ee8b467299b5d672d1f69f23c5.tar.gz ChibiOS-690d08a1f93848ee8b467299b5d672d1f69f23c5.tar.bz2 ChibiOS-690d08a1f93848ee8b467299b5d672d1f69f23c5.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2743 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/USB_CDC/main.c')
-rw-r--r-- | testhal/STM32/USB_CDC/main.c | 8 |
1 files 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;
|