diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-10-05 09:35:24 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-10-05 09:35:24 +0000 |
commit | 57a173c1788cbb2c7fc45b381f391ee93be10872 (patch) | |
tree | d4e3c28992cdc90767c5acf61ca33f8f5906112d /testhal | |
parent | 887ff945a901fac1fe18d6be7367b7f405a99e1a (diff) | |
download | ChibiOS-57a173c1788cbb2c7fc45b381f391ee93be10872.tar.gz ChibiOS-57a173c1788cbb2c7fc45b381f391ee93be10872.tar.bz2 ChibiOS-57a173c1788cbb2c7fc45b381f391ee93be10872.zip |
Some functions renamed, flash driver working somehow.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12321 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/STM32/STM32L4xx/WSPI-N25Q128/main.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/testhal/STM32/STM32L4xx/WSPI-N25Q128/main.c b/testhal/STM32/STM32L4xx/WSPI-N25Q128/main.c index 6e8a35436..ea3afb376 100644 --- a/testhal/STM32/STM32L4xx/WSPI-N25Q128/main.c +++ b/testhal/STM32/STM32L4xx/WSPI-N25Q128/main.c @@ -54,9 +54,9 @@ const uint8_t pattern[128] = { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
};
-SNORDriver m25q;
+SNORDriver snor1;
-const SNORConfig m25qcfg1 = {
+const SNORConfig snorcfg1 = {
&WSPID1,
&wspicfg1
};
@@ -107,56 +107,56 @@ int main(void) { /*
* Initializing and starting SNOR driver.
*/
- m25qObjectInit(&m25q);
- m25qStart(&m25q, &m25qcfg1);
+ snorObjectInit(&snor1);
+ snorStart(&snor1, &snorcfg1);
/* Reading.*/
- err = flashRead(&m25q, 0, 128, buffer);
+ err = flashRead(&snor1, 0, 128, buffer);
if (err != FLASH_NO_ERROR)
chSysHalt("read error");
/* Erasing the first sector and waiting for completion.*/
- (void) flashStartEraseSector(&m25q, 0);
- err = flashWaitErase((BaseFlash *)&m25q);
+ (void) flashStartEraseSector(&snor1, 0);
+ err = flashWaitErase((BaseFlash *)&snor1);
if (err != FLASH_NO_ERROR)
chSysHalt("erase error");
/* Verifying the erase operation.*/
- err = flashVerifyErase(&m25q, 0);
+ err = flashVerifyErase(&snor1, 0);
if (err != FLASH_NO_ERROR)
chSysHalt("verify erase error");
/* Programming a pattern.*/
- err = flashProgram(&m25q, 0, 128, pattern);
+ err = flashProgram(&snor1, 0, 128, pattern);
if (err != FLASH_NO_ERROR)
chSysHalt("program error");
/* Verifying the erase operation.*/
- err = flashVerifyErase(&m25q, 0);
+ err = flashVerifyErase(&snor1, 0);
if (err != FLASH_ERROR_VERIFY)
chSysHalt("verify non-erase error");
/* Memory mapping the device.*/
- m25qMemoryMap(&m25q, &addr);
+ snorMemoryMap(&snor1, &addr);
/* Unmapping the device.*/
- m25qMemoryUnmap(&m25q);
+ snorMemoryUnmap(&snor1);
/* Reading it back.*/
memset(buffer, 0, 128);
- err = flashRead(&m25q, 16, 128, buffer);
+ err = flashRead(&snor1, 16, 128, buffer);
if (err != FLASH_NO_ERROR)
chSysHalt("read error");
/* Reading it back.*/
memset(buffer, 0, 128);
- err = flashRead(&m25q, 0, 128, buffer);
+ err = flashRead(&snor1, 0, 128, buffer);
if (err != FLASH_NO_ERROR)
chSysHalt("read error");
/* Erasing again.*/
- (void) flashStartEraseSector(&m25q, 0);
- err = flashWaitErase((BaseFlash *)&m25q);
+ (void) flashStartEraseSector(&snor1, 0);
+ err = flashWaitErase((BaseFlash *)&snor1);
if (err != FLASH_NO_ERROR)
chSysHalt("erase error");
|