Skip to content

Commit 246a172

Browse files
Merge branch 'master' of https://github.com/geekylou/Arduino_STM32 into geekylou-master
2 parents ba5d405 + 1f13f47 commit 246a172

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

STM32F1/cores/maple/libmaple/usb/stm32f1/usb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void __irq_usb_lp_can_rx0(void) {
210210

211211
#if (USB_ISR_MSK & USB_ISTR_WKUP)
212212
if (istr & USB_ISTR_WKUP & USBLIB->irq_mask) {
213-
USB_BASE->ISTR = ~USB_ISTR_WKUP;
213+
USB_BASE->ISTR = ~(USB_ISTR_WKUP | USB_ISTR_SUSP);
214214
usb_resume(RESUME_EXTERNAL);
215215
}
216216
#endif
@@ -225,7 +225,7 @@ void __irq_usb_lp_can_rx0(void) {
225225
usb_resume(RESUME_LATER);
226226
}
227227
/* clear of the ISTR bit must be done after setting of CNTR_FSUSP */
228-
USB_BASE->ISTR = ~USB_ISTR_SUSP;
228+
USB_BASE->ISTR = ~(USB_ISTR_WKUP | USB_ISTR_SUSP);
229229
}
230230
#endif
231231

STM32F1/cores/maple/usb_serial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ uint8 USBSerial::pending(void) {
204204
}
205205

206206
uint8 USBSerial::isConnected(void) {
207-
return usb_is_connected(USBLIB) && usb_is_configured(USBLIB);
207+
return usb_is_connected(USBLIB) && usb_is_configured(USBLIB) && usb_cdcacm_get_dtr();
208208
}
209209

210210
uint8 USBSerial::getDTR(void) {

0 commit comments

Comments
 (0)