[riot-notifications] [RIOT-OS/RIOT] cpu/stm32_common: disable i2c in release (#12101)

Alexandre Abadie notifications at github.com
Mon Sep 9 09:41:06 CEST 2019


aabadie requested changes on this pull request.

Looks good in general. Maybe @MrKevinWeiss could run this on its HIL setup to validate the I2C behaviour ?

> @@ -186,23 +186,34 @@ int i2c_acquire(i2c_t dev)
     mutex_lock(&locks[dev]);
 
 #ifdef STM32_PM_STOP
-    /* block STOP mode */

Unrelated

>      periph_clk_dis(i2c_config[dev].bus, i2c_config[dev].rcc_mask);
 
 #ifdef STM32_PM_STOP
-    /* unblock STOP mode */

Unrelated change

>      return 0;
 }
 
 int i2c_release(i2c_t dev)
 {
     assert(dev < I2C_NUMOF);
 
+    I2C_TypeDef *i2c = i2c_config[dev].dev;

```suggestion
    /* disable device */
    i2c_config[dev].dev->CR1 &= ~(I2C_CR1_PE);
```

>      return 0;
 }
 
 int i2c_release(i2c_t dev)
 {
     assert(dev < I2C_NUMOF);
 
+    I2C_TypeDef *i2c = i2c_config[dev].dev;

```suggestion
    /* disable device */
    i2c_config[dev].dev->CR1 &= ~(I2C_CR1_PE);
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12101#pullrequestreview-285324884
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190909/a95c0980/attachment-0001.htm>


More information about the notifications mailing list