From 53516079201720e0096045277eca37a861df7487 Mon Sep 17 00:00:00 2001 From: Cervac Petru Date: Sun, 15 May 2022 03:16:58 +0300 Subject: [PATCH] Add stm32_assert.h to Inc folder Add a copy of stm32_assert.h header to folder with includes. This allow building the project with the "Enable Full Assert" option enabled. --- .../STM32F1xx_HAL_Driver/Inc/stm32_assert.h | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Drivers/STM32F1xx_HAL_Driver/Inc/stm32_assert.h diff --git a/Drivers/STM32F1xx_HAL_Driver/Inc/stm32_assert.h b/Drivers/STM32F1xx_HAL_Driver/Inc/stm32_assert.h new file mode 100644 index 0000000..a314336 --- /dev/null +++ b/Drivers/STM32F1xx_HAL_Driver/Inc/stm32_assert.h @@ -0,0 +1,57 @@ +/** + ****************************************************************************** + * @file stm32_assert.h + * @author MCD Application Team + * @brief STM32 assert template file. + * This file should be copied to the application folder and renamed + * to stm32_assert.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32_ASSERT_H +#define __STM32_ASSERT_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* Includes ------------------------------------------------------------------*/ +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32_ASSERT_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/