diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-06-05 08:05:25 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-06-05 08:05:25 +0000 |
commit | 07d81aae52dc92707aa732de75baf8b9fa5988b5 (patch) | |
tree | b37c79271a06373b4ff2686c5bb2387099ebca2e /os/ex/Micron | |
parent | 63f5989cd28e0ffd997b9d599c0d96b6402f5aa5 (diff) | |
download | ChibiOS-07d81aae52dc92707aa732de75baf8b9fa5988b5.tar.gz ChibiOS-07d81aae52dc92707aa732de75baf8b9fa5988b5.tar.bz2 ChibiOS-07d81aae52dc92707aa732de75baf8b9fa5988b5.zip |
Better abstracted flash bus code.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9581 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/ex/Micron')
-rw-r--r-- | os/ex/Micron/m25q.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/os/ex/Micron/m25q.c b/os/ex/Micron/m25q.c index cd399181a..a8fcf1d92 100644 --- a/os/ex/Micron/m25q.c +++ b/os/ex/Micron/m25q.c @@ -648,15 +648,13 @@ void m25qStart(M25QDriver *devp, const M25QConfig *config) { /* Bus acquisition.*/ jesd216_bus_acquire(devp->config->busp); -#if JESD216_BUS_MODE == JESD216_BUS_MODE_SPI - /* SPI initialization.*/ - spiStart(devp->config->busp, devp->config->buscfg); + /* Starting bus device.*/ + jesd216_start(devp->config->busp, devp->config->buscfg); +#if JESD216_BUS_MODE == JESD216_BUS_MODE_SPI /* Reading device ID.*/ -#else /* JESD216_BUS_MODE != JESD216_BUS_MODE_SPI */ - /* QSPI initialization.*/ - qspiStart(devp->config->busp, devp->config->buscfg); +#else /* JESD216_BUS_MODE != JESD216_BUS_MODE_SPI */ /* Attempting a reset of the XIP mode, it could be in an unexpected state because a CPU reset does not reset the memory too.*/ m25q_reset_xip(devp); @@ -740,12 +738,10 @@ void m25qStop(M25QDriver *devp) { /* Bus acquisition.*/ jesd216_bus_acquire(devp->config->busp); -#if JESD216_BUS_MODE == JESD216_BUS_MODE_SPI - spiStop(devp->config->busp); -#else - qspiStop(devp->config->busp); -#endif + /* Stopping bus device.*/ + jesd216_stop(devp->config->busp); + /* Deleting current configuration.*/ devp->config = NULL; /* Driver stopped.*/ |