File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ type Adapter struct {
1919 isDefault bool
2020 scanning bool
2121
22- reset func ()
2322 connectHandler func (device Address , connected bool )
2423
2524 connectedDevices []* Device
@@ -31,7 +30,6 @@ type Adapter struct {
3130// Make sure to call Enable() before using it to initialize the adapter.
3231var DefaultAdapter = & Adapter {
3332 isDefault : true ,
34- reset : resetNINAInverted ,
3533 connectHandler : func (device Address , connected bool ) {
3634 return
3735 },
@@ -45,14 +43,19 @@ func (a *Adapter) Enable() error {
4543 machine .NINA_CS .Configure (machine.PinConfig {Mode : machine .PinOutput })
4644 machine .NINA_RESETN .Configure (machine.PinConfig {Mode : machine .PinOutput })
4745 machine .NINA_CS .Low ()
48- a .reset ()
46+
47+ if machine .NINA_RESET_INVERTED {
48+ resetNINAInverted ()
49+ } else {
50+ resetNINA ()
51+ }
4952
5053 // serial port for nina chip
5154 uart := machine .UART1
5255 uart .Configure (machine.UARTConfig {
5356 TX : machine .NINA_TX ,
5457 RX : machine .NINA_RX ,
55- BaudRate : 115200 ,
58+ BaudRate : machine . NINA_BAUDRATE ,
5659 CTS : machine .NINA_CTS ,
5760 RTS : machine .NINA_RTS ,
5861 })
You can’t perform that action at this time.
0 commit comments