mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 21:34:07 +08:00
Rename clock_systime[r|spec] to clock_systime_[ticks|timespec]
follow up the new naming convention: https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions
This commit is contained in:
@@ -2597,7 +2597,7 @@ config ARCH_SIM
|
||||
<p>
|
||||
<b><code>CONFIG_USEC_PER_TICK</code></b>:
|
||||
This option is not unique to <i>Tickless OS</i> operation, but changes its relevance when the <i>Tickless OS</i> is selected.
|
||||
In the default configuration where system time is provided by a periodic timer interrupt, the default system timer is configure the timer for 100Hz or <code>CONFIG_USEC_PER_TICK=10000</code>. If <code>CONFIG_SCHED_TICKLESS</code> is selected, then there are no system timer interrupt. In this case, <code>CONFIG_USEC_PER_TICK</code> does not control any timer rates. Rather, it only determines the resolution of time reported by <code>clock_systimer()</code> and the resolution of times that can be set for certain delays including watchdog timers and delayed work.
|
||||
In the default configuration where system time is provided by a periodic timer interrupt, the default system timer is configure the timer for 100Hz or <code>CONFIG_USEC_PER_TICK=10000</code>. If <code>CONFIG_SCHED_TICKLESS</code> is selected, then there are no system timer interrupt. In this case, <code>CONFIG_USEC_PER_TICK</code> does not control any timer rates. Rather, it only determines the resolution of time reported by <code>clock_systime_ticks()</code> and the resolution of times that can be set for certain delays including watchdog timers and delayed work.
|
||||
</p>
|
||||
<p>
|
||||
In this case there is still a trade-off: It is better to have the <code>CONFIG_USEC_PER_TICK</code> as low as possible for higher timing resolution. However, the time is currently held in <code>unsigned int</code>. On some systems, this may be 16-bits in width but on most contemporary systems it will be 32-bits. In either case, smaller values of <code>CONFIG_USEC_PER_TICK</code> will reduce the range of values that delays that can be represented. So the trade-off is between range and resolution (you could also modify the code to use a 64-bit value if you really want both).
|
||||
|
||||
@@ -644,13 +644,13 @@ static inline int am335x_i2c_sem_waitdone(FAR struct am335x_i2c_priv_s *priv)
|
||||
#endif
|
||||
|
||||
priv->intstate = INTSTATE_WAITING;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Poll by simply calling the timer interrupt handler until it
|
||||
* reports that it is done.
|
||||
@@ -704,12 +704,12 @@ static inline bool
|
||||
* detected, set by hardware when a timeout error is detected."
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Check for Bus Free condition */
|
||||
|
||||
@@ -808,7 +808,7 @@ static void am335x_i2c_tracereset(FAR struct am335x_i2c_priv_s *priv)
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->start_time = clock_systimer();
|
||||
priv->start_time = clock_systime_ticks();
|
||||
am335x_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
@@ -842,7 +842,7 @@ static void am335x_i2c_tracenew(FAR struct am335x_i2c_priv_s *priv,
|
||||
am335x_i2c_traceclear(priv);
|
||||
trace->status = status;
|
||||
trace->count = 1;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -885,7 +885,7 @@ static void am335x_i2c_tracedump(FAR struct am335x_i2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %ld\n",
|
||||
(long)(clock_systimer() - priv->start_time));
|
||||
(long)(clock_systime_ticks() - priv->start_time));
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
|
||||
@@ -329,7 +329,7 @@ static void cxd56_rtc_initialize(int argc, uint32_t arg, ...)
|
||||
{
|
||||
/* Keep the system operating time before RTC is enabled. */
|
||||
|
||||
clock_systimespec(&ts);
|
||||
clock_systime_timespec(&ts);
|
||||
}
|
||||
|
||||
/* Synchronize the system time to the RTC time */
|
||||
|
||||
@@ -637,7 +637,7 @@ static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv)
|
||||
* nxsem_timedwait() sleeps.
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
@@ -649,7 +649,7 @@ static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv)
|
||||
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
|
||||
/* Loop until the transfer is complete. */
|
||||
@@ -747,7 +747,7 @@ static void efm32_i2c_tracereset(FAR struct efm32_i2c_priv_s *priv)
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->start_time = clock_systimer();
|
||||
priv->start_time = clock_systime_ticks();
|
||||
efm32_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
@@ -787,7 +787,7 @@ static void efm32_i2c_tracenew(FAR struct efm32_i2c_priv_s *priv)
|
||||
trace->i2c_reg_if = priv->i2c_reg_if;
|
||||
trace->count = 1;
|
||||
trace->dcnt = priv->dcnt;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -803,7 +803,7 @@ static void efm32_i2c_tracedump(FAR struct efm32_i2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %ld\n",
|
||||
(long)(clock_systimer() - priv->start_time));
|
||||
(long)(clock_systime_ticks() - priv->start_time));
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
|
||||
@@ -1725,7 +1725,7 @@ static int efm32_ctrl_sendsetup(FAR struct efm32_usbhost_s *priv,
|
||||
/* Loop while the device reports NAK (and a timeout is not exceeded */
|
||||
|
||||
chan = &priv->chan[ep0->outndx];
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
@@ -1774,7 +1774,7 @@ static int efm32_ctrl_sendsetup(FAR struct efm32_usbhost_s *priv,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < EFM32_SETUP_DELAY);
|
||||
|
||||
@@ -1963,7 +1963,7 @@ static ssize_t efm32_in_transfer(FAR struct efm32_usbhost_s *priv, int chidx,
|
||||
chan->buflen = buflen;
|
||||
chan->xfrd = 0;
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
while (chan->xfrd < chan->buflen)
|
||||
{
|
||||
/* Set up for the wait BEFORE starting the transfer */
|
||||
@@ -2004,7 +2004,7 @@ static ssize_t efm32_in_transfer(FAR struct efm32_usbhost_s *priv, int chidx,
|
||||
* pointer and buffer size will be unaltered.
|
||||
*/
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (ret != -EAGAIN || /* Not a NAK condition OR */
|
||||
elapsed >= EFM32_DATANAK_DELAY || /* Timeout has elapsed OR */
|
||||
chan->xfrd > 0) /* Data has been partially transferred */
|
||||
@@ -2224,7 +2224,7 @@ static ssize_t efm32_out_transfer(FAR struct efm32_usbhost_s *priv,
|
||||
*/
|
||||
|
||||
chan = &priv->chan[chidx];
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
xfrd = 0;
|
||||
zlp = (buflen == 0);
|
||||
|
||||
@@ -2275,7 +2275,7 @@ static ssize_t efm32_out_transfer(FAR struct efm32_usbhost_s *priv,
|
||||
* pointer and buffer size will be unaltered.
|
||||
*/
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (ret != -EAGAIN || /* Not a NAK condition OR */
|
||||
elapsed >= EFM32_DATANAK_DELAY || /* Timeout has elapsed OR */
|
||||
chan->xfrd > 0) /* Data has been partially transferred */
|
||||
@@ -4524,7 +4524,7 @@ static int efm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the status OUT phase */
|
||||
@@ -4543,7 +4543,7 @@ static int efm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < EFM32_DATANAK_DELAY);
|
||||
}
|
||||
@@ -4599,7 +4599,7 @@ static int efm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the data OUT phase (if any) */
|
||||
@@ -4635,7 +4635,7 @@ static int efm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < EFM32_DATANAK_DELAY);
|
||||
}
|
||||
|
||||
@@ -727,13 +727,13 @@ static inline int
|
||||
*/
|
||||
|
||||
priv->intstate = INTSTATE_WAITING;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Poll by simply calling the timer interrupt handler until it
|
||||
* reports that it is done.
|
||||
@@ -787,12 +787,12 @@ static inline void
|
||||
* detected, set by hardware when a timeout error is detected."
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Check for STOP condition */
|
||||
|
||||
@@ -923,7 +923,7 @@ static void imxrt_lpi2c_tracereset(FAR struct imxrt_lpi2c_priv_s *priv)
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->start_time = clock_systimer();
|
||||
priv->start_time = clock_systime_ticks();
|
||||
imxrt_lpi2c_traceclear(priv);
|
||||
}
|
||||
|
||||
@@ -957,7 +957,7 @@ static void imxrt_lpi2c_tracenew(FAR struct imxrt_lpi2c_priv_s *priv,
|
||||
imxrt_lpi2c_traceclear(priv);
|
||||
trace->status = status;
|
||||
trace->count = 1;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1000,7 +1000,7 @@ static void imxrt_lpi2c_tracedump(FAR struct imxrt_lpi2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %ld\n",
|
||||
(long)(clock_systimer() - priv->start_time));
|
||||
(long)(clock_systime_ticks() - priv->start_time));
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
|
||||
@@ -186,13 +186,13 @@ static int imxrt_ocotp_wait_for_completion(uint32_t timeout_ms)
|
||||
|
||||
timeout = MSEC2TICK(timeout_ms);
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
while (getreg32(IMXRT_OCOTP_CTRL) & OCOTP_CTRL_BUSY)
|
||||
{
|
||||
/* If a timeout is specified check for timeout */
|
||||
|
||||
if (timeout_ms && clock_systimer() - start >= timeout)
|
||||
if (timeout_ms && clock_systime_ticks() - start >= timeout)
|
||||
{
|
||||
return -ETIME;
|
||||
}
|
||||
|
||||
@@ -2081,13 +2081,13 @@ static int imxrt_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
||||
*/
|
||||
|
||||
timeout = USDHC_CMDTIMEOUT;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
while ((getreg32(priv->addr + IMXRT_USDHC_PRSSTAT_OFFSET) &
|
||||
USDHC_PRSSTAT_CIHB) != 0)
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed >= timeout)
|
||||
{
|
||||
mcerr("ERROR: Timeout (waiting CIHB) cmd: %08x PRSSTAT: %08x\n",
|
||||
@@ -2362,13 +2362,13 @@ static int imxrt_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd)
|
||||
* (except Auto CMD12).
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
while ((getreg32(priv->addr + IMXRT_USDHC_IRQSTAT_OFFSET) &
|
||||
USDHC_INT_CC) == 0)
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed >= timeout)
|
||||
{
|
||||
mcerr("ERROR: Timeout cmd: %08x IRQSTAT: %08x\n", cmd,
|
||||
|
||||
@@ -830,11 +830,11 @@ static int kinetis_i2c_start(struct kinetis_i2cdev_s *priv)
|
||||
{
|
||||
/* We are not currently the bus master, wait for bus ready or timeout */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
while (kinetis_i2c_getreg(priv, KINETIS_I2C_S_OFFSET) & I2C_S_BUSY)
|
||||
{
|
||||
if (clock_systimer() - start > I2C_TIMEOUT)
|
||||
if (clock_systime_ticks() - start > I2C_TIMEOUT)
|
||||
{
|
||||
priv->state = STATE_TIMEOUT;
|
||||
return -EIO;
|
||||
@@ -854,12 +854,12 @@ static int kinetis_i2c_start(struct kinetis_i2cdev_s *priv)
|
||||
* a timeout occurs
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
while ((kinetis_i2c_getreg(priv, KINETIS_I2C_S_OFFSET) & I2C_S_BUSY)
|
||||
== 0)
|
||||
{
|
||||
if (clock_systimer() - start > I2C_TIMEOUT)
|
||||
if (clock_systime_ticks() - start > I2C_TIMEOUT)
|
||||
{
|
||||
priv->state = STATE_TIMEOUT;
|
||||
return -EIO;
|
||||
|
||||
@@ -1866,13 +1866,13 @@ static int kinetis_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
||||
*/
|
||||
|
||||
timeout = SDHC_CMDTIMEOUT;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
while ((getreg32(KINETIS_SDHC_PRSSTAT) & SDHC_PRSSTAT_CIHB) != 0)
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed >= timeout)
|
||||
{
|
||||
mcerr("ERROR: Timeout cmd: %08x PRSSTAT: %08x\n",
|
||||
@@ -2149,13 +2149,13 @@ static int kinetis_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd)
|
||||
* (except Auto CMD12).
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
while ((getreg32(KINETIS_SDHC_IRQSTAT) & SDHC_INT_CC) == 0)
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed >= timeout)
|
||||
{
|
||||
mcerr("ERROR: Timeout cmd: %08x IRQSTAT: %08x\n",
|
||||
|
||||
@@ -372,7 +372,7 @@ static inline int
|
||||
* sem_timedwait() sleeps.
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
@@ -384,7 +384,7 @@ static inline int
|
||||
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (priv->irqstate != IRQSTATE_DONE && elapsed < timeout);
|
||||
|
||||
|
||||
@@ -148,15 +148,15 @@ SINT_T sddep0_hw_init(struct SdDrCfg_s *cfg)
|
||||
{
|
||||
irqstate_t flags = enter_critical_section();
|
||||
|
||||
/* set COREVLT to 1 (i.e. 1.2v) */
|
||||
/* set MMCVLT0 to 1.8v */
|
||||
/* set EMMC */
|
||||
/* set COREVLT to 1 (i.e. 1.2v)
|
||||
* set MMCVLT0 to 1.8v
|
||||
* set EMMC
|
||||
*/
|
||||
|
||||
modifyreg32(SDCTL,
|
||||
0,
|
||||
SDCTL_COREVLT | SDCTL_MMCVLT0_18V | SDCTL_SDMMC0_MMC);
|
||||
|
||||
|
||||
/* pull-up SDCMD0/SDAT00-03 */
|
||||
|
||||
modifyreg32(PUDCNT6, 0, (1UL << 2) | (1UL << 4));
|
||||
@@ -185,8 +185,9 @@ SINT_T sddep1_hw_init(struct SdDrCfg_s *cfg)
|
||||
|
||||
irqstate_t flags = enter_critical_section();
|
||||
|
||||
/* pull up SDCMD1/SDDATA10-13 which correspond to GPIO23-27 */
|
||||
/* NOTE: SDCLK1 is not changed (i.e. none) */
|
||||
/* pull up SDCMD1/SDDATA10-13 which correspond to GPIO23-27
|
||||
* NOTE: SDCLK1 is not changed (i.e. none)
|
||||
*/
|
||||
|
||||
for (i = 3; i <= 7; i++)
|
||||
{
|
||||
@@ -229,8 +230,9 @@ SINT_T sddep1_hw_exit(struct SdDrCfg_s *cfg)
|
||||
{
|
||||
irqstate_t flags = enter_critical_section();
|
||||
|
||||
/* pull down SDCMD1/SDDATA10-13 which correspond to GPIO23-27 */
|
||||
/* NOTE: SDCLK1 is not changed (i.e. none) */
|
||||
/* pull down SDCMD1/SDDATA10-13 which correspond to GPIO23-27
|
||||
* NOTE: SDCLK1 is not changed (i.e. none)
|
||||
*/
|
||||
|
||||
int i;
|
||||
for (i = 3; i <= 7; i++)
|
||||
@@ -262,7 +264,6 @@ SINT_T sddep1_hw_exit(struct SdDrCfg_s *cfg)
|
||||
}
|
||||
#endif /* CONFIG_LC823450_SDIF_SDC */
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sddep_voltage_switch
|
||||
****************************************************************************/
|
||||
@@ -358,12 +359,12 @@ uint64_t sddep_set_timeout(uint64_t t)
|
||||
SINT_T sddep_wait_status(UI_32 req_status, UI_32 *status,
|
||||
struct SdDrCfg_s *cfg)
|
||||
{
|
||||
clock_t tick0 = clock_systimer();
|
||||
clock_t tick0 = clock_systime_ticks();
|
||||
int ret = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
clock_t tick1 = clock_systimer();
|
||||
clock_t tick1 = clock_systime_ticks();
|
||||
*status = sdif_get_status(cfg->regbase);
|
||||
if (req_status & (*status))
|
||||
{
|
||||
@@ -375,6 +376,7 @@ SINT_T sddep_wait_status(UI_32 req_status, UI_32 *status,
|
||||
ret = -100;
|
||||
break;
|
||||
}
|
||||
|
||||
sched_yield();
|
||||
}
|
||||
|
||||
@@ -397,7 +399,8 @@ SINT_T sddep_read(void *src, void *dst, UI_32 size, SINT_T type,
|
||||
lc823450_dmasetup(_hrdma[ch],
|
||||
LC823450_DMA_SRCWIDTH_WORD |
|
||||
LC823450_DMA_DSTWIDTH_WORD |
|
||||
(type == SDDR_RW_INC_WORD ? LC823450_DMA_DSTINC : 0),
|
||||
(type == SDDR_RW_INC_WORD ?
|
||||
LC823450_DMA_DSTINC : 0),
|
||||
(uint32_t)src, (uint32_t)dst, size / 4);
|
||||
break;
|
||||
|
||||
@@ -406,7 +409,8 @@ SINT_T sddep_read(void *src, void *dst, UI_32 size, SINT_T type,
|
||||
lc823450_dmasetup(_hrdma[ch],
|
||||
LC823450_DMA_SRCWIDTH_WORD |
|
||||
LC823450_DMA_DSTWIDTH_HWORD |
|
||||
(type == SDDR_RW_INC_HWORD ? LC823450_DMA_DSTINC : 0),
|
||||
(type == SDDR_RW_INC_HWORD ?
|
||||
LC823450_DMA_DSTINC : 0),
|
||||
(uint32_t)src, (uint32_t)dst, size / 4);
|
||||
break;
|
||||
|
||||
@@ -415,7 +419,8 @@ SINT_T sddep_read(void *src, void *dst, UI_32 size, SINT_T type,
|
||||
lc823450_dmasetup(_hrdma[ch],
|
||||
LC823450_DMA_SRCWIDTH_WORD |
|
||||
LC823450_DMA_DSTWIDTH_BYTE |
|
||||
(type == SDDR_RW_INC_BYTE ? LC823450_DMA_DSTINC : 0),
|
||||
(type == SDDR_RW_INC_BYTE ?
|
||||
LC823450_DMA_DSTINC : 0),
|
||||
(uint32_t)src, (uint32_t)dst, size / 4);
|
||||
break;
|
||||
}
|
||||
@@ -427,7 +432,7 @@ SINT_T sddep_read(void *src, void *dst, UI_32 size, SINT_T type,
|
||||
UI_32 *p = (UI_32 *)src;
|
||||
UI_32 *buf = cfg->workbuf;
|
||||
|
||||
for (i = 0; i < size/sizeof(UI_32); i++)
|
||||
for (i = 0; i < size / sizeof(UI_32); i++)
|
||||
{
|
||||
buf[i] = *p;
|
||||
}
|
||||
@@ -441,21 +446,21 @@ SINT_T sddep_read(void *src, void *dst, UI_32 size, SINT_T type,
|
||||
break;
|
||||
|
||||
case SDDR_RW_NOINC_WORD:
|
||||
for (i = 0; i < size/sizeof(UI_32); i++)
|
||||
for (i = 0; i < size / sizeof(UI_32); i++)
|
||||
{
|
||||
*(UI_32 *)dst = *(((UI_32 *)buf) + i);
|
||||
}
|
||||
break;
|
||||
|
||||
case SDDR_RW_NOINC_HWORD:
|
||||
for (i = 0; i < size/sizeof(UI_16); i++)
|
||||
for (i = 0; i < size / sizeof(UI_16); i++)
|
||||
{
|
||||
*(UI_16 *)dst = *(((UI_16 *)buf) + i);
|
||||
}
|
||||
break;
|
||||
|
||||
case SDDR_RW_NOINC_BYTE:
|
||||
for (i = 0; i < size/sizeof(UI_8); i++)
|
||||
for (i = 0; i < size / sizeof(UI_8); i++)
|
||||
{
|
||||
*(UI_8 *)dst = *(((UI_8 *)buf) + i);
|
||||
}
|
||||
@@ -485,7 +490,8 @@ SINT_T sddep_write(void *src, void *dst, UI_32 size, SINT_T type,
|
||||
lc823450_dmasetup(_hwdma[ch],
|
||||
LC823450_DMA_SRCWIDTH_WORD |
|
||||
LC823450_DMA_DSTWIDTH_WORD |
|
||||
(type == SDDR_RW_INC_WORD ? LC823450_DMA_SRCINC : 0),
|
||||
(type == SDDR_RW_INC_WORD ?
|
||||
LC823450_DMA_SRCINC : 0),
|
||||
(uint32_t)src, (uint32_t)dst, size / 4);
|
||||
break;
|
||||
|
||||
@@ -494,7 +500,8 @@ SINT_T sddep_write(void *src, void *dst, UI_32 size, SINT_T type,
|
||||
lc823450_dmasetup(_hwdma[ch],
|
||||
LC823450_DMA_SRCWIDTH_HWORD |
|
||||
LC823450_DMA_DSTWIDTH_WORD |
|
||||
(type == SDDR_RW_INC_HWORD ? LC823450_DMA_SRCINC : 0),
|
||||
(type == SDDR_RW_INC_HWORD ?
|
||||
LC823450_DMA_SRCINC : 0),
|
||||
(uint32_t)src, (uint32_t)dst, size / 2);
|
||||
break;
|
||||
|
||||
@@ -503,7 +510,8 @@ SINT_T sddep_write(void *src, void *dst, UI_32 size, SINT_T type,
|
||||
lc823450_dmasetup(_hwdma[ch],
|
||||
LC823450_DMA_SRCWIDTH_BYTE |
|
||||
LC823450_DMA_DSTWIDTH_WORD |
|
||||
(type == SDDR_RW_INC_BYTE ? LC823450_DMA_SRCINC : 0),
|
||||
(type == SDDR_RW_INC_BYTE ?
|
||||
LC823450_DMA_SRCINC : 0),
|
||||
(uint32_t)src, (uint32_t)dst, size);
|
||||
break;
|
||||
}
|
||||
@@ -525,21 +533,21 @@ SINT_T sddep_write(void *src, void *dst, UI_32 size, SINT_T type,
|
||||
break;
|
||||
|
||||
case SDDR_RW_NOINC_WORD:
|
||||
for (i = 0; i < size/sizeof(UI_32); i++)
|
||||
for (i = 0; i < size / sizeof(UI_32); i++)
|
||||
{
|
||||
*(((UI_32 *)buf) + i) = *(UI_32 *)src;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDDR_RW_NOINC_HWORD:
|
||||
for (i = 0; i < size/sizeof(UI_16); i++)
|
||||
for (i = 0; i < size / sizeof(UI_16); i++)
|
||||
{
|
||||
*(((UI_16 *)buf) + i) = *(UI_16 *)src;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDDR_RW_NOINC_BYTE:
|
||||
for (i = 0; i < size/sizeof(UI_8); i++)
|
||||
for (i = 0; i < size / sizeof(UI_8); i++)
|
||||
{
|
||||
*(((UI_8 *)buf) + i) = *(UI_8 *)src;
|
||||
}
|
||||
@@ -549,7 +557,7 @@ SINT_T sddep_write(void *src, void *dst, UI_32 size, SINT_T type,
|
||||
return -100;
|
||||
}
|
||||
|
||||
for (i = 0; i < size/sizeof(UI_32); i++)
|
||||
for (i = 0; i < size / sizeof(UI_32); i++)
|
||||
{
|
||||
*p = buf[i];
|
||||
}
|
||||
|
||||
@@ -638,11 +638,11 @@ static int lpc43_ciu_sendcmd(uint32_t cmd, uint32_t arg)
|
||||
|
||||
/* Poll until command is accepted by the CIU, or we timeout */
|
||||
|
||||
watchtime = clock_systimer();
|
||||
watchtime = clock_systime_ticks();
|
||||
|
||||
while ((lpc43_getreg(LPC43_SDMMC_CMD) & SDMMC_CMD_STARTCMD) != 0)
|
||||
{
|
||||
if (watchtime - clock_systimer() > SDCARD_CMDTIMEOUT)
|
||||
if (watchtime - clock_systime_ticks() > SDCARD_CMDTIMEOUT)
|
||||
{
|
||||
mcerr("TMO Timed out (%08X)\n",
|
||||
lpc43_getreg(LPC43_SDMMC_CMD));
|
||||
@@ -1944,10 +1944,10 @@ static int lpc43_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd)
|
||||
|
||||
/* Then wait for the response (or timeout or error) */
|
||||
|
||||
watchtime = clock_systimer();
|
||||
watchtime = clock_systime_ticks();
|
||||
while ((lpc43_getreg(LPC43_SDMMC_RINTSTS) & events) != events)
|
||||
{
|
||||
if (clock_systimer() - watchtime > timeout)
|
||||
if (clock_systime_ticks() - watchtime > timeout)
|
||||
{
|
||||
mcerr("ERROR: Timeout cmd: %04x events: %04x STA: %08x "
|
||||
"RINTSTS: %08x\n",
|
||||
|
||||
@@ -638,11 +638,11 @@ static int lpc54_ciu_sendcmd(uint32_t cmd, uint32_t arg)
|
||||
|
||||
/* Poll until command is accepted by the CIU, or we timeout */
|
||||
|
||||
watchtime = clock_systimer();
|
||||
watchtime = clock_systime_ticks();
|
||||
|
||||
while ((lpc54_getreg(LPC54_SDMMC_CMD) & SDMMC_CMD_STARTCMD) != 0)
|
||||
{
|
||||
if (watchtime - clock_systimer() > SDCARD_CMDTIMEOUT)
|
||||
if (watchtime - clock_systime_ticks() > SDCARD_CMDTIMEOUT)
|
||||
{
|
||||
mcerr("TMO Timed out (%08X)\n",
|
||||
lpc54_getreg(LPC54_SDMMC_CMD));
|
||||
@@ -1944,10 +1944,10 @@ static int lpc54_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd)
|
||||
|
||||
/* Then wait for the response (or timeout or error) */
|
||||
|
||||
watchtime = clock_systimer();
|
||||
watchtime = clock_systime_ticks();
|
||||
while ((lpc54_getreg(LPC54_SDMMC_RINTSTS) & events) != events)
|
||||
{
|
||||
if (clock_systimer() - watchtime > timeout)
|
||||
if (clock_systime_ticks() - watchtime > timeout)
|
||||
{
|
||||
mcerr("ERROR: Timeout cmd: %04x events: %04x STA: %08x "
|
||||
"RINTSTS: %08x\n",
|
||||
|
||||
@@ -169,7 +169,7 @@ static inline void max326_wdog_reset(FAR struct max326_wdt_lowerhalf_s *priv)
|
||||
putreg32(WDT0_RST_SEQ1, MAX326_WDT0_RST);
|
||||
putreg32(WDT0_RST_SEQ2, MAX326_WDT0_RST);
|
||||
|
||||
priv->lastping = clock_systimer();
|
||||
priv->lastping = clock_systime_ticks();
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -253,7 +253,7 @@ static uint32_t max326_time_left(FAR struct max326_wdt_lowerhalf_s *priv)
|
||||
exp = (ctrl & WDT0_CTRL_INTPERIOD_MASK) >> WDT0_CTRL_INTPERIOD_SHIFT;
|
||||
|
||||
timeout = max326_exp2msec(max326_pclk_frequency(), exp);
|
||||
elapsed = TICK2MSEC(clock_systimer() - priv->lastping);
|
||||
elapsed = TICK2MSEC(clock_systime_ticks() - priv->lastping);
|
||||
|
||||
if (elapsed > timeout)
|
||||
{
|
||||
|
||||
@@ -283,7 +283,7 @@ static int nrf52_start(FAR struct watchdog_lowerhalf_s *lower)
|
||||
if (!priv->started)
|
||||
{
|
||||
flags = enter_critical_section();
|
||||
priv->lastreset = clock_systimer();
|
||||
priv->lastreset = clock_systime_ticks();
|
||||
priv->started = true;
|
||||
nrf52_wdt_int_enable(WDT_INT_TIMEOUT);
|
||||
nrf52_wdt_task_trigger();
|
||||
@@ -345,7 +345,7 @@ static int nrf52_keepalive(FAR struct watchdog_lowerhalf_s *lower)
|
||||
|
||||
flags = enter_critical_section();
|
||||
|
||||
priv->lastreset = clock_systimer();
|
||||
priv->lastreset = clock_systime_ticks();
|
||||
nrf52_wdt_reload_request_set(0);
|
||||
|
||||
leave_critical_section(flags);
|
||||
@@ -394,7 +394,7 @@ static int nrf52_getstatus(FAR struct watchdog_lowerhalf_s *lower,
|
||||
|
||||
/* Get the elapsed time since the last ping */
|
||||
|
||||
ticks = clock_systimer() - priv->lastreset;
|
||||
ticks = clock_systime_ticks() - priv->lastreset;
|
||||
elapsed = (int32_t)TICK2MSEC(ticks);
|
||||
|
||||
if (elapsed > priv->timeout)
|
||||
|
||||
@@ -638,13 +638,13 @@ static inline int
|
||||
*/
|
||||
|
||||
priv->intstate = INTSTATE_WAITING;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Poll by simply calling the timer interrupt handler until it
|
||||
* reports that it is done.
|
||||
@@ -698,12 +698,12 @@ static inline void
|
||||
* detected, set by hardware when a timeout error is detected."
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Check for STOP condition */
|
||||
|
||||
@@ -835,7 +835,7 @@ static void s32k1xx_lpi2c_tracereset(FAR struct s32k1xx_lpi2c_priv_s *priv)
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->start_time = clock_systimer();
|
||||
priv->start_time = clock_systime_ticks();
|
||||
s32k1xx_lpi2c_traceclear(priv);
|
||||
}
|
||||
|
||||
@@ -869,7 +869,7 @@ static void s32k1xx_lpi2c_tracenew(FAR struct s32k1xx_lpi2c_priv_s *priv,
|
||||
s32k1xx_lpi2c_traceclear(priv);
|
||||
trace->status = status;
|
||||
trace->count = 1;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -912,7 +912,7 @@ static void s32k1xx_lpi2c_tracedump(FAR struct s32k1xx_lpi2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %ld\n",
|
||||
(long)(clock_systimer() - priv->start_time));
|
||||
(long)(clock_systime_ticks() - priv->start_time));
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
|
||||
@@ -645,13 +645,13 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
*/
|
||||
|
||||
priv->intstate = INTSTATE_WAITING;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Poll by simply calling the timer interrupt handler until it
|
||||
* reports that it is done.
|
||||
@@ -705,12 +705,12 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
|
||||
* detected, set by hardware when a timeout error is detected."
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Check for STOP condition */
|
||||
|
||||
@@ -816,7 +816,7 @@ static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv)
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->start_time = clock_systimer();
|
||||
priv->start_time = clock_systime_ticks();
|
||||
stm32_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
@@ -849,7 +849,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv, uint32_t statu
|
||||
stm32_i2c_traceclear(priv);
|
||||
trace->status = status;
|
||||
trace->count = 1;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -892,7 +892,7 @@ static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %ld\n",
|
||||
(long)(clock_systimer() - priv->start_time));
|
||||
(long)(clock_systime_ticks() - priv->start_time));
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
|
||||
@@ -654,13 +654,13 @@ static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
*/
|
||||
|
||||
priv->intstate = INTSTATE_WAITING;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Poll by simply calling the timer interrupt handler until it
|
||||
* reports that it is done.
|
||||
@@ -714,12 +714,12 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
|
||||
* detected, set by hardware when a timeout error is detected."
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Check for STOP condition */
|
||||
|
||||
@@ -825,7 +825,7 @@ static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv)
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->start_time = clock_systimer();
|
||||
priv->start_time = clock_systime_ticks();
|
||||
stm32_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
@@ -858,7 +858,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv, uint16_t statu
|
||||
stm32_i2c_traceclear(priv);
|
||||
trace->status = status;
|
||||
trace->count = 1;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -901,7 +901,7 @@ static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %ld\n",
|
||||
(long)(clock_systimer() - priv->start_time));
|
||||
(long)(clock_systime_ticks() - priv->start_time));
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
|
||||
@@ -861,13 +861,13 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
*/
|
||||
|
||||
priv->intstate = INTSTATE_WAITING;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Poll by simply calling the timer interrupt handler until it
|
||||
* reports that it is done.
|
||||
@@ -998,12 +998,12 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
|
||||
|
||||
/* Wait as stop might still be in progress */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Check for STOP condition */
|
||||
|
||||
@@ -1109,7 +1109,7 @@ static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv)
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->start_time = clock_systimer();
|
||||
priv->start_time = clock_systime_ticks();
|
||||
stm32_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
@@ -1143,7 +1143,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv,
|
||||
stm32_i2c_traceclear(priv);
|
||||
trace->status = status;
|
||||
trace->count = 1;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1186,7 +1186,7 @@ static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %d\n",
|
||||
(int)(clock_systimer() - priv->start_time));
|
||||
(int)(clock_systime_ticks() - priv->start_time));
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
@@ -2451,14 +2451,14 @@ static int stm32_i2c_process(FAR struct i2c_master_s *dev,
|
||||
* wraps up the transfer with a STOP condition.
|
||||
*/
|
||||
|
||||
clock_t start = clock_systimer();
|
||||
clock_t start = clock_systime_ticks();
|
||||
clock_t timeout = USEC2TICK(USEC_PER_SEC / priv->frequency) + 1;
|
||||
|
||||
status = stm32_i2c_getstatus(priv);
|
||||
|
||||
while (status & I2C_ISR_BUSY)
|
||||
{
|
||||
if ((clock_systimer() - start) > timeout)
|
||||
if ((clock_systime_ticks() - start) > timeout)
|
||||
{
|
||||
i2cerr("ERROR: I2C Bus busy");
|
||||
errval = EBUSY;
|
||||
|
||||
@@ -358,7 +358,7 @@ static int stm32_start(FAR struct watchdog_lowerhalf_s *lower)
|
||||
|
||||
flags = enter_critical_section();
|
||||
stm32_putreg(IWDG_KR_KEY_START, STM32_IWDG_KR);
|
||||
priv->lastreset = clock_systimer();
|
||||
priv->lastreset = clock_systime_ticks();
|
||||
priv->started = true;
|
||||
leave_critical_section(flags);
|
||||
}
|
||||
@@ -417,7 +417,7 @@ static int stm32_keepalive(FAR struct watchdog_lowerhalf_s *lower)
|
||||
|
||||
flags = enter_critical_section();
|
||||
stm32_putreg(IWDG_KR_KEY_RELOAD, STM32_IWDG_KR);
|
||||
priv->lastreset = clock_systimer();
|
||||
priv->lastreset = clock_systime_ticks();
|
||||
leave_critical_section(flags);
|
||||
|
||||
return OK;
|
||||
@@ -463,7 +463,7 @@ static int stm32_getstatus(FAR struct watchdog_lowerhalf_s *lower,
|
||||
|
||||
/* Get the elapsed time since the last ping */
|
||||
|
||||
ticks = clock_systimer() - priv->lastreset;
|
||||
ticks = clock_systime_ticks() - priv->lastreset;
|
||||
elapsed = (int32_t)TICK2MSEC(ticks);
|
||||
|
||||
if (elapsed > priv->timeout)
|
||||
|
||||
@@ -1647,7 +1647,7 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv,
|
||||
/* Loop while the device reports NAK (and a timeout is not exceeded */
|
||||
|
||||
chan = &priv->chan[ep0->outndx];
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
@@ -1696,7 +1696,7 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32_SETUP_DELAY);
|
||||
|
||||
@@ -1885,7 +1885,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
chan->xfrd = 0;
|
||||
xfrd = 0;
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
while (chan->xfrd < chan->buflen)
|
||||
{
|
||||
/* Set up for the wait BEFORE starting the transfer */
|
||||
@@ -1942,7 +1942,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
* if not then try again.
|
||||
*/
|
||||
|
||||
clock_t elapsed = clock_systimer() - start;
|
||||
clock_t elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed >= STM32_DATANAK_DELAY)
|
||||
{
|
||||
/* Timeout out... break out returning the NAK as
|
||||
@@ -2244,7 +2244,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv,
|
||||
*/
|
||||
|
||||
chan = &priv->chan[chidx];
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
xfrd = 0;
|
||||
zlp = (buflen == 0);
|
||||
|
||||
@@ -2295,7 +2295,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv,
|
||||
* pointer and buffer size will be unaltered.
|
||||
*/
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (ret != -EAGAIN || /* Not a NAK condition OR */
|
||||
elapsed >= STM32_DATANAK_DELAY || /* Timeout has elapsed OR */
|
||||
chan->xfrd > 0) /* Data has been partially transferred */
|
||||
@@ -4543,7 +4543,7 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the status OUT phase */
|
||||
@@ -4562,7 +4562,7 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32_DATANAK_DELAY);
|
||||
}
|
||||
@@ -4618,7 +4618,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the data OUT phase (if any) */
|
||||
@@ -4654,7 +4654,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32_DATANAK_DELAY);
|
||||
}
|
||||
|
||||
@@ -1648,7 +1648,7 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv,
|
||||
/* Loop while the device reports NAK (and a timeout is not exceeded */
|
||||
|
||||
chan = &priv->chan[ep0->outndx];
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
@@ -1697,7 +1697,7 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32_SETUP_DELAY);
|
||||
|
||||
@@ -1886,7 +1886,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
chan->xfrd = 0;
|
||||
xfrd = 0;
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
while (chan->xfrd < chan->buflen)
|
||||
{
|
||||
/* Set up for the wait BEFORE starting the transfer */
|
||||
@@ -1943,7 +1943,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
* if not then try again.
|
||||
*/
|
||||
|
||||
clock_t elapsed = clock_systimer() - start;
|
||||
clock_t elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed >= STM32_DATANAK_DELAY)
|
||||
{
|
||||
/* Timeout out... break out returning the NAK as
|
||||
@@ -2245,7 +2245,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv,
|
||||
*/
|
||||
|
||||
chan = &priv->chan[chidx];
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
xfrd = 0;
|
||||
zlp = (buflen == 0);
|
||||
|
||||
@@ -2296,7 +2296,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv,
|
||||
* pointer and buffer size will be unaltered.
|
||||
*/
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (ret != -EAGAIN || /* Not a NAK condition OR */
|
||||
elapsed >= STM32_DATANAK_DELAY || /* Timeout has elapsed OR */
|
||||
chan->xfrd > 0) /* Data has been partially transferred */
|
||||
@@ -4543,7 +4543,7 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the status OUT phase */
|
||||
@@ -4562,7 +4562,7 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32_DATANAK_DELAY);
|
||||
}
|
||||
@@ -4618,7 +4618,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the data OUT phase (if any) */
|
||||
@@ -4654,7 +4654,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32_DATANAK_DELAY);
|
||||
}
|
||||
|
||||
@@ -700,13 +700,13 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
*/
|
||||
|
||||
priv->intstate = INTSTATE_WAITING;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Poll by simply calling the timer interrupt handler until it
|
||||
* reports that it is done.
|
||||
@@ -760,12 +760,12 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
|
||||
* detected, set by hardware when a timeout error is detected."
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Check for STOP condition */
|
||||
|
||||
@@ -871,7 +871,7 @@ static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv)
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->start_time = clock_systimer();
|
||||
priv->start_time = clock_systime_ticks();
|
||||
stm32_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
@@ -904,7 +904,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv, uint32_t statu
|
||||
stm32_i2c_traceclear(priv);
|
||||
trace->status = status;
|
||||
trace->count = 1;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -947,7 +947,7 @@ static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %ld\n",
|
||||
(long)(clock_systimer() - priv->start_time));
|
||||
(long)(clock_systime_ticks() - priv->start_time));
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
|
||||
@@ -875,13 +875,13 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
*/
|
||||
|
||||
priv->intstate = INTSTATE_WAITING;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Poll by simply calling the timer interrupt handler until it
|
||||
* reports that it is done.
|
||||
@@ -1012,12 +1012,12 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
|
||||
|
||||
/* Wait as stop might still be in progress */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Check for STOP condition */
|
||||
|
||||
@@ -1123,7 +1123,7 @@ static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv)
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->start_time = clock_systimer();
|
||||
priv->start_time = clock_systime_ticks();
|
||||
stm32_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
@@ -1157,7 +1157,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv,
|
||||
stm32_i2c_traceclear(priv);
|
||||
trace->status = status;
|
||||
trace->count = 1;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1200,7 +1200,7 @@ static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %d\n",
|
||||
(int)(clock_systimer() - priv->start_time));
|
||||
(int)(clock_systime_ticks() - priv->start_time));
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
@@ -2461,14 +2461,14 @@ static int stm32_i2c_process(FAR struct i2c_master_s *dev,
|
||||
* wraps up the transfer with a STOP condition.
|
||||
*/
|
||||
|
||||
clock_t start = clock_systimer();
|
||||
clock_t start = clock_systime_ticks();
|
||||
clock_t timeout = USEC2TICK(USEC_PER_SEC / priv->frequency) + 1;
|
||||
|
||||
status = stm32_i2c_getstatus(priv);
|
||||
|
||||
while (status & I2C_ISR_BUSY)
|
||||
{
|
||||
if ((clock_systimer() - start) > timeout)
|
||||
if ((clock_systime_ticks() - start) > timeout)
|
||||
{
|
||||
i2cerr("ERROR: I2C Bus busy");
|
||||
errval = EBUSY;
|
||||
|
||||
@@ -899,13 +899,13 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
*/
|
||||
|
||||
priv->intstate = INTSTATE_WAITING;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Poll by simply calling the timer interrupt handler until it
|
||||
* reports that it is done.
|
||||
@@ -1036,12 +1036,12 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
|
||||
|
||||
/* Wait as stop might still be in progress */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Check for STOP condition */
|
||||
|
||||
@@ -1147,7 +1147,7 @@ static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv)
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->start_time = clock_systimer();
|
||||
priv->start_time = clock_systime_ticks();
|
||||
stm32_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
@@ -1181,7 +1181,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv,
|
||||
stm32_i2c_traceclear(priv);
|
||||
trace->status = status;
|
||||
trace->count = 1;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1224,7 +1224,7 @@ static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %d\n",
|
||||
(int)(clock_systimer() - priv->start_time));
|
||||
(int)(clock_systime_ticks() - priv->start_time));
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
@@ -2489,14 +2489,14 @@ static int stm32_i2c_process(FAR struct i2c_master_s *dev,
|
||||
* wraps up the transfer with a STOP condition.
|
||||
*/
|
||||
|
||||
clock_t start = clock_systimer();
|
||||
clock_t start = clock_systime_ticks();
|
||||
clock_t timeout = USEC2TICK(USEC_PER_SEC / priv->frequency) + 1;
|
||||
|
||||
status = stm32_i2c_getstatus(priv);
|
||||
|
||||
while (status & I2C_ISR_BUSY)
|
||||
{
|
||||
if ((clock_systimer() - start) > timeout)
|
||||
if ((clock_systime_ticks() - start) > timeout)
|
||||
{
|
||||
i2cerr("ERROR: I2C Bus busy");
|
||||
errval = EBUSY;
|
||||
|
||||
@@ -1649,7 +1649,7 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv,
|
||||
/* Loop while the device reports NAK (and a timeout is not exceeded */
|
||||
|
||||
chan = &priv->chan[ep0->outndx];
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
@@ -1698,7 +1698,7 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32_SETUP_DELAY);
|
||||
|
||||
@@ -1887,7 +1887,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
chan->xfrd = 0;
|
||||
xfrd = 0;
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
while (chan->xfrd < chan->buflen)
|
||||
{
|
||||
/* Set up for the wait BEFORE starting the transfer */
|
||||
@@ -1944,7 +1944,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
* if not then try again.
|
||||
*/
|
||||
|
||||
clock_t elapsed = clock_systimer() - start;
|
||||
clock_t elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed >= STM32_DATANAK_DELAY)
|
||||
{
|
||||
/* Timeout out... break out returning the NAK as
|
||||
@@ -2246,7 +2246,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv,
|
||||
*/
|
||||
|
||||
chan = &priv->chan[chidx];
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
xfrd = 0;
|
||||
zlp = (buflen == 0);
|
||||
|
||||
@@ -2297,7 +2297,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv,
|
||||
* pointer and buffer size will be unaltered.
|
||||
*/
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (ret != -EAGAIN || /* Not a NAK condition OR */
|
||||
elapsed >= STM32_DATANAK_DELAY || /* Timeout has elapsed OR */
|
||||
chan->xfrd > 0) /* Data has been partially transferred */
|
||||
@@ -4533,7 +4533,7 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the status OUT phase */
|
||||
@@ -4552,7 +4552,7 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32_DATANAK_DELAY);
|
||||
}
|
||||
@@ -4608,7 +4608,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the data OUT phase (if any) */
|
||||
@@ -4644,7 +4644,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32_DATANAK_DELAY);
|
||||
}
|
||||
|
||||
@@ -852,13 +852,13 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
*/
|
||||
|
||||
priv->intstate = INTSTATE_WAITING;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Poll by simply calling the timer interrupt handler until it
|
||||
* reports that it is done.
|
||||
@@ -989,12 +989,12 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
|
||||
|
||||
/* Wait as stop might still be in progress */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Check for STOP condition */
|
||||
|
||||
@@ -1100,7 +1100,7 @@ static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv)
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->start_time = clock_systimer();
|
||||
priv->start_time = clock_systime_ticks();
|
||||
stm32_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
@@ -1134,7 +1134,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv,
|
||||
stm32_i2c_traceclear(priv);
|
||||
trace->status = status;
|
||||
trace->count = 1;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1177,7 +1177,7 @@ static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %d\n",
|
||||
clock_systimer() - priv->start_time);
|
||||
clock_systime_ticks() - priv->start_time);
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
@@ -2434,14 +2434,14 @@ static int stm32_i2c_process(FAR struct i2c_master_s *dev,
|
||||
* wraps up the transfer with a STOP condition.
|
||||
*/
|
||||
|
||||
uint32_t start = clock_systimer();
|
||||
uint32_t start = clock_systime_ticks();
|
||||
uint32_t timeout = USEC2TICK(USEC_PER_SEC / priv->frequency) + 1;
|
||||
|
||||
status = stm32_i2c_getstatus(priv);
|
||||
|
||||
while ((status & I2C_ISR_BUSY) != 0)
|
||||
{
|
||||
if ((clock_systimer() - start) > timeout)
|
||||
if ((clock_systime_ticks() - start) > timeout)
|
||||
{
|
||||
i2cerr("ERROR: I2C Bus busy");
|
||||
errval = EBUSY;
|
||||
|
||||
@@ -358,7 +358,7 @@ static int stm32_start(FAR struct watchdog_lowerhalf_s *lower)
|
||||
|
||||
flags = enter_critical_section();
|
||||
stm32_putreg(IWDG_KR_KEY_START, STM32_IWDG_KR);
|
||||
priv->lastreset = clock_systimer();
|
||||
priv->lastreset = clock_systime_ticks();
|
||||
priv->started = true;
|
||||
leave_critical_section(flags);
|
||||
}
|
||||
@@ -417,7 +417,7 @@ static int stm32_keepalive(FAR struct watchdog_lowerhalf_s *lower)
|
||||
|
||||
flags = enter_critical_section();
|
||||
stm32_putreg(IWDG_KR_KEY_RELOAD, STM32_IWDG_KR);
|
||||
priv->lastreset = clock_systimer();
|
||||
priv->lastreset = clock_systime_ticks();
|
||||
leave_critical_section(flags);
|
||||
|
||||
return OK;
|
||||
@@ -463,7 +463,7 @@ static int stm32_getstatus(FAR struct watchdog_lowerhalf_s *lower,
|
||||
|
||||
/* Get the elapsed time since the last ping */
|
||||
|
||||
ticks = clock_systimer() - priv->lastreset;
|
||||
ticks = clock_systime_ticks() - priv->lastreset;
|
||||
elapsed = (int32_t)TICK2MSEC(ticks);
|
||||
|
||||
if (elapsed > priv->timeout)
|
||||
|
||||
@@ -1654,7 +1654,7 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv,
|
||||
/* Loop while the device reports NAK (and a timeout is not exceeded */
|
||||
|
||||
chan = &priv->chan[ep0->outndx];
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
@@ -1703,7 +1703,7 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32_SETUP_DELAY);
|
||||
|
||||
@@ -1892,7 +1892,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
chan->xfrd = 0;
|
||||
xfrd = 0;
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
while (chan->xfrd < chan->buflen)
|
||||
{
|
||||
/* Set up for the wait BEFORE starting the transfer */
|
||||
@@ -1949,7 +1949,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
* if not then try again.
|
||||
*/
|
||||
|
||||
clock_t elapsed = clock_systimer() - start;
|
||||
clock_t elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed >= STM32_DATANAK_DELAY)
|
||||
{
|
||||
/* Timeout out... break out returning the NAK as
|
||||
@@ -2251,7 +2251,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv,
|
||||
*/
|
||||
|
||||
chan = &priv->chan[chidx];
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
xfrd = 0;
|
||||
zlp = (buflen == 0);
|
||||
|
||||
@@ -2302,7 +2302,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv,
|
||||
* pointer and buffer size will be unaltered.
|
||||
*/
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (ret != -EAGAIN || /* Not a NAK condition OR */
|
||||
elapsed >= STM32_DATANAK_DELAY || /* Timeout has elapsed OR */
|
||||
chan->xfrd > 0) /* Data has been partially transferred */
|
||||
@@ -4539,7 +4539,7 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the status OUT phase */
|
||||
@@ -4558,7 +4558,7 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32_DATANAK_DELAY);
|
||||
}
|
||||
@@ -4614,7 +4614,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the data OUT phase (if any) */
|
||||
@@ -4650,7 +4650,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32_DATANAK_DELAY);
|
||||
}
|
||||
|
||||
@@ -893,13 +893,13 @@ static inline int stm32l4_i2c_sem_waitdone(FAR struct stm32l4_i2c_priv_s *priv)
|
||||
*/
|
||||
|
||||
priv->intstate = INTSTATE_WAITING;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Poll by simply calling the timer interrupt handler until it
|
||||
* reports that it is done.
|
||||
@@ -1030,12 +1030,12 @@ static inline void stm32l4_i2c_sem_waitstop(FAR struct stm32l4_i2c_priv_s *priv)
|
||||
|
||||
/* Wait as stop might still be in progress */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Check for STOP condition */
|
||||
|
||||
@@ -1142,7 +1142,7 @@ static void stm32l4_i2c_tracereset(FAR struct stm32l4_i2c_priv_s *priv)
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->start_time = clock_systimer();
|
||||
priv->start_time = clock_systime_ticks();
|
||||
stm32l4_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
@@ -1176,7 +1176,7 @@ static void stm32l4_i2c_tracenew(FAR struct stm32l4_i2c_priv_s *priv,
|
||||
stm32l4_i2c_traceclear(priv);
|
||||
trace->status = status;
|
||||
trace->count = 1;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1219,7 +1219,7 @@ static void stm32l4_i2c_tracedump(FAR struct stm32l4_i2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %d\n",
|
||||
(int)(clock_systimer() - priv->start_time));
|
||||
(int)(clock_systime_ticks() - priv->start_time));
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
@@ -2615,14 +2615,14 @@ static int stm32l4_i2c_process(FAR struct i2c_master_s *dev,
|
||||
* wraps up the transfer with a STOP condition.
|
||||
*/
|
||||
|
||||
clock_t start = clock_systimer();
|
||||
clock_t start = clock_systime_ticks();
|
||||
clock_t timeout = USEC2TICK(USEC_PER_SEC / priv->frequency) + 1;
|
||||
|
||||
status = stm32l4_i2c_getstatus(priv);
|
||||
|
||||
while (status & I2C_ISR_BUSY)
|
||||
{
|
||||
if ((clock_systimer() - start) > timeout)
|
||||
if ((clock_systime_ticks() - start) > timeout)
|
||||
{
|
||||
i2cerr("ERROR: I2C Bus busy");
|
||||
errval = EBUSY;
|
||||
|
||||
@@ -349,7 +349,7 @@ static int stm32l4_start(FAR struct watchdog_lowerhalf_s *lower)
|
||||
|
||||
flags = enter_critical_section();
|
||||
stm32l4_putreg(IWDG_KR_KEY_START, STM32L4_IWDG_KR);
|
||||
priv->lastreset = clock_systimer();
|
||||
priv->lastreset = clock_systime_ticks();
|
||||
priv->started = true;
|
||||
leave_critical_section(flags);
|
||||
}
|
||||
@@ -409,7 +409,7 @@ static int stm32l4_keepalive(FAR struct watchdog_lowerhalf_s *lower)
|
||||
|
||||
flags = enter_critical_section();
|
||||
stm32l4_putreg(IWDG_KR_KEY_RELOAD, STM32L4_IWDG_KR);
|
||||
priv->lastreset = clock_systimer();
|
||||
priv->lastreset = clock_systime_ticks();
|
||||
leave_critical_section(flags);
|
||||
|
||||
return OK;
|
||||
@@ -456,7 +456,7 @@ static int stm32l4_getstatus(FAR struct watchdog_lowerhalf_s *lower,
|
||||
|
||||
/* Get the elapsed time since the last ping */
|
||||
|
||||
ticks = clock_systimer() - priv->lastreset;
|
||||
ticks = clock_systime_ticks() - priv->lastreset;
|
||||
elapsed = (int32_t)TICK2MSEC(ticks);
|
||||
|
||||
if (elapsed > priv->timeout)
|
||||
|
||||
@@ -1667,7 +1667,7 @@ static int stm32l4_ctrl_sendsetup(FAR struct stm32l4_usbhost_s *priv,
|
||||
/* Loop while the device reports NAK (and a timeout is not exceeded */
|
||||
|
||||
chan = &priv->chan[ep0->outndx];
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
@@ -1716,7 +1716,7 @@ static int stm32l4_ctrl_sendsetup(FAR struct stm32l4_usbhost_s *priv,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32L4_SETUP_DELAY);
|
||||
|
||||
@@ -1906,7 +1906,7 @@ static ssize_t stm32l4_in_transfer(FAR struct stm32l4_usbhost_s *priv,
|
||||
chan->xfrd = 0;
|
||||
xfrd = 0;
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
while (chan->xfrd < chan->buflen)
|
||||
{
|
||||
/* Set up for the wait BEFORE starting the transfer */
|
||||
@@ -1963,7 +1963,7 @@ static ssize_t stm32l4_in_transfer(FAR struct stm32l4_usbhost_s *priv,
|
||||
* if not then try again.
|
||||
*/
|
||||
|
||||
clock_t elapsed = clock_systimer() - start;
|
||||
clock_t elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed >= STM32L4_DATANAK_DELAY)
|
||||
{
|
||||
/* Timeout out... break out returning the NAK as
|
||||
@@ -2265,7 +2265,7 @@ static ssize_t stm32l4_out_transfer(FAR struct stm32l4_usbhost_s *priv,
|
||||
*/
|
||||
|
||||
chan = &priv->chan[chidx];
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
xfrd = 0;
|
||||
zlp = (buflen == 0);
|
||||
|
||||
@@ -2316,7 +2316,7 @@ static ssize_t stm32l4_out_transfer(FAR struct stm32l4_usbhost_s *priv,
|
||||
* pointer and buffer size will be unaltered.
|
||||
*/
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (ret != -EAGAIN || /* Not a NAK condition OR */
|
||||
elapsed >= STM32L4_DATANAK_DELAY || /* Timeout has elapsed OR */
|
||||
chan->xfrd > 0) /* Data has been partially
|
||||
@@ -4573,7 +4573,7 @@ static int stm32l4_ctrlin(FAR struct usbhost_driver_s *drvr,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the status OUT phase */
|
||||
@@ -4592,7 +4592,7 @@ static int stm32l4_ctrlin(FAR struct usbhost_driver_s *drvr,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32L4_DATANAK_DELAY);
|
||||
}
|
||||
@@ -4650,7 +4650,7 @@ static int stm32l4_ctrlout(FAR struct usbhost_driver_s *drvr,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the data OUT phase (if any) */
|
||||
@@ -4685,7 +4685,7 @@ static int stm32l4_ctrlout(FAR struct usbhost_driver_s *drvr,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < STM32L4_DATANAK_DELAY);
|
||||
}
|
||||
|
||||
@@ -784,7 +784,7 @@ static inline int tiva_i2c_sem_waitdone(struct tiva_i2c_priv_s *priv)
|
||||
* nxsem_timedwait() sleeps.
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
@@ -800,7 +800,7 @@ static inline int tiva_i2c_sem_waitdone(struct tiva_i2c_priv_s *priv)
|
||||
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
|
||||
/* Loop until the transfer is complete. */
|
||||
@@ -895,7 +895,7 @@ static void tiva_i2c_tracereset(struct tiva_i2c_priv_s *priv)
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->tcount = 0;
|
||||
priv->ttime = clock_systimer();
|
||||
priv->ttime = clock_systime_ticks();
|
||||
priv->tstatus = 0;
|
||||
tiva_i2c_traceclear(priv);
|
||||
}
|
||||
@@ -929,7 +929,7 @@ static void tiva_i2c_tracenew(struct tiva_i2c_priv_s *priv, uint32_t status)
|
||||
tiva_i2c_traceclear(priv);
|
||||
trace->status = status;
|
||||
trace->count = 1;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
|
||||
/* Save the status and reset the count */
|
||||
|
||||
@@ -959,7 +959,7 @@ static void tiva_i2c_traceevent(struct tiva_i2c_priv_s *priv,
|
||||
trace->event = event;
|
||||
trace->parm = parm;
|
||||
trace->count = priv->tcount;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
|
||||
/* Bump up the trace index (unless we are out of trace entries) */
|
||||
|
||||
@@ -976,7 +976,7 @@ static void tiva_i2c_traceevent(struct tiva_i2c_priv_s *priv,
|
||||
trace = &priv->trace[priv->tndx];
|
||||
trace->status = priv->tstatus;
|
||||
trace->count = priv->tcount;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -991,7 +991,7 @@ static void tiva_i2c_tracedump(struct tiva_i2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %ld\n",
|
||||
(long)(clock_systimer() - priv->ttime));
|
||||
(long)(clock_systime_ticks() - priv->ttime));
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
|
||||
@@ -497,7 +497,7 @@ static void pic32mz_i2c_tracereset(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
priv->tndx = 0;
|
||||
priv->start_time = clock_systimer();
|
||||
priv->start_time = clock_systime_ticks();
|
||||
pic32mz_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ static void pic32mz_i2c_tracenew(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
pic32mz_i2c_traceclear(priv);
|
||||
trace->status = status;
|
||||
trace->count = 1;
|
||||
trace->time = clock_systimer();
|
||||
trace->time = clock_systime_ticks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -574,7 +574,7 @@ static void pic32mz_i2c_tracedump(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
int i;
|
||||
|
||||
syslog(LOG_DEBUG, "Elapsed time: %ld\n",
|
||||
(long)(clock_systimer() - priv->start_time));
|
||||
(long)(clock_systime_ticks() - priv->start_time));
|
||||
|
||||
for (i = 0; i < priv->tndx; i++)
|
||||
{
|
||||
@@ -768,13 +768,13 @@ static inline int
|
||||
*/
|
||||
|
||||
priv->intstate = INTSTATE_WAITING;
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
/* Calculate the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* Poll by simply calling the timer interrupt handler until it
|
||||
* reports that it is done.
|
||||
@@ -823,10 +823,10 @@ static inline void
|
||||
timeout = CONFIG_PIC32MZ_I2CTIMEOTICKS;
|
||||
#endif
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
|
||||
/* The bus is idle if the five least significant bits of I2CxCON
|
||||
* are cleared and the I2CxSTAT<TRSTAT> flag is cleared.
|
||||
|
||||
+2
-2
@@ -221,7 +221,7 @@ static int ft80x_fade(FAR struct ft80x_dev_s *priv,
|
||||
delay = 1;
|
||||
}
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
do
|
||||
{
|
||||
@@ -231,7 +231,7 @@ static int ft80x_fade(FAR struct ft80x_dev_s *priv,
|
||||
|
||||
/* Get the elapsed time */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed > INT32_MAX || (int32_t)elapsed >= delay)
|
||||
{
|
||||
duty = endduty;
|
||||
|
||||
@@ -1233,7 +1233,7 @@ static int mmcsd_transferready(FAR struct mmcsd_state_s *priv)
|
||||
}
|
||||
#endif
|
||||
|
||||
starttime = clock_systimer();
|
||||
starttime = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Get the current R1 status from the card */
|
||||
@@ -1280,7 +1280,7 @@ static int mmcsd_transferready(FAR struct mmcsd_state_s *priv)
|
||||
* time... we can't stay in this loop forever!
|
||||
*/
|
||||
|
||||
elapsed = clock_systimer() - starttime;
|
||||
elapsed = clock_systime_ticks() - starttime;
|
||||
}
|
||||
while (elapsed < TICK_PER_SEC);
|
||||
|
||||
@@ -3195,7 +3195,7 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv)
|
||||
* but not MMC
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
elapsed = 0;
|
||||
do
|
||||
{
|
||||
@@ -3360,7 +3360,7 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv)
|
||||
|
||||
/* Check the elapsed time. We won't keep trying this forever! */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < TICK_PER_SEC); /* On successful reception while 'breaks', see above. */
|
||||
|
||||
|
||||
@@ -118,8 +118,8 @@
|
||||
#define MMCSD_DELAY_1SEC (CLK_TCK + 1)
|
||||
#define MMCSD_DELAY_10SEC (10 * CLK_TCK + 1)
|
||||
|
||||
#define ELAPSED_TIME(t) (clock_systimer()-(t))
|
||||
#define START_TIME (clock_systimer())
|
||||
#define ELAPSED_TIME(t) (clock_systime_ticks()-(t))
|
||||
#define START_TIME (clock_systime_ticks())
|
||||
|
||||
/* SD read timeout: ~100msec, Write Time out ~250ms. Units of clock ticks */
|
||||
|
||||
|
||||
@@ -426,7 +426,7 @@ static int sst39vf_chiperase(FAR struct sst39vf_dev_s *priv)
|
||||
wrinfo.address = CONFIG_SST39VF_BASE_ADDRESS;
|
||||
wrinfo.data = 0xffff;
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
while (delay < MSEC2TICK(SST39VF_TSCE_MSEC))
|
||||
{
|
||||
/* Check if the erase is complete */
|
||||
@@ -438,7 +438,7 @@ static int sst39vf_chiperase(FAR struct sst39vf_dev_s *priv)
|
||||
|
||||
/* No, check if the timeout has elapsed */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed > MSEC2TICK(SST39VF_TSCE_MSEC))
|
||||
{
|
||||
return -ETIMEDOUT;
|
||||
@@ -502,7 +502,7 @@ static int sst39vf_sectorerase(FAR struct sst39vf_dev_s *priv,
|
||||
*/
|
||||
|
||||
#if 0
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
while (delay < MSEC2TICK(SST39VF_TSE_MSEC))
|
||||
{
|
||||
/* Check if the erase is complete */
|
||||
@@ -514,7 +514,7 @@ static int sst39vf_sectorerase(FAR struct sst39vf_dev_s *priv,
|
||||
|
||||
/* No, check if the timeout has elapsed */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed > MSEC2TICK(SST39VF_TSE_MSEC))
|
||||
{
|
||||
return -ETIMEDOUT;
|
||||
|
||||
@@ -750,7 +750,7 @@ static void enc_wrbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg,
|
||||
static int enc_waitbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg,
|
||||
uint8_t bits, uint8_t value)
|
||||
{
|
||||
clock_t start = clock_systimer();
|
||||
clock_t start = clock_systime_ticks();
|
||||
clock_t elapsed;
|
||||
uint8_t rddata;
|
||||
|
||||
@@ -761,7 +761,7 @@ static int enc_waitbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg,
|
||||
/* Read the byte from the requested banked register */
|
||||
|
||||
rddata = enc_rdbreg(priv, ctrlreg);
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while ((rddata & bits) != value && elapsed < ENC_POLLTIMEOUT);
|
||||
|
||||
|
||||
@@ -645,7 +645,7 @@ static void enc_wrreg(FAR struct enc_driver_s *priv, uint16_t ctrlreg,
|
||||
static int enc_waitreg(FAR struct enc_driver_s *priv, uint16_t ctrlreg,
|
||||
uint16_t bits, uint16_t value)
|
||||
{
|
||||
clock_t start = clock_systimer();
|
||||
clock_t start = clock_systime_ticks();
|
||||
clock_t elapsed;
|
||||
uint16_t rddata;
|
||||
|
||||
@@ -656,7 +656,7 @@ static int enc_waitreg(FAR struct enc_driver_s *priv, uint16_t ctrlreg,
|
||||
/* Read the byte from the requested banked register */
|
||||
|
||||
rddata = enc_rdreg(priv, ctrlreg);
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while ((rddata & bits) != value && elapsed < ENC_REGPOLLTIMEOUT);
|
||||
|
||||
|
||||
+2
-2
@@ -455,7 +455,7 @@ static int slip_txtask(int argc, FAR char *argv[])
|
||||
|
||||
/* Loop forever */
|
||||
|
||||
start_ticks = clock_systimer();
|
||||
start_ticks = clock_systime_ticks();
|
||||
for (; ; )
|
||||
{
|
||||
/* Wait for the timeout to expire (or until we are signaled by */
|
||||
@@ -489,7 +489,7 @@ static int slip_txtask(int argc, FAR char *argv[])
|
||||
|
||||
/* Has a half second elapsed since the last timer poll? */
|
||||
|
||||
now_ticks = clock_systimer();
|
||||
now_ticks = clock_systime_ticks();
|
||||
hsec = (unsigned int)((now_ticks - start_ticks) / TICK_PER_HSEC);
|
||||
if (hsec > 0)
|
||||
{
|
||||
|
||||
@@ -228,8 +228,8 @@ static void governor_initialize(void)
|
||||
for (i = 0; i < CONFIG_PM_NDOMAINS; i++)
|
||||
{
|
||||
pdomstate = &g_pm_activity_governor.domain_states[i];
|
||||
pdomstate->stime = clock_systimer();
|
||||
pdomstate->btime = clock_systimer();
|
||||
pdomstate->stime = clock_systime_ticks();
|
||||
pdomstate->btime = clock_systime_ticks();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ static void governor_activity(int domain, int count)
|
||||
* level may be over-estimated.
|
||||
*/
|
||||
|
||||
now = clock_systimer();
|
||||
now = clock_systime_ticks();
|
||||
elapsed = now - pdomstate->stime;
|
||||
if (elapsed >= TIME_SLICE_TICKS)
|
||||
{
|
||||
@@ -419,7 +419,7 @@ static void governor_update(int domain, int16_t accum)
|
||||
{
|
||||
/* Yes... reset the count and recommend the normal state. */
|
||||
|
||||
pdomstate->btime = clock_systimer();
|
||||
pdomstate->btime = clock_systime_ticks();
|
||||
pdomstate->recommended = PM_NORMAL;
|
||||
return;
|
||||
}
|
||||
@@ -450,7 +450,7 @@ static void governor_update(int domain, int16_t accum)
|
||||
{
|
||||
/* No... reset the count and recommend the current state */
|
||||
|
||||
pdomstate->btime = clock_systimer();
|
||||
pdomstate->btime = clock_systime_ticks();
|
||||
pdomstate->recommended = state;
|
||||
}
|
||||
|
||||
@@ -462,14 +462,14 @@ static void governor_update(int domain, int16_t accum)
|
||||
* for a state transition?
|
||||
*/
|
||||
|
||||
if (clock_systimer() - pdomstate->btime >=
|
||||
if (clock_systime_ticks() - pdomstate->btime >=
|
||||
g_pm_activity_governor.pmcount[index] * TIME_SLICE_TICKS)
|
||||
{
|
||||
/* Yes, recommend the new state and set up for the next
|
||||
* transition.
|
||||
*/
|
||||
|
||||
pdomstate->btime = clock_systimer();
|
||||
pdomstate->btime = clock_systime_ticks();
|
||||
pdomstate->recommended = nextstate;
|
||||
}
|
||||
}
|
||||
@@ -504,7 +504,7 @@ static enum pm_state_e governor_checkstate(int domain)
|
||||
* estimated.
|
||||
*/
|
||||
|
||||
now = clock_systimer();
|
||||
now = clock_systime_ticks();
|
||||
elapsed = now - pdomstate->stime;
|
||||
if (elapsed >= TIME_SLICE_TICKS)
|
||||
{
|
||||
@@ -597,7 +597,7 @@ static void governor_timer(int domain)
|
||||
|
||||
if (state < PM_SLEEP && !pdom->stay[pdom->state])
|
||||
{
|
||||
int delay = pmtick[state] + pdomstate->btime - clock_systimer();
|
||||
int delay = pmtick[state] + pdomstate->btime - clock_systime_ticks();
|
||||
int left = wd_gettime(pdomstate->wdog);
|
||||
|
||||
if (delay <= 0)
|
||||
|
||||
@@ -495,7 +495,7 @@ static int uart_tcdrain(FAR uart_dev_t *dev, clock_t timeout)
|
||||
* all also cause the lower half driver to clear and reset the Tx FIFO.
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
if (ret >= 0)
|
||||
{
|
||||
@@ -507,7 +507,7 @@ static int uart_tcdrain(FAR uart_dev_t *dev, clock_t timeout)
|
||||
|
||||
/* Check for a timeout */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed >= timeout)
|
||||
{
|
||||
return -ETIMEDOUT;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/****************************************************************************
|
||||
* drivers/syslog/vsyslog.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011-2014, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2011-2014, 2016-2017 Gregory Nutt.
|
||||
* All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -97,7 +98,7 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
|
||||
#else
|
||||
/* Otherwise, fall back to the system timer */
|
||||
|
||||
ret = clock_systimespec(&ts);
|
||||
ret = clock_systime_timespec(&ts);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -132,7 +133,7 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
|
||||
/* Pre-pend the message with the current time, if available */
|
||||
|
||||
ret = lib_sprintf(&stream.public, "[%5d.%06d] ",
|
||||
ts.tv_sec, ts.tv_nsec/1000);
|
||||
ts.tv_sec, ts.tv_nsec / 1000);
|
||||
#else
|
||||
ret = 0;
|
||||
#endif
|
||||
|
||||
@@ -1849,7 +1849,7 @@ static ssize_t max3421e_out_transfer(FAR struct max3421e_usbhost_s *priv,
|
||||
* or a fatal error occurs (any error other than a simple NAK)
|
||||
*/
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
xfrd = 0;
|
||||
|
||||
while (buflen > 0)
|
||||
@@ -1902,7 +1902,7 @@ static ssize_t max3421e_out_transfer(FAR struct max3421e_usbhost_s *priv,
|
||||
* pointer and buffer size will be unaltered.
|
||||
*/
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
if (ret != -EAGAIN || /* Not a NAK condition OR */
|
||||
elapsed >= MAX3421E_DATANAK_DELAY || /* Timeout has elapsed OR */
|
||||
priv->xfrd > 0) /* Data has been partially transferred */
|
||||
@@ -2071,7 +2071,7 @@ static int max3421e_ctrl_sendsetup(FAR struct max3421e_usbhost_s *priv,
|
||||
|
||||
/* Loop while the device reports NAK (and a timeout is not exceeded */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Send the SETUP packet */
|
||||
@@ -2146,7 +2146,7 @@ static int max3421e_ctrl_sendsetup(FAR struct max3421e_usbhost_s *priv,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < MAX3421E_SETUP_DELAY);
|
||||
|
||||
@@ -2687,7 +2687,7 @@ static ssize_t max3421e_in_transfer(FAR struct max3421e_usbhost_s *priv,
|
||||
priv->xfrd = 0;
|
||||
xfrd = 0;
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
while (priv->xfrd < priv->buflen)
|
||||
{
|
||||
/* Set up for the wait BEFORE starting the transfer */
|
||||
@@ -2747,7 +2747,7 @@ static ssize_t max3421e_in_transfer(FAR struct max3421e_usbhost_s *priv,
|
||||
* if not then try again.
|
||||
*/
|
||||
|
||||
clock_t elapsed = clock_systimer() - start;
|
||||
clock_t elapsed = clock_systime_ticks() - start;
|
||||
if (elapsed >= MAX3421E_DATANAK_DELAY)
|
||||
{
|
||||
/* Timeout out... break out returning the NAK as
|
||||
@@ -4090,7 +4090,7 @@ static int max3421e_ctrlin(FAR struct usbhost_driver_s *drvr,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the IN data phase (if any) */
|
||||
@@ -4127,7 +4127,7 @@ static int max3421e_ctrlin(FAR struct usbhost_driver_s *drvr,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < MAX3421E_DATANAK_DELAY);
|
||||
}
|
||||
@@ -4190,7 +4190,7 @@ static int max3421e_ctrlout(FAR struct usbhost_driver_s *drvr,
|
||||
|
||||
/* Get the start time. Loop again until the timeout expires */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
do
|
||||
{
|
||||
/* Handle the data OUT phase (if any) */
|
||||
@@ -4229,7 +4229,7 @@ static int max3421e_ctrlout(FAR struct usbhost_driver_s *drvr,
|
||||
|
||||
/* Get the elapsed time (in frames) */
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (elapsed < MAX3421E_DATANAK_DELAY);
|
||||
}
|
||||
|
||||
@@ -683,7 +683,8 @@ static void nrf24l01_worker(FAR void *arg)
|
||||
* - Read payload content
|
||||
*/
|
||||
|
||||
pipeno = (status & NRF24L01_RX_P_NO_MASK) >> NRF24L01_RX_P_NO_SHIFT;
|
||||
pipeno = (status & NRF24L01_RX_P_NO_MASK) >>
|
||||
NRF24L01_RX_P_NO_SHIFT;
|
||||
if (pipeno >= NRF24L01_PIPE_COUNT) /* 6=invalid 7=fifo empty */
|
||||
{
|
||||
wlerr("invalid pipe rx: %d\n", (int)pipeno);
|
||||
@@ -711,7 +712,8 @@ static void nrf24l01_worker(FAR void *arg)
|
||||
|
||||
/* Get payload content */
|
||||
|
||||
nrf24l01_access(dev, MODE_READ, NRF24L01_R_RX_PAYLOAD, buf, pktlen);
|
||||
nrf24l01_access(dev, MODE_READ,
|
||||
NRF24L01_R_RX_PAYLOAD, buf, pktlen);
|
||||
|
||||
fifoput(dev, pipeno, buf, pktlen);
|
||||
has_data = true;
|
||||
@@ -860,7 +862,7 @@ static int dosend(FAR struct nrf24l01_dev_s *dev, FAR const uint8_t *data,
|
||||
|
||||
/* Wait for IRQ (TX_DS or MAX_RT) - but don't hang on lost IRQ */
|
||||
|
||||
ret = nxsem_tickwait(&dev->sem_tx, clock_systimer(),
|
||||
ret = nxsem_tickwait(&dev->sem_tx, clock_systime_ticks(),
|
||||
MSEC2TICK(NRF24L01_MAX_TX_IRQ_WAIT));
|
||||
|
||||
/* Re-acquire the SPI bus */
|
||||
@@ -1201,7 +1203,7 @@ static int nrf24l01_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
case NRF24L01IOC_GETRETRCFG: /* Get retransmit params. arg: Pointer
|
||||
* to nrf24l01_retrcfg_t */
|
||||
ret = -ENOSYS; /* TODO */
|
||||
ret = -ENOSYS; /* TODO */
|
||||
break;
|
||||
|
||||
case NRF24L01IOC_SETPIPESCFG:
|
||||
@@ -1802,7 +1804,8 @@ int nrf24l01_setretransmit(FAR struct nrf24l01_dev_s *dev,
|
||||
|
||||
CHECK_ARGS(dev && retrcount <= NRF24L01_MAX_XMIT_RETR);
|
||||
|
||||
val = (retrdelay << NRF24L01_ARD_SHIFT) | (retrcount << NRF24L01_ARC_SHIFT);
|
||||
val = (retrdelay << NRF24L01_ARD_SHIFT) |
|
||||
(retrcount << NRF24L01_ARC_SHIFT);
|
||||
|
||||
nrf24l01_lock(dev->spi);
|
||||
|
||||
|
||||
@@ -670,7 +670,7 @@ int spirit_waitstatus(FAR struct spirit_library_s *spirit,
|
||||
|
||||
/* The time that we started the wait */
|
||||
|
||||
start = clock_systimer();
|
||||
start = clock_systime_ticks();
|
||||
|
||||
/* Loop until the status change occurs (or the wait times out) */
|
||||
|
||||
@@ -682,7 +682,7 @@ int spirit_waitstatus(FAR struct spirit_library_s *spirit,
|
||||
return ret;
|
||||
}
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
elapsed = clock_systime_ticks() - start;
|
||||
}
|
||||
while (spirit->u.state.MC_STATE != state && elapsed <= ticks);
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ static ssize_t uptime_read(FAR struct file *filep, FAR char *buffer,
|
||||
{
|
||||
/* System time */
|
||||
|
||||
ticktime = clock_systimer() - INITIAL_SYSTEM_TIMER_TICKS;
|
||||
ticktime = clock_systime_ticks() - INITIAL_SYSTEM_TIMER_TICKS;
|
||||
|
||||
#if defined(CONFIG_HAVE_DOUBLE) && defined(CONFIG_LIBC_FLOATINGPOINT)
|
||||
/* Convert the up time to a seconds + hundredths of seconds string */
|
||||
|
||||
+1
-1
@@ -468,7 +468,7 @@ int nx_poll(FAR struct pollfd *fds, unsigned int nfds, int timeout)
|
||||
* will return immediately.
|
||||
*/
|
||||
|
||||
ret = nxsem_tickwait(&sem, clock_systimer(), ticks);
|
||||
ret = nxsem_tickwait(&sem, clock_systime_ticks(), ticks);
|
||||
if (ret < 0)
|
||||
{
|
||||
if (ret == -ETIMEDOUT)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user