diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-02-03 07:18:17 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-02-03 07:18:17 -0600 |
commit | 05d0fd7cf4654e3fe1024e5746c4881400ea12fa (patch) | |
tree | 8f9e7f4da0df5d5e5b1ef94c54e02421d718ecf1 /nuttx/sched | |
parent | 27638628c44be1afb605e8859c97be3d41412ab5 (diff) | |
download | px4-nuttx-05d0fd7cf4654e3fe1024e5746c4881400ea12fa.tar.gz px4-nuttx-05d0fd7cf4654e3fe1024e5746c4881400ea12fa.tar.bz2 px4-nuttx-05d0fd7cf4654e3fe1024e5746c4881400ea12fa.zip |
Convert the 64-bit usec limit to a 32-bit tick limit
Diffstat (limited to 'nuttx/sched')
-rw-r--r-- | nuttx/sched/Kconfig | 7 | ||||
-rw-r--r-- | nuttx/sched/sched/sched_timerexpiration.c | 10 |
2 files changed, 9 insertions, 8 deletions
diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig index a82466d32..a6df4feda 100644 --- a/nuttx/sched/Kconfig +++ b/nuttx/sched/Kconfig @@ -85,10 +85,11 @@ config SCHED_TICKLESS_LIMIT_MAX_SLEEP bool "Max sleep period (in microseconds)" default n ---help--- - Enables g_oneshot_max_delay_usec variable. The variable is + Enables use of the g_oneshot_maxticks variable. This variable is initialized by platform-specific logic at runtime to the maximum - delay that the timer can wait (in microseconds). The RTOS tickless - logic will then limit all requested delays to this value (in ticks). + delay that the timer can wait (in configured clock ticks). The + RTOS tickless logic will then limit all requested delays to this + value. endif diff --git a/nuttx/sched/sched/sched_timerexpiration.c b/nuttx/sched/sched/sched_timerexpiration.c index b1ed1833f..e990f0b57 100644 --- a/nuttx/sched/sched/sched_timerexpiration.c +++ b/nuttx/sched/sched/sched_timerexpiration.c @@ -94,14 +94,14 @@ * limit to the maximum timing interval that be represented by the timer, * then that limit must be respected. * - * If CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP is defined, then a 64-bit global - * variable called g_oneshot_max_delay_usec variable is enabled. The variable + * If CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP is defined, then a 32-bit global + * variable called g_oneshot_maxticks variable is enabled. The variable * is initialized by platform-specific logic at runtime to the maximum delay * that the timer can wait (in microseconds). The RTOS tickless logic will * then limit all requested delays to this value (in ticks). */ -uint64_t g_oneshot_max_delay_usec; +uint32_t g_oneshot_maxticks = UINT32_MAX; #endif /************************************************************************ @@ -445,9 +445,9 @@ static void sched_timer_start(unsigned int ticks) struct timespec ts; #if CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP - if (ticks > (g_oneshot_max_delay_usec / CONFIG_USEC_PER_TICK)) + if (ticks > g_oneshot_maxticks) { - ticks = (g_oneshot_max_delay_usec / CONFIG_USEC_PER_TICK); + ticks = g_oneshot_maxticks; } #endif |