summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaureen Helm <maureen.helm@nxp.com>2019-12-30 07:25:49 -0600
committerDamien George <damien.p.george@gmail.com>2020-02-04 17:09:59 +1100
commita7663b862ee102e94edcb5e244a9e6d05ccb11ef (patch)
tree7a8ed3585d253c982f1bbcba0bff3ef699d1b2f8
parentc25e12d0dd2b1b8a9fdc1231a1377f7983b41ccb (diff)
zephyr: Replace deprecated time conversion macro.
The SYS_CLOCK_HW_CYCLES_TO_NS macro was deprecated in zephyr commit 8892406c1de21bd5de5877f39099e3663a5f3af1. This commit updates MicroPython to use the new k_cyc_to_ns_floor64 api and fix build warnings in the zephyr port. This change is compatible with Zephyr v2.1 and later.
-rw-r--r--ports/zephyr/mphalport.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/zephyr/mphalport.h b/ports/zephyr/mphalport.h
index 4388f607d..594f6a1f6 100644
--- a/ports/zephyr/mphalport.h
+++ b/ports/zephyr/mphalport.h
@@ -2,7 +2,7 @@
#include "lib/utils/interrupt_char.h"
static inline mp_uint_t mp_hal_ticks_us(void) {
- return SYS_CLOCK_HW_CYCLES_TO_NS(k_cycle_get_32()) / 1000;
+ return k_cyc_to_ns_floor64(k_cycle_get_32()) / 1000;
}
static inline mp_uint_t mp_hal_ticks_ms(void) {