Skip to content

Commit 176e405

Browse files
committed
Patches: fix wifi + analogRead()
1 parent e0075b8 commit 176e405

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From 8615602169010eb1a4ad76fdceadb8db92f32060 Mon Sep 17 00:00:00 2001
2+
From: Martino Facchin <[email protected]>
3+
Date: Wed, 11 Aug 2021 12:14:57 +0200
4+
Subject: [PATCH] STM32: analogin: use critical section to protect PLL
5+
configuration
6+
7+
---
8+
targets/TARGET_STM/TARGET_STM32H7/analogin_device.c | 4 ++++
9+
1 file changed, 4 insertions(+)
10+
11+
diff --git a/targets/TARGET_STM/TARGET_STM32H7/analogin_device.c b/targets/TARGET_STM/TARGET_STM32H7/analogin_device.c
12+
index 3fb41a7997..905e86006e 100644
13+
--- a/targets/TARGET_STM/TARGET_STM32H7/analogin_device.c
14+
+++ b/targets/TARGET_STM/TARGET_STM32H7/analogin_device.c
15+
@@ -32,6 +32,8 @@ void analogin_pll_configuration(void)
16+
}
17+
#endif /* DUAL_CORE */
18+
19+
+ core_util_critical_section_enter();
20+
+
21+
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
22+
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_ADC;
23+
PeriphClkInitStruct.PLL2.PLL2M = 4;
24+
@@ -47,6 +49,8 @@ void analogin_pll_configuration(void)
25+
error("analogin_init HAL_RCCEx_PeriphCLKConfig");
26+
}
27+
28+
+ core_util_critical_section_exit();
29+
+
30+
#if defined(DUAL_CORE)
31+
LL_HSEM_ReleaseLock(HSEM, CFG_HW_RCC_SEMID, HSEM_CR_COREID_CURRENT);
32+
#endif /* DUAL_CORE */
33+
--
34+
2.32.0
35+

0 commit comments

Comments
 (0)