2016-05-29 12:50 AM
Hi,
I m using cubemx for stacks. In files i foundassert_param is used for parameter checking. I don't understand how it is work. Here is syntax and use of that.#define assert_param(expr) ((void)0)
assert_param(IS_UART_WORD_LENGTH(huart->Init.WordLength));
what will happen in both cases like
IS_UART_WORD_LENGTH returns 0 and 1.
#printf #assert #!cubemx #cubemx #debug2016-05-30 04:02 AM
Hi hobb.epy,
assert_param is used to check that a parameter that is passed to a firmware library function is in the valid range of values. Each call to assert_param uses another macro that checks the parameter is in that range. If it is in range, then assert_param does nothing. If it is a bad value, then assert_failed is called with the filename and line number. The assert_param function is disabled by default, and can be enabled by uncommenting the correspondent macro ( for example in Hal library , in stm32fxx_hal_conf.h : /* #define USE_FULL_ASSERT 1 */ ) -Hannibal-