From 0e3f3bb2ca36766bc3e759fcce5348d8d6073a58 Mon Sep 17 00:00:00 2001 From: UncleRus Date: Sat, 5 Mar 2016 03:07:57 +0500 Subject: [PATCH] Frequency divider bug --- core/esp_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/esp_spi.c b/core/esp_spi.c index ac9b0b1..56ed196 100644 --- a/core/esp_spi.c +++ b/core/esp_spi.c @@ -107,7 +107,7 @@ void spi_set_frequency_div(uint8_t bus, uint32_t divider) { uint32_t predivider = divider & 0xffff; uint32_t count = divider >> 16; - if (count > 1 && divider > 1) + if (count > 1 || divider > 1) { predivider = predivider > SPI_CLOCK_DIV_PRE_M + 1 ? SPI_CLOCK_DIV_PRE_M + 1 : predivider; count = count > SPI_CLOCK_COUNT_NUM_M + 1 ? SPI_CLOCK_COUNT_NUM_M + 1 : count;