diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-31 19:20:26 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-31 19:20:26 +0000 |
commit | 0c168e13200e69223905946d865fceba15ba830f (patch) | |
tree | 6ab43c61dc2813511ef296f8cb313d1a4a217b07 /nuttx/arch/avr/src/at90usb/at90usb_usbdev.c | |
parent | d1aae41beb05cc207f99d50c93dc9dd1bbd7e774 (diff) | |
download | px4-nuttx-0c168e13200e69223905946d865fceba15ba830f.tar.gz px4-nuttx-0c168e13200e69223905946d865fceba15ba830f.tar.bz2 px4-nuttx-0c168e13200e69223905946d865fceba15ba830f.zip |
Missing calls to class SUSPEND/RESUME methods in all USB drivers
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5590 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/avr/src/at90usb/at90usb_usbdev.c')
-rw-r--r-- | nuttx/arch/avr/src/at90usb/at90usb_usbdev.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/nuttx/arch/avr/src/at90usb/at90usb_usbdev.c b/nuttx/arch/avr/src/at90usb/at90usb_usbdev.c index 89949e662..0e3ac6487 100644 --- a/nuttx/arch/avr/src/at90usb/at90usb_usbdev.c +++ b/nuttx/arch/avr/src/at90usb/at90usb_usbdev.c @@ -1955,6 +1955,15 @@ static inline void avr_gensuspend(void) { usbtrace(TRACE_INTENTRY(AVR_TRACEINTID_SUSPEND), UDIEN); + /* Notify the class driver of the suspend event */ + + if (g_usbdev.driver) + { + CLASS_SUSPEND(g_usbdev.driver, &g_usbdev.usbdev); + } + + /* Disable suspend event interrupts; enable wakeup event interrupt */ + UDIEN &= ~(1 << SUSPE); UDIEN |= (1 << WAKEUPE); @@ -1992,6 +2001,13 @@ static void avr_genwakeup(void) USBCON &= ~(1 << FRZCLK); UDIEN &= ~(1 << WAKEUPE); UDIEN |= (1 << SUSPE); + + /* Notify the class driver of the resume event */ + + if (g_usbdev.driver) + { + CLASS_RESUME(g_usbdev.driver, &g_usbdev.usbdev); + } } /******************************************************************************* |