py32_assert.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. ******************************************************************************
  3. * @file py32_assert.h
  4. * @brief PY32 assert file.
  5. ******************************************************************************
  6. * @attention
  7. *
  8. * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co.
  9. * All rights reserved.</center></h2>
  10. *
  11. * This software component is licensed by Puya under BSD 3-Clause license,
  12. * the "License"; You may not use this file except in compliance with the
  13. * License. You may obtain a copy of the License at:
  14. * opensource.org/licenses/BSD-3-Clause
  15. *
  16. ******************************************************************************
  17. * @attention
  18. *
  19. * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
  20. * All rights reserved.</center></h2>
  21. *
  22. * This software component is licensed by ST under BSD 3-Clause license,
  23. * the "License"; You may not use this file except in compliance with the
  24. * License. You may obtain a copy of the License at:
  25. * opensource.org/licenses/BSD-3-Clause
  26. *
  27. ******************************************************************************
  28. */
  29. /* Define to prevent recursive inclusion -------------------------------------*/
  30. #ifndef __PY32_ASSERT_H
  31. #define __PY32_ASSERT_H
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. #ifdef USE_FULL_ASSERT
  36. /* Exported types ------------------------------------------------------------*/
  37. /* Exported constants --------------------------------------------------------*/
  38. /* Includes ------------------------------------------------------------------*/
  39. #include "stdint.h"
  40. /* Exported macro ------------------------------------------------------------*/
  41. /**
  42. * @brief The assert_param macro is used for function's parameters check.
  43. * @param expr: If expr is false, it calls assert_failed function
  44. * which reports the name of the source file and the source
  45. * line number of the call that failed.
  46. * If expr is true, it returns no value.
  47. * @retval None
  48. */
  49. #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
  50. /* Exported functions ------------------------------------------------------- */
  51. void assert_failed(uint8_t* file, uint32_t line);
  52. #else
  53. #define assert_param(expr) ((void)0U)
  54. #endif /* USE_FULL_ASSERT */
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58. #endif /* __PY32_ASSERT_H */
  59. /************************ (C) COPYRIGHT Puya *****END OF FILE******************/