4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-21 00:27:19 +08:00

[bsp] Fix the potential problem caused by the uninitialized variable dividor

This commit is contained in:
HUST_lxq 2023-04-05 10:50:47 +08:00 committed by Man, Jianting (Meco)
parent 2720c9c38c
commit 99fc12ca82

View File

@ -43,6 +43,7 @@ typedef struct {
static uint32_t i2c_GetClock(I2C0_Type* I2Cx) {
uint32_t dividor;
assert_param(IS_I2C_ALL_PERIPH(I2Cx));
if ((uint32_t)I2Cx == (uint32_t)I2C0) {
dividor = GLOBAL_CTRL->CLK_SEL_0_b.I2C0_CLK;