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)
Specification: Read power key press SWDD_PSP-001 ../../../_images/arrow-right-circle.svg
is implemented by: SWIMPL_PSP-001
is tested by: TS_PSP-001

The function must check for the press of the power key.

Specification: Set power state to ON SWDD_PSP-002 ../../../_images/arrow-right-circle.svg
is implemented by: SWIMPL_PSP-001
is tested by: TS_PSP-002

If the retrieved power state is POWER_STATE_OFF, the function shall set the power state to POWER_STATE_ON.

Specification: Set power state to OFF SWDD_PSP-003 ../../../_images/arrow-right-circle.svg
is implemented by: SWIMPL_PSP-001
is tested by: TS_PSP-002

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