Skip to content

Commit 685b78b

Browse files
committed
STM32: add i2c patch to fix scan
1 parent 0e57d7b commit 685b78b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Diff for: patches/0094-STM32-Fix-i2c_compute_timing-API.patch

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From 93ab77ae4ecaa7dc42a206a92c0fa15dc5e4d479 Mon Sep 17 00:00:00 2001
2+
From: pennam <[email protected]>
3+
Date: Mon, 12 Jul 2021 22:10:50 +0200
4+
Subject: [PATCH] STM32 Fix i2c_compute_timing() API
5+
6+
---
7+
targets/TARGET_STM/i2c_api.c | 3 +++
8+
1 file changed, 3 insertions(+)
9+
10+
diff --git a/targets/TARGET_STM/i2c_api.c b/targets/TARGET_STM/i2c_api.c
11+
index 27b7f8027f..dd56a335fe 100644
12+
--- a/targets/TARGET_STM/i2c_api.c
13+
+++ b/targets/TARGET_STM/i2c_api.c
14+
@@ -1707,6 +1707,9 @@ uint32_t i2c_compute_timing(uint32_t clock_src_freq, uint32_t i2c_freq)
15+
uint32_t speed;
16+
uint32_t idx;
17+
18+
+ /* Reset valid timing count at the beginning of each new computation */
19+
+ I2c_valid_timing_nbr = 0;
20+
+
21+
if ((clock_src_freq != 0U) && (i2c_freq != 0U)) {
22+
for (speed = 0 ; speed <= (uint32_t)I2C_SPEED_FREQ_FAST_PLUS ; speed++) {
23+
if ((i2c_freq >= I2C_Charac[speed].freq_min) &&
24+
--
25+
2.32.0
26+

0 commit comments

Comments
 (0)