Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Flipper-Zero/STM32CubeWB.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/main.c')
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/main.c62
1 files changed, 46 insertions, 16 deletions
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/main.c
index b078302c7..4e7a6ab5c 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/main.c
@@ -37,11 +37,8 @@
******************************************************************************
*/
/* USER CODE END Header */
-
/* Includes ------------------------------------------------------------------*/
#include "main.h"
-#include "app_entry.h"
-#include "app_common.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
@@ -68,6 +65,8 @@
/* USER CODE END PM */
/* Private variables ---------------------------------------------------------*/
+IPCC_HandleTypeDef hipcc;
+
UART_HandleTypeDef hlpuart1;
UART_HandleTypeDef huart1;
DMA_HandleTypeDef hdma_lpuart1_tx;
@@ -87,6 +86,7 @@ void MX_LPUART1_UART_Init(void);
void MX_USART1_UART_Init(void);
static void MX_RF_Init(void);
static void MX_RTC_Init(void);
+static void MX_IPCC_Init(void);
/* USER CODE BEGIN PFP */
void PeriphClock_Config(void);
static void Reset_Device( void );
@@ -130,6 +130,9 @@ int main(void)
/* Configure the system clock */
SystemClock_Config();
+ /* IPCC initialisation */
+ MX_IPCC_Init();
+
/* USER CODE BEGIN SysInit */
PeriphClock_Config();
Init_Exti(); /**< Configure the system Power Mode */
@@ -148,9 +151,9 @@ int main(void)
APPE_Init();
/* Infinite loop */
/* USER CODE BEGIN WHILE */
- while(1)
- {
- UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ while (1)
+ {
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
@@ -168,14 +171,15 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
- /** Configure LSE Drive Capability
+ /** Configure LSE Drive Capability
*/
HAL_PWR_EnableBkUpAccess();
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
- /** Configure the main internal regulator output voltage
+ /** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
- /** Initializes the CPU, AHB and APB busses clocks
+ /** Initializes the RCC Oscillators according to the specified parameters
+ * in the RCC_OscInitTypeDef structure.
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
|RCC_OSCILLATORTYPE_LSE;
@@ -188,7 +192,7 @@ void SystemClock_Config(void)
{
Error_Handler();
}
- /** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers
+ /** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK4|RCC_CLOCKTYPE_HCLK2
|RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
@@ -204,7 +208,7 @@ void SystemClock_Config(void)
{
Error_Handler();
}
- /** Initializes the peripherals clocks
+ /** Initializes the peripherals clocks
*/
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS|RCC_PERIPHCLK_RFWAKEUP
|RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_USART1
@@ -238,6 +242,32 @@ void SystemClock_Config(void)
}
/**
+ * @brief IPCC Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_IPCC_Init(void)
+{
+
+ /* USER CODE BEGIN IPCC_Init 0 */
+
+ /* USER CODE END IPCC_Init 0 */
+
+ /* USER CODE BEGIN IPCC_Init 1 */
+
+ /* USER CODE END IPCC_Init 1 */
+ hipcc.Instance = IPCC;
+ if (HAL_IPCC_Init(&hipcc) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN IPCC_Init 2 */
+
+ /* USER CODE END IPCC_Init 2 */
+
+}
+
+/**
* @brief LPUART1 Initialization Function
* @param None
* @retval None
@@ -369,7 +399,7 @@ static void MX_RTC_Init(void)
/* USER CODE BEGIN RTC_Init 1 */
/* USER CODE END RTC_Init 1 */
- /** Initialize RTC Only
+ /** Initialize RTC Only
*/
hrtc.Instance = RTC;
hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
@@ -395,16 +425,16 @@ static void MX_RTC_Init(void)
}
-/**
+/**
* Enable DMA controller clock
*/
-static void MX_DMA_Init(void)
+static void MX_DMA_Init(void)
{
/* DMA controller clock enable */
__HAL_RCC_DMAMUX1_CLK_ENABLE();
- __HAL_RCC_DMA1_CLK_ENABLE();
__HAL_RCC_DMA2_CLK_ENABLE();
+ __HAL_RCC_DMA1_CLK_ENABLE();
/* DMA interrupt init */
/* DMA1_Channel4_IRQn interrupt configuration */
@@ -635,7 +665,7 @@ void Error_Handler(void)
* @retval None
*/
void assert_failed(uint8_t *file, uint32_t line)
-{
+{
/* USER CODE BEGIN 6 */
/* User can add his own implementation to report the file name and line number,
tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */