mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-22 01:15:26 +08:00
[bsp] Fix the potential problem caused by the uninitialized variable dividor
This commit is contained in:
parent
2720c9c38c
commit
99fc12ca82
@ -43,6 +43,7 @@ typedef struct {
|
|||||||
|
|
||||||
static uint32_t i2c_GetClock(I2C0_Type* I2Cx) {
|
static uint32_t i2c_GetClock(I2C0_Type* I2Cx) {
|
||||||
uint32_t dividor;
|
uint32_t dividor;
|
||||||
|
assert_param(IS_I2C_ALL_PERIPH(I2Cx));
|
||||||
|
|
||||||
if ((uint32_t)I2Cx == (uint32_t)I2C0) {
|
if ((uint32_t)I2Cx == (uint32_t)I2C0) {
|
||||||
dividor = GLOBAL_CTRL->CLK_SEL_0_b.I2C0_CLK;
|
dividor = GLOBAL_CTRL->CLK_SEL_0_b.I2C0_CLK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user