added wait_us(31) in admw_spi.cpp to support hibernation mode

Files at this revision

API Documentation at this revision

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
--- 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
+ */