From 255c639ad43d17661e93ff25b201594239d35c13 Mon Sep 17 00:00:00 2001 From: Scott Feldman Date: Wed, 17 May 2023 09:59:54 -0700 Subject: [PATCH] wifinina: add ResetIsHigh cfg switch for MKR 1010 (copied from #561) --- wifinina/wifinina.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wifinina/wifinina.go b/wifinina/wifinina.go index afd5c6aaa..1b08a9b65 100644 --- a/wifinina/wifinina.go +++ b/wifinina/wifinina.go @@ -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. @@ -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()