Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit93bc407

Browse files
committed
[WB] Add hardware semaphore management
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parente6bf53b commit93bc407

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎variants/PNUCLEO_WB55RG/variant.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
#include"pins_arduino.h"
20+
#include"lock_resource.h"
2021

2122
#ifdef __cplusplus
2223
extern"C" {
@@ -99,9 +100,15 @@ WEAK void SystemClock_Config(void)
99100
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
100101
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {};
101102

103+
/* This prevents the CPU2 (M0+) to configure RCC*/
104+
hsem_lock(CFG_HW_RCC_SEMID, HSEM_LOCK_DEFAULT_RETRY);
105+
102106
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
103107
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
104108

109+
/* This prevents the CPU2 (M0+) to disable the HSI48 oscillator*/
110+
hsem_lock(CFG_HW_CLK48_CONFIG_SEMID, HSEM_LOCK_DEFAULT_RETRY);
111+
105112
/* Initializes the CPU, AHB and APB busses clocks*/
106113
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSI48
107114
| RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_LSE;
@@ -149,6 +156,7 @@ WEAK void SystemClock_Config(void)
149156
/* Select HSI as system clock source after Wake Up from Stop mode*/
150157
LL_RCC_SetClkAfterWakeFromStop(LL_RCC_STOP_WAKEUPCLOCK_HSI);
151158

159+
hsem_unlock(CFG_HW_RCC_SEMID);
152160
}
153161

154162
#ifdef __cplusplus

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp