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 17:50:13 UTC

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

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

 ##########
 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:
   Is there any chance that the time has advanced such that this calculation "goes negative" and thus ends up with a super high wait time?
   
   Changes look good otherwise.

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