PSG14a emulator V1.00
PSG14a emulator for stating GTD350 engine
buttons.c File Reference

Contains functions to check the button state in non-blocking mode. More...

#include <stdint.h>
#include "clock_and_timers.h"
#include "gpio_exti.h"
#include "main_outputs.h"
#include "buttons.h"
Include dependency graph for buttons.c:

Data Structures

struct  Button_State_t
 holds the current switch (button) position (start/coldstart) and the timer how long it it is in the state More...
 

Functions

void Buttons_Reset (void)
 
State_t Buttons_Get_State (void)
 

Detailed Description

Contains functions to check the button state in non-blocking mode.

Date
27-04-2019
Author
Mykhaylo Shcherbak mikl7.nosp@m.4@ya.nosp@m.hoo.c.nosp@m.om

Function Documentation

◆ Buttons_Get_State()

State_t Buttons_Get_State ( void )

Returns the current state selected by pressed button or switch

Returns
the state

References Button_State_t::Button, BUTTON_COLD, BUTTON_NONE, BUTTON_START, BUTTON_WAIT_MS, IsExpiredTimer(), ResetTimer(), STATE_COLD, STATE_IDLE, STATE_START, and Button_State_t::Timer.

Referenced by main(), and mainCycleRun().

Here is the call graph for this function:

◆ Buttons_Reset()

void Buttons_Reset ( void )

Resets the button state machine. Needed after waking-up

References Button_State_t::Button, BUTTON_NONE, and Button_State_t::Timer.

Referenced by main().