Vybhav Kadaba
/
EV-PRO-MW1001_Development
added wait_us(31) in admw_spi.cpp to support hibernation mode
Revision 60:363fffe5bd22, committed 2020-03-16
- Comitter:
- Vkadaba
- Date:
- Mon Mar 16 09:54:36 2020 +0000
- Parent:
- 59:3d395512b442
- Commit message:
- Added wait_us(31) in admw_spi.cpp when hibernation mode is enabled
Changed in this revision
src/mbed/admw_spi.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 3d395512b442 -r 363fffe5bd22 src/mbed/admw_spi.cpp --- a/src/mbed/admw_spi.cpp Mon Mar 16 09:43:49 2020 +0000 +++ b/src/mbed/admw_spi.cpp Mon Mar 16 09:54:36 2020 +0000 @@ -108,11 +108,9 @@ int rc = 0; *(pCtx->_wakeup) = 1; - + wait_us(31); *(pCtx->_cs) = 0; - - rc = pCtx->_spi->write((char*)(pTxData), pTxData ? nLength : 0, (char*)(pRxData), pRxData ? nLength : 0); @@ -148,16 +146,15 @@ SpiContext_t *pCtx = (SpiContext_t*)hDevice; *(pCtx->_wakeup) = 1; + wait_us(31); *(pCtx->_cs) = 0; - + *(pCtx->_wakeup) = 0; rc = pCtx->_spi->write((char*)(pTxData), pTxData ? nLength : 0, (char*)(pRxData), pRxData ? nLength : 0); if ((rc < 0) || !bCsHold) *(pCtx->_cs) = 1; - - *(pCtx->_wakeup) = 0; - + if (rc < 0) { ADMW_LOG_ERROR("Failed to complete SPI transfer"); @@ -188,4 +185,4 @@ /*! * @} - */ \ No newline at end of file + */