minor change v12 to v13

This commit is contained in:
Yunhorn 2023-10-14 16:35:20 +08:00
parent 171d24dbab
commit 617531f0c6
2 changed files with 6 additions and 8 deletions

View File

@ -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 */

View File

@ -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;
}