From 259dbc03d8326eedb6f967b74bea5b3af4b74318 Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Tue, 22 Mar 2022 07:03:24 +0100 Subject: [PATCH] drivers/ws281x: changes for ESP-IDF 4.4 --- drivers/ws281x/esp32.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/ws281x/esp32.c b/drivers/ws281x/esp32.c index 0237c97ba1..ee4accdaf5 100644 --- a/drivers/ws281x/esp32.c +++ b/drivers/ws281x/esp32.c @@ -27,6 +27,7 @@ #include "ws281x_params.h" #include "ws281x_constants.h" #include "periph_cpu.h" +#include "esp_private/esp_clk.h" #include "xtensa/core-macros.h" #include "soc/rtc.h" @@ -45,11 +46,11 @@ void ws281x_write_buffer(ws281x_t *dev, const void *buf, size_t size) const uint8_t *pos = buf; const uint8_t *end = pos + size; - // Cycles + /* Cycles */ uint32_t total_cycles, one_on, one_off, zero_on, zero_off, on_wait, off_wait; - // Current frequency - rtc_cpu_freq_t freq = rtc_clk_cpu_freq_value(rtc_clk_cpu_freq_get()); + /* Current frequency */ + rtc_cpu_freq_t freq = esp_clk_cpu_freq(); total_cycles = freq / (NS_PER_SEC / WS281X_T_DATA_NS); one_on = freq / (NS_PER_SEC / WS281X_T_DATA_ONE_NS);