I found this line in in tmr_me16.c, Maybe there are similar lines in other files, for other peripherals or for other parts.
MXC_ASSERT((tmr_id = MXC_TMR_GET_IDX(tmr)) >= 0)
if max_assert feature is enabled by MXC_ASSERT_ENABLE, there is no bug. if MXC_ASSERT_ENABLE is not enabled, bug would be occurred. No matter what value tmr is, tmr_id will not be assigned a value, default value 0 will be wrongly used for the resting initialization steps.
I found some examples code in Keil IDE that, MXC_ASSERT_ENABLE is not enabled. the code doesn't run well.
the right usage is also already exsiting in MSDK,as below:
I found this line in in tmr_me16.c, Maybe there are similar lines in other files, for other peripherals or for other parts.
MXC_ASSERT((tmr_id = MXC_TMR_GET_IDX(tmr)) >= 0)
if max_assert feature is enabled by MXC_ASSERT_ENABLE, there is no bug. if MXC_ASSERT_ENABLE is not enabled, bug would be occurred. No matter what value tmr is, tmr_id will not be assigned a value, default value 0 will be wrongly used for the resting initialization steps.
I found some examples code in Keil IDE that, MXC_ASSERT_ENABLE is not enabled. the code doesn't run well. the right usage is also already exsiting in MSDK,as below:
please help to update all the risky lines.