You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by we...@apache.org on 2016/10/10 20:53:47 UTC
incubator-mynewt-core git commit: MYNEWT-431: Fix global symbol
conflict between hal_cputime and os_cputime
Repository: incubator-mynewt-core
Updated Branches:
refs/heads/develop ac2d49e31 -> d0d87ab75
MYNEWT-431: Fix global symbol conflict between hal_cputime and os_cputime
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/d0d87ab7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/d0d87ab7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/d0d87ab7
Branch: refs/heads/develop
Commit: d0d87ab75319dafe1e6a4952d6886958bcdb8f1a
Parents: ac2d49e
Author: William San Filippo <wi...@runtime.io>
Authored: Mon Oct 10 13:53:10 2016 -0700
Committer: William San Filippo <wi...@runtime.io>
Committed: Mon Oct 10 13:53:10 2016 -0700
----------------------------------------------------------------------
kernel/os/src/os_cputime.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d0d87ab7/kernel/os/src/os_cputime.c
----------------------------------------------------------------------
diff --git a/kernel/os/src/os_cputime.c b/kernel/os/src/os_cputime.c
index ad846d7..ccf0f2c 100644
--- a/kernel/os/src/os_cputime.c
+++ b/kernel/os/src/os_cputime.c
@@ -25,7 +25,7 @@
#if defined(MYNEWT_VAL_OS_CPUTIME_TIMER_NUM)
-struct os_cputime_data g_cputime;
+struct os_cputime_data g_os_cputime;
/**
* os cputime init
@@ -44,7 +44,7 @@ os_cputime_init(uint32_t clock_freq)
int rc;
/* Set the ticks per microsecond. */
- g_cputime.ticks_per_usec = clock_freq / 1000000U;
+ g_os_cputime.ticks_per_usec = clock_freq / 1000000U;
rc = hal_timer_init(MYNEWT_VAL(OS_CPUTIME_TIMER_NUM), clock_freq);
return rc;
}
@@ -66,7 +66,7 @@ os_cputime_nsecs_to_ticks(uint32_t nsecs)
#if defined(OS_CPUTIME_FREQ_1MHZ)
ticks = (nsecs + 999) / 1000;
#else
- ticks = ((nsecs * g_cputime.ticks_per_usec) + 999) / 1000;
+ ticks = ((nsecs * g_os_cputime.ticks_per_usec) + 999) / 1000;
#endif
return ticks;
}
@@ -88,8 +88,8 @@ os_cputime_ticks_to_nsecs(uint32_t ticks)
#if defined(OS_CPUTIME_FREQ_1MHZ)
nsecs = ticks * 1000;
#else
- nsecs = ((ticks * 1000) + (g_cputime.ticks_per_usec - 1)) /
- g_cputime.ticks_per_usec;
+ nsecs = ((ticks * 1000) + (g_os_cputime.ticks_per_usec - 1)) /
+ g_os_cputime.ticks_per_usec;
#endif
return nsecs;
@@ -110,7 +110,7 @@ os_cputime_usecs_to_ticks(uint32_t usecs)
{
uint32_t ticks;
- ticks = (usecs * g_cputime.ticks_per_usec);
+ ticks = (usecs * g_os_cputime.ticks_per_usec);
return ticks;
}
@@ -128,7 +128,8 @@ os_cputime_ticks_to_usecs(uint32_t ticks)
{
uint32_t us;
- us = (ticks + (g_cputime.ticks_per_usec - 1)) / g_cputime.ticks_per_usec;
+ us = (ticks + (g_os_cputime.ticks_per_usec - 1)) /
+ g_os_cputime.ticks_per_usec;
return us;
}
#endif