mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Change all time conversions. Yech. New timer units in microseconds breaks all existing logic that used milliseconds in the conversions. Something likely got broken doing this, probably because I confused a MSEC2TICK conversion with a TICK2MSEC conversion. Also, the tickless OS no appears fully functional and passes the OS test on the simulator with no errors
This commit is contained in:
@@ -1475,6 +1475,9 @@ static int wm8904_sendbuffer(FAR struct wm8904_dev_s *priv)
|
||||
* REVISIT: Does this take into account the number channels? Perhaps
|
||||
* saving an reusing the bitrate would give a better and simpler
|
||||
* calculation.
|
||||
*
|
||||
* REVISIT: Should not use MSEC_PER_TICK. It can be inaccurate with
|
||||
* microsecond resolution timer.
|
||||
*/
|
||||
|
||||
timeout = (((uint32_t)(apb->nbytes - apb->curbyte) << 14) /
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
/* Poll the pen position while the pen is down at this rate (50MS): */
|
||||
|
||||
#define ADS7843E_WDOG_DELAY ((50 + (MSEC_PER_TICK-1))/ MSEC_PER_TICK)
|
||||
#define ADS7843E_WDOG_DELAY MSEC2TICK(50)
|
||||
|
||||
/********************************************************************************************
|
||||
* Public Types
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
|
||||
/* Poll the pen position while the pen is down at this rate (50MS): */
|
||||
|
||||
#define MAX11802_WDOG_DELAY ((50 + (MSEC_PER_TICK-1))/ MSEC_PER_TICK)
|
||||
#define MAX11802_WDOG_DELAY MSEC2TICK(50)
|
||||
|
||||
/********************************************************************************************
|
||||
* Public Types
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
/* Timeout to detect missing pen up events */
|
||||
|
||||
#define STMPE811_PENUP_TICKS ((100 + (MSEC_PER_TICK-1)) / MSEC_PER_TICK)
|
||||
#define STMPE811_PENUP_TICKS MSEC2TICK(100)
|
||||
|
||||
/********************************************************************************************
|
||||
* Public Types
|
||||
|
||||
@@ -435,7 +435,7 @@ static int sst39vf_chiperase(FAR struct sst39vf_dev_s *priv)
|
||||
wrinfo.data = 0xffff;
|
||||
|
||||
start = clock_systimer();
|
||||
while (delay < SST39VF_TSCE_MSEC * MSEC_PER_TICK)
|
||||
while (delay < MSEC2TICK(SST39VF_TSCE_MSEC))
|
||||
{
|
||||
/* Check if the erase is complete */
|
||||
|
||||
@@ -447,14 +447,14 @@ static int sst39vf_chiperase(FAR struct sst39vf_dev_s *priv)
|
||||
/* No, check if the timeout has elapsed */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
if (elapsed > SST39VF_TSCE_MSEC * MSEC_PER_TICK)
|
||||
if (elapsed > MSEC2TICK(SST39VF_TSCE_MSEC))
|
||||
{
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
/* No, wait one system clock tick */
|
||||
|
||||
usleep(MSEC_PER_TICK * USEC_PER_MSEC);
|
||||
usleep(USEC_PER_TICK);
|
||||
}
|
||||
#else
|
||||
/* Delay the maximum amount of time for the chip erase to complete. */
|
||||
@@ -511,7 +511,7 @@ static int sst39vf_sectorerase(FAR struct sst39vf_dev_s *priv,
|
||||
|
||||
#if 0
|
||||
start = clock_systimer();
|
||||
while (delay < SST39VF_TSE_MSEC * MSEC_PER_TICK)
|
||||
while (delay < MSEC2TICK(SST39VF_TSE_MSEC))
|
||||
{
|
||||
/* Check if the erase is complete */
|
||||
|
||||
@@ -523,14 +523,14 @@ static int sst39vf_sectorerase(FAR struct sst39vf_dev_s *priv,
|
||||
/* No, check if the timeout has elapsed */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
if (elapsed > SST39VF_TSE_MSEC * MSEC_PER_TICK)
|
||||
if (elapsed > MSEC2TICK(SST39VF_TSE_MSEC))
|
||||
{
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
/* No, wait one system clock tick */
|
||||
|
||||
usleep(MSEC_PER_TICK * USEC_PER_MSEC);
|
||||
usleep(USEC_PER_TICK);
|
||||
}
|
||||
#else
|
||||
/* Delay the maximum amount of time for the sector erase to complete. */
|
||||
|
||||
Reference in New Issue
Block a user