From 61bfa5372aefd6eece144274cc63b8f169ca283f Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Thu, 11 May 2023 01:41:20 +0200 Subject: [PATCH] cpu/esp32: fix compilation of esp_hw_counter --- cpu/esp32/periph/timer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cpu/esp32/periph/timer.c b/cpu/esp32/periph/timer.c index 0d1e4e248a..579138f1c7 100644 --- a/cpu/esp32/periph/timer.c +++ b/cpu/esp32/periph/timer.c @@ -369,6 +369,8 @@ void IRAM_ATTR timer_stop(tim_t dev) #else /* MODULE_ESP_HW_COUNTER */ +#include "xtensa/config/core-isa.h" + /* hardware counter used as timer */ /** @@ -482,7 +484,7 @@ void IRAM hw_timer_handler(void* arg) int timer_init (tim_t dev, uint32_t freq, timer_cb_t cb, void *arg) { - DEBUG("%s dev=%u freq=%u cb=%p arg=%p\n", __func__, dev, freq, cb, arg); + DEBUG("%s dev=%u freq=%"PRIu32" cb=%p arg=%p\n", __func__, dev, freq, cb, arg); assert(dev < HW_TIMER_NUMOF); assert(freq == HW_TIMER_FREQUENCY); @@ -568,7 +570,7 @@ unsigned int IRAM timer_read(tim_t dev) void IRAM timer_start(tim_t dev) { - DEBUG("%s dev=%u @%u\n", __func__, dev, system_get_time()); + DEBUG("%s dev=%u @%"PRIu32"\n", __func__, dev, system_get_time()); assert(dev < HW_TIMER_NUMOF); assert(!_timers[dev].started); @@ -619,7 +621,7 @@ static void IRAM __timer_channel_start (struct _hw_timer_t* timer, struct hw_cha channel->cycles = channel->delta_time >> HW_TIMER_DELTA_RSHIFT; channel->remainder = channel->delta_time & HW_TIMER_DELTA_MASK; - DEBUG("%s cycles=%u remainder=%u @%u\n", + DEBUG("%s cycles=%"PRIu32" remainder=%"PRIu32" @%"PRIu32"\n", __func__, channel->cycles, channel->remainder, system_get_time()); /* start timer either with full cycles, remaining or minimum time */