From 76146b3d9ab0ab88ce0f0d1cfa0235ec0758a4a9 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 30 Oct 2016 03:02:07 +0300 Subject: extmod/utime_mphal: Allow ticks functions period be configurable by a port. Using MICROPY_PY_UTIME_TICKS_PERIOD config var. --- py/mpconfig.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'py') diff --git a/py/mpconfig.h b/py/mpconfig.h index dcdaffe0f..fce997692 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -866,6 +866,16 @@ typedef double mp_float_t; #define MICROPY_PY_UTIME_MP_HAL (0) #endif +// Period of values returned by utime.ticks_ms(), ticks_us(), ticks_cpu() +// functions. Should be power of two. All functions above use the same +// period, so if underlying hardware/API has different periods, the +// minimum of them should be used. The value below is the maximum value +// this parameter can take (corresponding to 30 bit tick values on 32-bit +// system). +#ifndef MICROPY_PY_UTIME_TICKS_PERIOD +#define MICROPY_PY_UTIME_TICKS_PERIOD (MP_SMALL_INT_POSITIVE_MASK + 1) +#endif + // Whether to provide "_thread" module #ifndef MICROPY_PY_THREAD #define MICROPY_PY_THREAD (0) -- cgit v1.2.3