Skip to content

Commit

Permalink
Added note about turning on SFDP discovery in SPIMemory.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Marzogh committed May 21, 2018
1 parent 70f6f57 commit 8520d2b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 25 deletions.
38 changes: 19 additions & 19 deletions examples/FlashDiagnostics/Diagnostics_functions.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void printTab(uint8_t _times) {
}

void printTime(uint32_t _wTime, uint32_t _rTime) {
printTab(2);
printTab(2);
if (_rTime != 0) {
printTimer(_wTime);
printTab(3);
Expand Down Expand Up @@ -118,7 +118,7 @@ bool getID() {
Serial.print("Max Pages: ");
Serial.println(flash.getMaxPage());
printUniqueID();

}
return true;
}
Expand Down Expand Up @@ -150,7 +150,7 @@ void byteTest() {
pass(FALSE);
}
printTime(wTime, rTime);

}

void charTest() {
Expand Down Expand Up @@ -179,7 +179,7 @@ void charTest() {
pass(FALSE);
}
printTime(wTime, rTime);

}

void wordTest() {
Expand Down Expand Up @@ -208,7 +208,7 @@ void wordTest() {
pass(FALSE);
}
printTime(wTime, rTime);

}

void shortTest() {
Expand Down Expand Up @@ -237,7 +237,7 @@ void shortTest() {
pass(FALSE);
}
printTime(wTime, rTime);

}

void uLongTest() {
Expand Down Expand Up @@ -266,7 +266,7 @@ void uLongTest() {
pass(FALSE);
}
printTime(wTime, rTime);

}

void longTest() {
Expand Down Expand Up @@ -295,7 +295,7 @@ void longTest() {
pass(FALSE);
}
printTime(wTime, rTime);

}

void floatTest() {
Expand Down Expand Up @@ -324,7 +324,7 @@ void floatTest() {
pass(FALSE);
}
printTime(wTime, rTime);

}

void stringTest() {
Expand Down Expand Up @@ -353,7 +353,7 @@ void stringTest() {
pass(FALSE);
}
printTime(wTime, rTime);

}

void structTest() {
Expand Down Expand Up @@ -402,7 +402,7 @@ void structTest() {
pass(FALSE);
}
printTime(wTime, rTime);

}

void arrayTest() {
Expand Down Expand Up @@ -436,7 +436,7 @@ void arrayTest() {
}
pass(TRUE);
printTime(wTime, rTime);

}

void powerDownTest() {
Expand All @@ -454,7 +454,7 @@ void powerDownTest() {
printTab(2);
Serial.print("Not all chips support power down. Check your datasheet.");
}

}

void powerUpTest() {
Expand All @@ -470,7 +470,7 @@ void powerUpTest() {
else {
pass(FALSE);
}

}

void eraseSectorTest() {
Expand All @@ -487,7 +487,7 @@ void eraseSectorTest() {
else {
pass(FALSE);
}

}

void eraseSectionTest() {
Expand All @@ -504,7 +504,7 @@ void eraseSectionTest() {
else {
pass(FALSE);
}

}

void eraseBlock32KTest() {
Expand All @@ -521,7 +521,7 @@ void eraseBlock32KTest() {
else {
pass(FALSE);
}

}

void eraseBlock64KTest() {
Expand All @@ -538,7 +538,7 @@ void eraseBlock64KTest() {
else {
pass(FALSE);
}

}

void eraseChipTest() {
Expand All @@ -554,6 +554,6 @@ void eraseChipTest() {
else {
pass(FALSE);
}

}

4 changes: 2 additions & 2 deletions extras/Changes.log
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Bugs squashed
--> Fixes issue #135 : The addition of the SFDP checking to _chipID resulted in a sudden (very large) increase in compiled code size. As of the current version (v3.2.1), SFDP checking is an user controlled option. To get the library to work with SFDP compatible flash memory that is not officially supported, the user must uncomment '//#define USES_SFDP' in 'SPIMemory.h'.

--> Moved `bool _loopedOver` from being a local variable in `_getAddress()` to a global one. Now it actually does what it was meant to do - i.e. prevent looping over data a second time.
--> Moved `bool _loopedOver` from being a local variable in `getAddress()` to a global one. Now it actually does what it was meant to do - i.e. prevent looping over data a second time.

Enhancements
--> The way the basic functions execute has been modified to keep the function runtime the same (or improved) while reducing their memory footprint.
Expand All @@ -19,7 +19,7 @@ Enhancements
Test platform - Arduino Pro Mini 8MHz 3.3V
Library version: v3.1.0 Compiled code size - 20500 bytes
Library version: v3.2.0 Compiled code size - 23010 bytes (12% larger than v3.1.0)
Library version: v3.2.1 Compiled code size - 18658 bytes (9% smaller than v3.1.0)
Library version: v3.2.1 Compiled code size - 18660 bytes (9% smaller than v3.1.0)

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Version 3.2.0 //
Expand Down
2 changes: 1 addition & 1 deletion src/SPIFlash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ bool SPIFlash::eraseSection(uint32_t _addr, uint32_t _sz) {
_timeFactor = kb4Erase.time;
}
if(!_notBusy(_timeFactor * 1000L)) {
return false; //Datasheet says erasing a sector takes 400ms max
return false;
}
if (j == noOfEraseRunsB4Boundary) {
if (!_prep(ERASEFUNC, (_addr + (_sz - _addressOverflow)), _sz)) {
Expand Down
13 changes: 10 additions & 3 deletions src/SPIMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,19 @@

#ifndef SPIMEMORY_H
#define SPIMEMORY_H
//#define USES_SFDP
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Uncomment the code below to enable SFDP discovery - especially //
// if using an unsupported chip //
// //
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
#define USES_SFDP //
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Uncomment the code below to run a diagnostic if your flash //
// does not respond //
// //
// Error codes will be generated and returned on functions //
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
//#define RUNDIAGNOSTIC //
#define RUNDIAGNOSTIC //
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
Expand Down Expand Up @@ -108,14 +113,16 @@

#define LIBVER 3
#define LIBSUBVER 2
#define BUGFIXVER 0
#define BUGFIXVER 1

class SPIMemory {
public:
//------------------------------------ Constructor ------------------------------------//
SPIMemory(void) {};
~SPIMemory(void) {};
//------------------------------- Public functions -----------------------------------//
//------------------------------- Public variables -----------------------------------//


};

Expand Down

0 comments on commit 8520d2b

Please sign in to comment.