1 /******************************************************************************* 2 * Copyright 2019-2021 Microchip FPGA Embedded Systems Solutions. 3 * 4 * SPDX-License-Identifier: MIT 5 * 6 * MPFS HAL Embedded Software 7 * 8 */ 9 #ifndef HAL_ASSERT_HEADER 10 #define HAL_ASSERT_HEADER 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 /***************************************************************************//** 17 * ASSERT() implementation. 18 ******************************************************************************/ 19 /* Disable assertions if we do not recognize the compiler. */ 20 #if defined ( __GNUC__ ) 21 #if defined(NDEBUG) 22 #define ASSERT(CHECK) 23 #else 24 #define ASSERT(CHECK)\ 25 do { \ 26 if (!(CHECK)) \ 27 { \ 28 __asm volatile ("ebreak"); \ 29 }\ 30 } while(0); 31 #endif /* NDEBUG check */ 32 #endif /* compiler check */ 33 34 #ifdef __cplusplus 35 } 36 #endif 37 38 #endif /* HAL_ASSERT_HEADER */ 39 40