From 1dac7f7232bf851b59848c98203d02bbb1e213bc Mon Sep 17 00:00:00 2001 From: Sean Taylor Date: Thu, 7 Sep 2023 19:02:56 -0400 Subject: [PATCH] Return on io error to prevent misleading error message Previously an io error would result in the response: "notecard is running firmware that is too old to use sideload" --- notecard/dfu.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/notecard/dfu.go b/notecard/dfu.go index f83dacc..9bc253c 100644 --- a/notecard/dfu.go +++ b/notecard/dfu.go @@ -26,6 +26,10 @@ func dfuSideload(filename string, verbose bool) (err error) { binaryMax := 0 var rsp notecard.Request rsp, err = card.TransactionRequest(notecard.Request{Req: "card.binary"}) + if note.ErrorContains(err, note.ErrCardIo) { + return err + } + if err == nil { // Get the maximum size that the notecard can handle