Skip to content

Commit

Permalink
wifinina: add ResetIsHigh cfg switch for MKR 1010 (copied from #561)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottfeldman authored and deadprogram committed Dec 6, 2023
1 parent 276feec commit 255c639
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions wifinina/wifinina.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ type Config struct {
Ack machine.Pin
Gpio0 machine.Pin
Resetn machine.Pin
// ResetIsHigh controls if the RESET signal to the processor should be
// High or Low (the default). Set this to true for boards such as the
// Arduino MKR 1010, where the reset signal needs to go high instead of
// low.
ResetIsHigh bool

// Retries is how many attempts to connect before returning with a
// "Connect failed" error. Zero means infinite retries.
Expand Down Expand Up @@ -354,9 +359,9 @@ func (w *wifinina) start() {

w.gpio0.High()
w.cs.High()
w.resetn.Low()
w.resetn.Set(w.cfg.ResetIsHigh)
time.Sleep(10 * time.Millisecond)
w.resetn.High()
w.resetn.Set(!w.cfg.ResetIsHigh)
time.Sleep(750 * time.Millisecond)

w.gpio0.Low()
Expand Down

0 comments on commit 255c639

Please sign in to comment.