mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
Macro clock_systimer replaces direct access to g_system_timer variable
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3500 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -1095,7 +1095,7 @@ static int mmcsd_transferready(FAR struct mmcsd_state_s *priv)
|
||||
* the TRANSFER state when the card completes the WRITE operation.
|
||||
*/
|
||||
|
||||
starttime = g_system_timer;
|
||||
starttime = clock_systimer();
|
||||
do
|
||||
{
|
||||
/* Get the current R1 status from the card */
|
||||
@@ -1138,7 +1138,7 @@ static int mmcsd_transferready(FAR struct mmcsd_state_s *priv)
|
||||
* time... we can't stay in this loop forever!
|
||||
*/
|
||||
|
||||
elapsed = g_system_timer - starttime;
|
||||
elapsed = clock_systimer() - starttime;
|
||||
}
|
||||
while (elapsed < TICK_PER_SEC);
|
||||
return -ETIMEDOUT;
|
||||
@@ -2476,7 +2476,7 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv)
|
||||
* exits the IDLE state. CMD55 is supported by SD V1.x and SD V2.x,
|
||||
* but not MMC
|
||||
*/
|
||||
|
||||
|
||||
start = clock_systimer();
|
||||
elapsed = 0;
|
||||
do
|
||||
@@ -2620,7 +2620,7 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv)
|
||||
}
|
||||
#endif
|
||||
/* Check the elapsed time. We won't keep trying this forever! */
|
||||
|
||||
|
||||
elapsed = clock_systimer() - start;
|
||||
}
|
||||
while( elapsed < TICK_PER_SEC ); /* On successful reception while 'breaks', see above. */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* drivers/mmcsd/mmcsd_spi.c
|
||||
*
|
||||
* Copyright (C) 2008-2010 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2010, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -122,8 +122,8 @@
|
||||
#define MMCSD_DELAY_1SEC (CLK_TCK + 1)
|
||||
#define MMCSD_DELAY_10SEC (10 * CLK_TCK + 1)
|
||||
|
||||
#define ELAPSED_TIME(t) (g_system_timer-(t))
|
||||
#define START_TIME (g_system_timer)
|
||||
#define ELAPSED_TIME(t) (clock_systimer()-(t))
|
||||
#define START_TIME (clock_systimer())
|
||||
|
||||
/* SD read timeout: ~100msec, Write Time out ~250ms. Units of clock ticks */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* drivers/net/enc28j60.c
|
||||
*
|
||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* References:
|
||||
@@ -658,7 +658,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)
|
||||
{
|
||||
uint32_t start = g_system_timer;
|
||||
uint32_t start = clock_systimer();
|
||||
uint32_t elapsed;
|
||||
uint8_t rddata;
|
||||
|
||||
@@ -669,7 +669,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 = g_system_timer - start;
|
||||
elapsed = clock_systimer() - start;
|
||||
}
|
||||
while ((rddata & bits) != value || elapsed > ENC_POLLTIMEOUT);
|
||||
return (rddata & bits) == value ? -ETIMEDOUT : OK;
|
||||
|
||||
Reference in New Issue
Block a user