From 12daa97d7ebc2b32558706fe18bfefec6163fa6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?GRENON=20Lo=C3=AFc?= Date: Sun, 22 Mar 2020 23:25:33 +0100 Subject: [PATCH 1/2] Bug fix: Make fastread to work The dummy byte needed for fastread operation need to be sent after the two-bytes address --- src/SPIFramIO.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SPIFramIO.cpp b/src/SPIFramIO.cpp index 859301c..fac927e 100644 --- a/src/SPIFramIO.cpp +++ b/src/SPIFramIO.cpp @@ -161,8 +161,8 @@ case FASTREAD: _nextByte(WRITE, opcode); - _nextByte(WRITE, DUMMYBYTE); _transferAddress(); + _nextByte(WRITE, DUMMYBYTE); break; default: From 83ae1e3ebaa1882d04bbc7eac342dd4d9f0a659e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?GRENON=20Lo=C3=AFc?= Date: Sun, 22 Mar 2020 23:27:56 +0100 Subject: [PATCH 2/2] Bug fix: Make fastread to work Use _beginSPI() instead of _nextByte --- src/SPIFram.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/SPIFram.h b/src/SPIFram.h index ee900f8..cc3ac2b 100644 --- a/src/SPIFram.h +++ b/src/SPIFram.h @@ -336,12 +336,11 @@ template bool SPIFram::_read(uint32_t _addr, T& value, uint32_t _sz, b else { CHIP_SELECT if (fastRead) { - _nextByte(WRITE, FASTREAD); + _beginSPI(WRITE, FASTREAD); } else { - _nextByte(WRITE, READDATA); + _beginSPI(WRITE, READDATA); } - _transferAddress(); for (uint16_t i = 0; i < _sz; i++) { *p++ =_nextByte(READ); }