Skip to content

Commit 18f96fc

Browse files
committed
Bug fix for v 1.2.2
1 parent 00f7588 commit 18f96fc

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

SPIFlash.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,14 @@ uint32_t SPIFlash::getID(void) {
257257
// 1. page --> Any page number from 0 to 4095
258258
// 2. offset --> Any offset within the page - from 0 to 255
259259
uint8_t SPIFlash::readByte(uint16_t page_number, uint8_t offset) {
260-
if(!_notBusy() || page_number >= 4096 || offset >= 256) {
261-
uint32_t address = _getAddress(page_number, offset);
262-
_beginRead(address);
263-
uint8_t var = _readNextByte();
264-
_endProcess();
265-
return var;
266-
}
260+
if(!_notBusy() || page_number >= 4096 || offset >= 256)
261+
return false;
262+
263+
uint32_t address = _getAddress(page_number, offset);
264+
_beginRead(address);
265+
uint8_t var = _readNextByte();
266+
_endProcess();
267+
return var;
267268
}
268269

269270
// Reads an array of bytes starting from a specific location in a page. Takes three arguments -

0 commit comments

Comments
 (0)