Software Detailed Design
This module is responsible for processing power signals based on key presses.
Module Header
#include "power_signal_processing.h"
#include "rte.h"
Function Description
void powerSignalProcessing(void)
The function must check for the press of the power key. |
If the retrieved power state is POWER_STATE_OFF, the function shall set the power state to POWER_STATE_ON. |
If the retrieved power state is not POWER_STATE_OFF, the function shall set the power state to POWER_STATE_OFF. |
Function Flow
graph TD
Start[Start]
KeyCheck{Is 'P' key pressed?}
GetState{Get current power state}
IsOff{Is state OFF?}
TurnOn[Set state to ON]
TurnOff[Set state to OFF]
End[End]
Start --> KeyCheck
KeyCheck -->|Yes| GetState
KeyCheck -->|No| End
GetState --> IsOff
IsOff -->|Yes| TurnOn --> End
IsOff -->|No| TurnOff --> End