Skip to content

Commit c5ab6a9

Browse files
deadprogramaykevl
authored andcommitted
ninafw: use NINA settings from board file in main TinyGo repo
Signed-off-by: deadprogram <ron@hybridgroup.com>
1 parent eb30760 commit c5ab6a9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

adapter_ninafw.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff 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.
3231
var 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
})

0 commit comments

Comments
 (0)