You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/11/03 14:11:40 UTC

[GitHub] [incubator-nuttx] donghengqaz commented on a change in pull request #2199: xtensa/esp32: SPI Flash driver uses global sem for all MTD

donghengqaz commented on a change in pull request #2199:
URL: https://github.com/apache/incubator-nuttx/pull/2199#discussion_r516394097



##########
File path: arch/xtensa/src/esp32/esp32_spiflash.c
##########
@@ -1343,10 +1343,6 @@ FAR struct mtd_dev_s *esp32_spiflash_alloc_mtdpart(void)
   uint32_t startblock;
   uint32_t size;
 
-  /* Initiliaze the mutex */
-
-  nxsem_init(&priv->exclsem, 0, 1);

Review comment:
       I use global variable `static sem_t g_exclsem = SEM_INITIALIZER(1);` to initialize the semaphore, and all MTDs use the one semaphore, so that they will not operate the SPI at the same time.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org