0
0
FreeRTOSprogramming~10 mins

configASSERT() for development debugging in FreeRTOS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable configASSERT in FreeRTOS.

FreeRTOS
#define configASSERT( x ) if( ( x ) == [1] ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
Drag options to blanks, or click blank then click option'
Afalse
B1
C0
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 instead of 0 causes the assert to never trigger.
Using true or false keywords which are not standard in C.
2fill in blank
medium

Complete the code to disable interrupts when configASSERT fails.

FreeRTOS
void vAssertCalled( const char * pcFile, unsigned long ulLine ) {
    task[1]_INTERRUPTS();
    for( ;; );
}
Drag options to blanks, or click blank then click option'
ADISABLE
BENABLE
CCLEAR
DSET
Attempts:
3 left
💡 Hint
Common Mistakes
Using ENABLE instead of DISABLE causes interrupts to continue.
Using unrelated macros like SET or CLEAR.
3fill in blank
hard

Fix the error in the configASSERT macro to correctly halt on failure.

FreeRTOS
#define configASSERT( x ) if( ( x ) == [1] ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
Drag options to blanks, or click blank then click option'
A1
Btrue
Cfalse
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Checking if x == 1 causes assert to never trigger.
Using true or false keywords which are not standard in C.
4fill in blank
hard

Fill both blanks to define configASSERT that calls vAssertCalled with file and line info.

FreeRTOS
#define configASSERT( x ) if( ( x ) == [1] ) { vAssertCalled( __FILE__, [2] ); }
Drag options to blanks, or click blank then click option'
A0
B1
CulLine
D__LINE__
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 instead of 0 for failure condition.
Using ulLine instead of __LINE__ macro.
5fill in blank
hard

Fill all three blanks to implement a configASSERT that disables interrupts, calls vAssertCalled, and halts.

FreeRTOS
#define configASSERT( x ) \
    if( ( x ) == [1] ) { \
        task[2]_INTERRUPTS(); \
        vAssertCalled( __FILE__, [3] ); \
        for( ;; ); \
    }
Drag options to blanks, or click blank then click option'
A0
B1
CDISABLE
D__LINE__
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 instead of 0 for failure condition.
Enabling interrupts instead of disabling.
Not passing __LINE__ macro.