From 7a9daa3cd3b36b6d13c403a35c40707c5830c98a Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Nihei Date: Mon, 23 May 2022 10:12:05 -0300 Subject: [PATCH] hal: Fix max value for clkdiv_pre in ESP32-S3 SPI master clock config Signed-off-by: Gustavo Henrique Nihei --- components/hal/esp32s3/include/hal/spi_ll.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/hal/esp32s3/include/hal/spi_ll.h b/components/hal/esp32s3/include/hal/spi_ll.h index c7dd96fa8c..6058afe1e5 100644 --- a/components/hal/esp32s3/include/hal/spi_ll.h +++ b/components/hal/esp32s3/include/hal/spi_ll.h @@ -676,8 +676,8 @@ static inline int spi_ll_master_cal_clock(int fapb, int hz, int duty_cycle, spi_ if (pre <= 0) { pre = 1; } - if (pre > 8192) { - pre = 8192; + if (pre > 16) { + pre = 16; } errval = abs(spi_ll_freq_for_pre_n(fapb, pre, n) - hz); if (bestn == -1 || errval <= besterr) {