atsamd21, atsamd51, nrf52840: unify usbcdc code

This commit is contained in:
sago35
2021-03-24 08:32:40 +09:00
committed by Ron Evans
parent b44d41d9ec
commit 8d93b9e545
3 changed files with 8 additions and 15 deletions
+2 -1
View File
@@ -65,7 +65,7 @@ func (usbcdc *USBCDC) Flush() error {
}
// WriteByte writes a byte of data to the USB CDC interface.
func (usbcdc USBCDC) WriteByte(c byte) error {
func (usbcdc *USBCDC) WriteByte(c byte) error {
// Supposedly to handle problem with Windows USB serial ports?
if usbLineInfo.lineState > 0 {
ok := false
@@ -199,6 +199,7 @@ func (usbcdc *USBCDC) handleInterrupt(interrupt.Interrupt) {
if nrf.USBD.EVENTS_SOF.Get() == 1 {
nrf.USBD.EVENTS_SOF.Set(0)
USB.Flush()
// if you want to blink LED showing traffic, this would be the place...
}
// USBD ready event