Complete the code to enable configASSERT in FreeRTOS.
#define configASSERT( x ) if( ( x ) == [1] ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
The configASSERT macro triggers when the condition is false (0). So we check if (x) == 0 to catch errors.
Complete the code to disable interrupts when configASSERT fails.
void vAssertCalled( const char * pcFile, unsigned long ulLine ) {
task[1]_INTERRUPTS();
for( ;; );
}
When an assert fails, interrupts are disabled to prevent further system activity.
Fix the error in the configASSERT macro to correctly halt on failure.
#define configASSERT( x ) if( ( x ) == [1] ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
The assert should halt when the condition is false (0), not true (1).
Fill both blanks to define configASSERT that calls vAssertCalled with file and line info.
#define configASSERT( x ) if( ( x ) == [1] ) { vAssertCalled( __FILE__, [2] ); }
Assert triggers when x is 0 (false) and calls vAssertCalled with the current file and line number.
Fill all three blanks to implement a configASSERT that disables interrupts, calls vAssertCalled, and halts.
#define configASSERT( x ) \ if( ( x ) == [1] ) { \ task[2]_INTERRUPTS(); \ vAssertCalled( __FILE__, [3] ); \ for( ;; ); \ }
The assert triggers when x is 0, disables interrupts, calls vAssertCalled with file and line, then halts.