You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/03/21 08:31:39 UTC

[GitHub] [mynewt-core] rymanluk commented on a change in pull request #1707: kasjer/spiflash performance improvements

rymanluk commented on a change in pull request #1707: kasjer/spiflash performance improvements
URL: https://github.com/apache/mynewt-core/pull/1707#discussion_r267653778
 
 

 ##########
 File path: hw/drivers/flash/spiflash/src/spiflash.c
 ##########
 @@ -860,36 +860,59 @@ spiflash_read_status(struct spiflash_dev *dev)
     return val;
 }
 
+static void
+spiflash_delay_us(uint32_t usecs)
+{
+#if MYNEWT_VAL(OS_SCHEDULING)
+    uint32_t ticks = os_time_ms_to_ticks32(usecs / 1000);
+    if (ticks > 1) {
+        os_time_delay(ticks);
+    } else {
+        os_cputime_delay_usecs(usecs);
+    }
+#else
+    os_cputime_delay_usecs(usecs);
+#endif
+}
+
 bool
 spiflash_device_ready(struct spiflash_dev *dev)
 {
     return !(spiflash_read_status(dev) & SPIFLASH_STATUS_BUSY);
 }
 
 int
-spiflash_wait_ready(struct spiflash_dev *dev, uint32_t timeout_ms)
+spiflash_wait_ready_till(struct spiflash_dev *dev, uint32_t usecs,
 
 Review comment:
   I would use  `timeout_us` instead of `usec`

----------------------------------------------------------------
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


With regards,
Apache Git Services