From 7cbeae30b426e0912d1814c76e6223fb0842a9fc Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 13 Apr 2011 21:44:24 +0000 Subject: 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 --- nuttx/net/net_timeo.c | 4 ++-- nuttx/net/recvfrom.c | 4 ++-- nuttx/net/send.c | 4 ++-- nuttx/net/uip/uip_icmpping.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'nuttx/net') diff --git a/nuttx/net/net_timeo.c b/nuttx/net/net_timeo.c index 191136fca..42d1aff0a 100644 --- a/nuttx/net/net_timeo.c +++ b/nuttx/net/net_timeo.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/net_timeo.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -72,7 +72,7 @@ int net_timeo(uint32_t start_time, socktimeo_t timeo) { uint32_t timeo_ticks = DSEC2TICK(timeo); - uint32_t elapsed = g_system_timer - start_time; + uint32_t elapsed = clock_systimer() - start_time; if (elapsed >= timeo_ticks) { diff --git a/nuttx/net/recvfrom.c b/nuttx/net/recvfrom.c index c35937cce..335e2b322 100644 --- a/nuttx/net/recvfrom.c +++ b/nuttx/net/recvfrom.c @@ -415,7 +415,7 @@ static uint16_t recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn, */ #if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK) - pstate->rf_starttime = g_system_timer; + pstate->rf_starttime = clock_systimer(); #endif } @@ -679,7 +679,7 @@ static void recvfrom_init(FAR struct socket *psock, FAR void *buf, size_t len, pstate->rf_sock = psock; #if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK) - pstate->rf_starttime = g_system_timer; + pstate->rf_starttime = clock_systimer(); #endif } #endif /* CONFIG_NET_UDP || CONFIG_NET_TCP */ diff --git a/nuttx/net/send.c b/nuttx/net/send.c index 1b4407db1..ffa689996 100644 --- a/nuttx/net/send.c +++ b/nuttx/net/send.c @@ -290,7 +290,7 @@ static uint16_t send_interrupt(struct uip_driver_s *dev, void *pvconn, /* Update the send time */ #if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK) - pstate->snd_time = g_system_timer; + pstate->snd_time = clock_systimer(); #endif } } @@ -463,7 +463,7 @@ ssize_t send(int sockfd, const void *buf, size_t len, int flags) /* Update the initial time for calculating timeouts */ #if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK) - state.snd_time = g_system_timer; + state.snd_time = clock_systimer(); #endif /* Set up the callback in the connection */ diff --git a/nuttx/net/uip/uip_icmpping.c b/nuttx/net/uip/uip_icmpping.c index 0799d1412..2832a4a83 100644 --- a/nuttx/net/uip/uip_icmpping.c +++ b/nuttx/net/uip/uip_icmpping.c @@ -118,7 +118,7 @@ struct icmp_ping_s static inline int ping_timeout(struct icmp_ping_s *pstate) { - uint32_t elapsed = g_system_timer - pstate->png_time; + uint32_t elapsed = clock_systimer() - pstate->png_time; if (elapsed >= pstate->png_ticks) { return TRUE; @@ -329,7 +329,7 @@ int uip_ping(uip_ipaddr_t addr, uint16_t id, uint16_t seqno, state.png_sent = false; /* ECHO request not yet sent */ save = uip_lock(); - state.png_time = g_system_timer; + state.png_time = clock_systimer(); /* Set up the callback */ -- cgit v1.2.3