A bundled STM32F10x Std Periph and CMSIS library
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.
 
 
 
 
 

56 lines
1.9 KiB

  1. /*
  2. * \file stm32l1xx_assert.h
  3. * \brief
  4. * This file contains all the macros for the assert functionality
  5. *
  6. * Copyright (C) 2015 Houtouridis Christos (http://www.houtouridis.net)
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as
  10. * published by the Free Software Foundation, either version 3
  11. * of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #ifndef __stm32f10x_assert_h__
  23. #define __stm32f10x_assert_h__
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Uncomment the line below to expanse the "assert_param" macro in the
  28. Standard Peripheral Library drivers code */
  29. /* #define USE_FULL_ASSERT 1 */
  30. /* Exported macro ------------------------------------------------------------*/
  31. #ifdef USE_FULL_ASSERT
  32. /**
  33. * @brief The assert_param macro is used for function's parameters check.
  34. * @param expr: If expr is false, it calls assert_failed function which reports
  35. * the name of the source file and the source line number of the call
  36. * that failed. If expr is true, it returns no value.
  37. * @retval None
  38. */
  39. #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
  40. /* Exported functions ------------------------------------------------------- */
  41. void assert_failed(uint8_t* file, uint32_t line);
  42. #else
  43. #define assert_param(expr) ((void)0)
  44. #endif /* USE_FULL_ASSERT */
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. #endif // #ifndef __stm32f10x_assert_h__