Wilson Tang
/
HSP_RPC_GUI
Fork of the offical HSP_RPC_GUI firmware
Fork of MAXREFDES100 firmware for MAX32620HSP
Diff: HSP/Test/Test_S25FS512.cpp
- Revision:
- 1:9490836294ea
- Parent:
- 0:e4a10ed6eb92
- Child:
- 3:8e9b9f5818aa
--- a/HSP/Test/Test_S25FS512.cpp Tue Oct 25 15:22:11 2016 +0000 +++ b/HSP/Test/Test_S25FS512.cpp Fri Apr 21 12:12:30 2017 -0500 @@ -33,13 +33,17 @@ #include "Test_S25FS512.h" #include "Test_Utilities.h" + +#define SIZE_OF_EXTERNAL_FLASH 0x2000000 // 33,554,432 Bytes +/// number of pages +#define NUMBER_OF_PAGES ((SIZE_OF_EXTERNAL_FLASH / 256) - 1) + //****************************************************************************** void test_S25FS512(void (*outputString)(const char *)) { char tempStr[32]; uint8_t page[264]; int totalPass = 1; int pass; - int status; int i; uint8_t data[128]; S25FS512 *s25FS512; @@ -64,6 +68,7 @@ sprintf(tempStr, "(%02X%02X%02X%02X)|", data[1], data[2], data[3], data[4]); outputString(tempStr); + if (totalPass == 1) { // format sector 0 outputString("Formatting Sector 0, "); @@ -76,9 +81,9 @@ _printPassFail(pass, 1, outputString); totalPass &= pass; - // fill page with pattern + // fill page with random pattern for (i = 0; i < 256; i++) { - page[i] = i; + page[i] = i; } // write to page 0 outputString("Writing Page 0 to pattern, ");