Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to enable the wake-up source for the timer.
Embedded C
WAKEUP_EnableSource([1]); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a wake-up source unrelated to the timer.
Using a peripheral name instead of a wake-up source constant.
✗ Incorrect
The timer wake-up source is enabled by passing WAKEUP_SOURCE_TIMER to the function.
2fill in blank
mediumComplete the code to configure the GPIO pin as a wake-up source.
Embedded C
WAKEUP_ConfigGPIO([1], GPIO_PIN_5); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting the wrong GPIO port.
Confusing pin numbers with port names.
✗ Incorrect
GPIO_PORT_B is the correct port to configure pin 5 as a wake-up source.
3fill in blank
hardFix the error in the code to correctly disable the UART wake-up source.
Embedded C
WAKEUP_DisableSource([1]); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the wrong wake-up source constant.
Confusing enable and disable functions.
✗ Incorrect
To disable the UART wake-up source, WAKEUP_SOURCE_UART must be passed to the function.
4fill in blank
hardFill both blanks to configure and enable the ADC as a wake-up source.
Embedded C
WAKEUP_ConfigADC([1]); WAKEUP_EnableSource([2]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing ADC channels with wake-up source constants.
Enabling the wrong wake-up source.
✗ Incorrect
ADC_CHANNEL_5 is configured and WAKEUP_SOURCE_ADC is enabled as the wake-up source.
5fill in blank
hardFill all three blanks to create a wake-up source dictionary with GPIO and Timer sources.
Embedded C
const WakeupSourceConfig wakeup_sources = {
[1]: GPIO_PIN_7,
[2]: TIMER_2,
[3]: UART_1
}; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect constants for the dictionary keys.
Mixing up peripheral names and wake-up source constants.
✗ Incorrect
The dictionary keys must be the wake-up source constants for GPIO, Timer, and UART respectively.