Skip to content

Commit e1bf6d1

Browse files
committed
Merge pull request #1075 from julbouln/master
add suspend callback to STM32F4 USBDevice HAL
2 parents 7244eb8 + 7bb1ea3 commit e1bf6d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libraries/USBDevice/USBDevice/USBHAL_STM32F4.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,13 @@ void USBHAL::_usbisr(void) {
307307

308308

309309
void USBHAL::usbisr(void) {
310+
if (OTG_FS->GREGS.GINTSTS & (1 << 11)) { // USB Suspend
311+
suspendStateChanged(1);
312+
};
313+
310314
if (OTG_FS->GREGS.GINTSTS & (1 << 12)) { // USB Reset
315+
suspendStateChanged(0);
316+
311317
// Set SNAK bits
312318
OTG_FS->OUTEP_REGS[0].DOEPCTL |= (1 << 27);
313319
OTG_FS->OUTEP_REGS[1].DOEPCTL |= (1 << 27);

0 commit comments

Comments
 (0)