This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

What is the purpose of UNUSED_VARIABLE() when the effect is the same without it?

I am using SDK_11 s130. I am looking at app_error_fault_handler() in app_error_weak.c

Inside app_error_fault_handler(), there is this line of code;

UNUSED_VARIABLE(bsp_indication_set(BSP_INDICATE_FATAL_ERROR));

This line of code will cause all 4 LEDs in nRF-51 board to light up. The strange thing is that when I remove UNUSED_VARIABLE, the same outcome can be achieved without side effect. I am puzzled what is the purpose of UNUSED_VARIABLE() as it is used in many places.

Related