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/25 18:15:44 UTC

[GitHub] [mynewt-core] kasjer commented on a change in pull request #1719: spiflash: Fix timeout calculation

kasjer commented on a change in pull request #1719: spiflash: Fix timeout calculation
URL: https://github.com/apache/mynewt-core/pull/1719#discussion_r268785558
 
 

 ##########
 File path: hw/drivers/flash/spiflash/src/spiflash.c
 ##########
 @@ -1130,12 +1131,13 @@ spiflash_execute_erase(struct spiflash_dev *dev, const uint8_t *buf,
     /* Now we know that device is not ready */
     dev->ready = false;
 
-    start_time = os_cputime_ticks_to_usecs(os_cputime_get32());
+    start_time = os_cputime_get32();
     /* Wait typical erase time before starting polling for ready */
     spiflash_delay_us(delay_spec->typical);
 
     /* Poll status ready for remaining time */
-    wait_time_us = start_time + delay_spec->maximum - os_cputime_get32();
+    wait_time_us = delay_spec->maximum -
 
 Review comment:
   Your are right, it could happen when delay times were very short, specially when maximum time was shorter then typical 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


With regards,
Apache Git Services