STM32 Traffic Control
Loading...
Searching...
No Matches
controller.c File Reference
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include "stm32f446xx.h"
#include "uart.h"
#include "queue.h"
#include "lights.h"
#include "systick.h"
#include "controller.h"

Functions

void checkGreenLightTimeout ()
void changeLight (uint32_t lightA, uint32_t lightB)
void SysTick_CheckFirstPressTimeout (void)
void EXTI15_10_IRQHandler (void)

Variables

const uint32_t BUTTON [BUTTONS] = {BUTTON1, BUTTON2, BUTTON3, BUTTON4}
bool timerActive = false
uint32_t timerStartTime = 0
uint32_t yellowStartTime = 0
uint32_t allocatedTime = 0
uint32_t activeLightPair = -1
bool waitingForProcess = false
bool waitForTimer = false
uint32_t waitingLightPair = -1
bool firstPress = false
uint32_t firstPressTime = 0
uint32_t firstPair = -1
uint32_t secondPair = -1

Function Documentation

◆ changeLight()

void changeLight ( uint32_t lightA,
uint32_t lightB )

◆ checkGreenLightTimeout()

void checkGreenLightTimeout ( void )

◆ EXTI15_10_IRQHandler()

void EXTI15_10_IRQHandler ( void )

◆ SysTick_CheckFirstPressTimeout()

void SysTick_CheckFirstPressTimeout ( void )

Variable Documentation

◆ activeLightPair

uint32_t activeLightPair = -1

◆ allocatedTime

uint32_t allocatedTime = 0

◆ BUTTON

const uint32_t BUTTON[BUTTONS] = {BUTTON1, BUTTON2, BUTTON3, BUTTON4}

◆ firstPair

uint32_t firstPair = -1

◆ firstPress

bool firstPress = false

◆ firstPressTime

uint32_t firstPressTime = 0

◆ secondPair

uint32_t secondPair = -1

◆ timerActive

bool timerActive = false

◆ timerStartTime

uint32_t timerStartTime = 0

◆ waitForTimer

bool waitForTimer = false

◆ waitingForProcess

bool waitingForProcess = false

◆ waitingLightPair

uint32_t waitingLightPair = -1

◆ yellowStartTime

uint32_t yellowStartTime = 0