You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

76 lines
3.4 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32_assert.h
  4. * @author MCD Application Team
  5. * @version V1.2.2
  6. * @date 14-April-2017
  7. * @brief STM32 assert template file.
  8. * This file should be copied to the application folder and renamed
  9. * to stm32_assert.h.
  10. ******************************************************************************
  11. * @attention
  12. *
  13. * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
  14. *
  15. * Redistribution and use in source and binary forms, with or without modification,
  16. * are permitted provided that the following conditions are met:
  17. * 1. Redistributions of source code must retain the above copyright notice,
  18. * this list of conditions and the following disclaimer.
  19. * 2. Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  23. * may be used to endorse or promote products derived from this software
  24. * without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  29. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  30. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  31. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  32. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  33. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  34. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  35. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  36. *
  37. ******************************************************************************
  38. */
  39. /* Define to prevent recursive inclusion -------------------------------------*/
  40. #ifndef __STM32_ASSERT_H
  41. #define __STM32_ASSERT_H
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. /* Exported types ------------------------------------------------------------*/
  46. /* Exported constants --------------------------------------------------------*/
  47. /* Includes ------------------------------------------------------------------*/
  48. /* Exported macro ------------------------------------------------------------*/
  49. #ifdef USE_FULL_ASSERT
  50. /**
  51. * @brief The assert_param macro is used for function's parameters check.
  52. * @param expr: If expr is false, it calls assert_failed function
  53. * which reports the name of the source file and the source
  54. * line number of the call that failed.
  55. * If expr is true, it returns no value.
  56. * @retval None
  57. */
  58. #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
  59. /* Exported functions ------------------------------------------------------- */
  60. void assert_failed(uint8_t* file, uint32_t line);
  61. #else
  62. #define assert_param(expr) ((void)0U)
  63. #endif /* USE_FULL_ASSERT */
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif /* __STM32_ASSERT_H */
  68. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/