From 741958d525e4368b5879de1f19b54d31dc6025e5 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Tue, 10 Oct 2023 14:55:27 +0800 Subject: [PATCH] upgrade from V12 to V13 --- Core/Inc/sys_app.h | 2 +- Core/Src/sys_app.c | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Core/Inc/sys_app.h b/Core/Inc/sys_app.h index 8580786..2f21e96 100644 --- a/Core/Inc/sys_app.h +++ b/Core/Inc/sys_app.h @@ -100,7 +100,7 @@ void GetUniqueId(uint8_t *id); * @brief callback to get the board 32 bits unique ID (LSB) * @retval devAddr Device Address */ -uint32_t GetDevAddr(void); +void GetDevAddr(uint32_t *devAddr); /* USER CODE BEGIN EFP */ diff --git a/Core/Src/sys_app.c b/Core/Src/sys_app.c index b730f0e..69f6828 100644 --- a/Core/Src/sys_app.c +++ b/Core/Src/sys_app.c @@ -235,23 +235,21 @@ void GetUniqueId(uint8_t *id) /* USER CODE END GetUniqueId_2 */ } -uint32_t GetDevAddr(void) -{ - uint32_t val = 0; +void GetDevAddr(uint32_t *devAddr) +{ /* USER CODE BEGIN GetDevAddr_1 */ /* USER CODE END GetDevAddr_1 */ - val = LL_FLASH_GetUDN(); - if (val == 0xFFFFFFFF) + *devAddr = LL_FLASH_GetUDN(); + if (*devAddr == 0xFFFFFFFF) { - val = ((HAL_GetUIDw0()) ^ (HAL_GetUIDw1()) ^ (HAL_GetUIDw2())); + *devAddr = ((HAL_GetUIDw0()) ^ (HAL_GetUIDw1()) ^ (HAL_GetUIDw2())); } /* USER CODE BEGIN GetDevAddr_2 */ /* USER CODE END GetDevAddr_2 */ - return val; }