79 lines
2.7 KiB
C
79 lines
2.7 KiB
C
/** ##########################################################################
|
|
** Filename : assert.h
|
|
** Project :
|
|
** Module :
|
|
** Processor :
|
|
** Version : 1.0
|
|
** Compiler :
|
|
** Date/Time :
|
|
** Abstract :
|
|
** Contents :
|
|
** Note :
|
|
**
|
|
** (c) Copyright dmdz Co.,Ltd
|
|
** --------------------------------------------------------------------------
|
|
** R E V I S I O N H I S T O R Y
|
|
** --------------------------------------------------------------------------
|
|
** Date Ver Author Description
|
|
|
|
** -20230602- --V1.0-- --mingyea--- --修改--
|
|
|
|
** #########################################################################*/
|
|
#ifndef ASSERT__H
|
|
#define ASSERT__H
|
|
|
|
/**
|
|
* @page misra_violations MISRA-C:2012 violations
|
|
*
|
|
* @section [global]
|
|
* Violates MISRA 2012 Advisory Rule 2.3, Global typedef not referenced.
|
|
* status_t is referenced from all drivers.
|
|
*
|
|
* @section [global]
|
|
* Violates MISRA 2012 Advisory Rule 2.5, Local macro not referenced.
|
|
* The defined macro is used as include guard.
|
|
*
|
|
*/
|
|
|
|
/*---------------------------------------------------------------------------
|
|
- I N C L U D E F I L E S
|
|
----------------------------------------------------------------------------*/
|
|
|
|
/*---------------------------------------------------------------------------
|
|
- D E F I N E S / M A C R O S
|
|
----------------------------------------------------------------------------*/
|
|
#ifdef USE_FULL_ASSERT
|
|
//#define DEVICE_ASSERT(x) ((x) ? (void)0 : (void)printf("[ASSERT]Detect error on %s %d\n", __FILE__, __LINE__) )
|
|
#if 0
|
|
#define assert_param(x) ((x) ? (void)0 : (void)assert_failed(__FILE__, __LINE__) )
|
|
extern void assert_failed(uint8_t* file, uint32_t line);
|
|
#else
|
|
#define assert_param(x) ((x) ? (void)0 : (void)assert_failed() )
|
|
extern void assert_failed(void);
|
|
#endif
|
|
#else
|
|
#define assert_param(x) ((void)0)
|
|
#endif
|
|
|
|
/*---------------------------------------------------------------------------
|
|
- T Y P E D E F I N I T I O N S
|
|
----------------------------------------------------------------------------*/
|
|
|
|
/*---------------------------------------------------------------------------
|
|
- G L O B A L V A R I A B L E S
|
|
- only configuration table allowed here,variables are not allowed!
|
|
----------------------------------------------------------------------------*/
|
|
|
|
/*---------------------------------------------------------------------------
|
|
- C O N S T A N T S
|
|
----------------------------------------------------------------------------*/
|
|
|
|
/*---------------------------------------------------------------------------
|
|
- F U N C T I O N P R O T O T Y P E
|
|
----------------------------------------------------------------------------*/
|
|
|
|
|
|
#endif /* ASSERT__H */
|
|
|
|
/* [] END OF FILE */
|