From 07dd0bfba35410452fcdac2b7e4ca146b529bc6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Date: Wed, 5 Feb 2025 10:45:10 +0100 Subject: [PATCH] wiseconnect: Drop use of pow() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pow() is not defined when Zephyr is built with minimal libc. There is only one occurence of the pow() function in Wiseconnect. Since Wiseconnect only use pow() to compute power of 2, it can be replaced by a bit shift. Signed-off-by: Jérôme Pouiller --- .../device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiseconnect/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_pll.c b/wiseconnect/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_pll.c index c9a3fe00a..a4de118a1 100644 --- a/wiseconnect/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_pll.c +++ b/wiseconnect/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_pll.c @@ -624,7 +624,7 @@ rsi_error_t clk_set_i2s_pll_freq(const M4CLK_Type *pCLK, uint32_t i2sPllFreq, ui FCW = (float)Fdco / (float)fref; M = (uint16_t)FCW; frac = (FCW - M); - FCW_F = (uint16_t)(frac * pow(2, 14)); + FCW_F = (uint16_t)(frac * (1 << 14)); // (1 << 14) == pow(2, 14) if (Fdco == I2S_DCO_FREQ1) { FCW_F = (FCW_F + 1); }