@@ -58,7 +58,7 @@ func (usbcdc *USBCDC) Flush() error {
58
58
usbcdc .TxIdx .Set (usbcdcTxBank1st )
59
59
}
60
60
61
- UART0 .sent = true
61
+ USB .sent = true
62
62
}
63
63
}
64
64
return nil
@@ -72,35 +72,35 @@ func (usbcdc USBCDC) WriteByte(c byte) error {
72
72
for {
73
73
mask := interrupt .Disable ()
74
74
75
- idx := UART0 .TxIdx .Get ()
75
+ idx := USB .TxIdx .Get ()
76
76
if (idx & usbcdcTxSizeMask ) < usbcdcTxSizeMask {
77
77
udd_ep_in_cache_buffer [usb_CDC_ENDPOINT_IN ][idx ] = c
78
- UART0 .TxIdx .Set (idx + 1 )
78
+ USB .TxIdx .Set (idx + 1 )
79
79
ok = true
80
80
}
81
81
82
82
interrupt .Restore (mask )
83
83
84
84
if ok {
85
85
break
86
- } else if usbcdcTxMaxRetriesAllowed < UART0 .waitTxcRetryCount {
86
+ } else if usbcdcTxMaxRetriesAllowed < USB .waitTxcRetryCount {
87
87
mask := interrupt .Disable ()
88
- UART0 .waitTxc = false
89
- UART0 .waitTxcRetryCount = 0
90
- UART0 .TxIdx .Set (0 )
88
+ USB .waitTxc = false
89
+ USB .waitTxcRetryCount = 0
90
+ USB .TxIdx .Set (0 )
91
91
usbLineInfo .lineState = 0
92
92
interrupt .Restore (mask )
93
93
break
94
94
} else {
95
95
mask := interrupt .Disable ()
96
- if UART0 .sent {
97
- if UART0 .waitTxc {
96
+ if USB .sent {
97
+ if USB .waitTxc {
98
98
if ! easyDMABusy .HasBits (1 ) {
99
- UART0 .waitTxc = false
100
- UART0 .Flush ()
99
+ USB .waitTxc = false
100
+ USB .Flush ()
101
101
}
102
102
} else {
103
- UART0 .Flush ()
103
+ USB .Flush ()
104
104
}
105
105
}
106
106
interrupt .Restore (mask )
@@ -198,7 +198,7 @@ func (usbcdc *USBCDC) Configure(config UARTConfig) {
198
198
func (usbcdc * USBCDC ) handleInterrupt (interrupt.Interrupt ) {
199
199
if nrf .USBD .EVENTS_SOF .Get () == 1 {
200
200
nrf .USBD .EVENTS_SOF .Set (0 )
201
- UART0 .Flush ()
201
+ USB .Flush ()
202
202
}
203
203
204
204
// USBD ready event
@@ -291,7 +291,7 @@ func (usbcdc *USBCDC) handleInterrupt(interrupt.Interrupt) {
291
291
}
292
292
case usb_CDC_ENDPOINT_IN : //, usb_CDC_ENDPOINT_ACM:
293
293
if inDataDone {
294
- UART0 .waitTxc = false
294
+ USB .waitTxc = false
295
295
exitCriticalSection ()
296
296
}
297
297
}
0 commit comments