Closed Amomum closed 5 years ago
In file MDR32F9Qx_rst_clk.c in function RST_CLK_PCLKcmd:
MDR32F9Qx_rst_clk.c
RST_CLK_PCLKcmd
assert_param(IS_RST_CLK_PCLK(RST_CLK_PCLK));
If USE_ASSERT_INFOis set to 1 or 2, this expands to the following:
USE_ASSERT_INFO
((((((RST_CLK_PCLK) & ((uint32_t)(1 << ((((uint32_t)0x40048000) >> 15) & 0x1F)))) == 0x00) && (((RST_CLK_PCLK) & ((uint32_t)(1 << ((((uint32_t)0x400D0000) >> 15) & 0x1F)))) == 0x00) && (((RST_CLK_PCLK) & ((uint32_t)(1 << ((((uint32_t)0x400E0000) >> 15) & 0x1F)))) == 0x00) && (((RST_CLK_PCLK) & ((uint32_t)(1 << ((((uint32_t)0x400F8000) >> 15) & 0x1F)))) == 0x00))) ? (void)0 : assert_failed(4, 1426));
That last check boils down to (1 << 0x1F) and that triggers a warning because 1 is signed int and that shift touches the sign bit.
1
signed int
This shift comes form macro PCLK_BIT:
PCLK_BIT
#define PCLK_BIT(BASE) ((uint32_t)(1 << ((((uint32_t)BASE) >> 15) & 0x1F)))
Solution is simple, we need to change 1 to 1u.
1u
@Amomum Thank you
In file
MDR32F9Qx_rst_clk.c
in functionRST_CLK_PCLKcmd
:If
USE_ASSERT_INFO
is set to 1 or 2, this expands to the following:That last check boils down to (1 << 0x1F) and that triggers a warning because
1
issigned int
and that shift touches the sign bit.This shift comes form macro
PCLK_BIT
:Solution is simple, we need to change
1
to1u
.