crutchs.h 649 B

123456789101112131415161718
  1. #ifdef USE_FULL_ASSERT
  2. /**
  3. * @brief The assert_param macro is used for function's parameters check.
  4. * @param expr: If expr is false, it calls assert_failed function
  5. * which reports the name of the source file and the source
  6. * line number of the call that failed.
  7. * If expr is true, it returns no value.
  8. * @retval None
  9. */
  10. #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
  11. /* Exported functions ------------------------------------------------------- */
  12. void assert_failed(uint8_t* file, uint32_t line);
  13. #else
  14. #define assert_param(expr) ((void)0)
  15. #endif /* USE_FULL_ASSERT */