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

Contains functions that are called in while(1) main cycle and after it. More...

#include "main_cycle.h"
#include "main_outputs.h"
#include "led.h"
#include "led_control.h"
#include "buttons.h"
#include "clock_and_timers.h"
Include dependency graph for main_cycle.c:

Enumerations

enum  MCSM_State_t {
  MCSM_Idle = 0 , MCSM_Cold , MCSM_Start , MCSM_Emergency_Stop_Cold ,
  MCSM_Emergency_Stop_Start
}
 Main Cycle State Machine states. More...
 

Functions

void mainCycleRun (void)
 This function is called in while(1). Waiting for the end of the tick is done after it.
 
void mainCyclePreRun (void)
 This function is called before main cycle and makes 5s pause to connect debugger if needed.
 

Detailed Description

Contains functions that are called in while(1) main cycle and after it.

Author
Mykhaylo Shcherbak mikl7.nosp@m.4@ya.nosp@m.hoo.c.nosp@m.om
Date
03-08-2019
Version
1.00

Enumeration Type Documentation

◆ MCSM_State_t

Main Cycle State Machine states.

Enumerator
MCSM_Idle 
MCSM_Cold 

Idle state

MCSM_Start 

Cold start - start without priming fuel and spark

MCSM_Emergency_Stop_Cold 

Main start mode

MCSM_Emergency_Stop_Start 

Switch was put in start position while in cold starting mode, stop and go to idle Switch was put in cold position while in main starting mode, stop and go to idle

Function Documentation

◆ mainCyclePreRun()

void mainCyclePreRun ( void )

This function is called before main cycle and makes 5s pause to connect debugger if needed.

References GPIO_LED, Gpio_Reset_Pin(), Gpio_Set_Pin(), IsExpiredTimer(), and ResetTimer().

Referenced by main().

Here is the call graph for this function:

◆ mainCycleRun()

void mainCycleRun ( void )

This function is called in while(1). Waiting for the end of the tick is done after it.

References Blink_Led(), Buttons_Get_State(), Control_Outs(), MCSM_Cold, MCSM_Emergency_Stop_Cold, MCSM_Emergency_Stop_Start, MCSM_Idle, MCSM_Start, Set_State(), STATE_COLD, STATE_IDLE, and STATE_START.

Referenced by main().

Here is the call graph for this function: