From e5e32cca7bebfa14ed8b5e4dcabf684a8a3360af Mon Sep 17 00:00:00 2001 From: RohitAthithya <82933996+RohitAthithya@users.noreply.github.com> Date: Thu, 6 Oct 2022 19:51:31 +0530 Subject: [PATCH] Added todo part for the Peripheral clock control The disable part of the peripheral clock control was empty - filled it using switch-case implementation --- .../drivers/src/stm32f407xx_i2c_driver.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Resources/Source_code/Workspace/stm32f4xx_drivers/drivers/src/stm32f407xx_i2c_driver.c b/Resources/Source_code/Workspace/stm32f4xx_drivers/drivers/src/stm32f407xx_i2c_driver.c index d4f64e06..82be4116 100644 --- a/Resources/Source_code/Workspace/stm32f4xx_drivers/drivers/src/stm32f407xx_i2c_driver.c +++ b/Resources/Source_code/Workspace/stm32f4xx_drivers/drivers/src/stm32f407xx_i2c_driver.c @@ -164,7 +164,20 @@ void I2C_PeriClockControl(I2C_RegDef_t *pI2Cx, uint8_t EnorDi) } else { - //TODO + //TODO: Disbale the peripheral using macros = turning off the clocking! + switch((uint32_t)pI2Cx) + { + case (uint32_t)I2C1: + I2C1_PCLK_DI(); + break; + case (uint32_t)I2C2: + I2C2_PCLK_DI(); + break; + case (uint32_t)I2C3: + I2C3_PCLK_DI(); + default: + break; + } } }