From bc90dfb83866078bce80034d06607b0094aa63e4 Mon Sep 17 00:00:00 2001 From: Omar Magdy Date: Wed, 24 Aug 2022 23:42:32 +0200 Subject: Added the functionality of timers And finished the project --- main.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 1da8860..afbcce7 100644 --- a/main.c +++ b/main.c @@ -2,17 +2,23 @@ uint32_t period_1 = RED_PERIOD; uint32_t period_2 = GREEN_PERIOD; -uint32_t period_3 = RED_PERIOD; +uint32_t period_3 = GREEN_PERIOD; bool switch_pressed = false; +//Traffics +Traffic tf1 = {RED , GPIO_PORTA_BASE, 2, 3, 4}; +Traffic tf2 = {YELLOW, GPIO_PORTF_BASE, 1, 2, 3}; +Traffic tf_ped = {RED , GPIO_PORTB_BASE, 5, 0, 7}; -Traffic tf1 = {YELLOW, GPIO_PORTA_BASE, 2, 3, 4}; -Traffic tf2 = {RED , GPIO_PORTF_BASE, 1, 2, 3}; -Traffic tf_ped = {RED , GPIO_PORTB_BASE, 5, 4, 1}; +//Decoders +Bcd bcd1 = {GPIO_PORTE_BASE, 1, 2, 3, 5}; +Bcd bcd2 = {GPIO_PORTD_BASE, 1, 2, 3, 6}; +Bcd bcd_ped = {GPIO_PORTA_BASE, 5, 6, 7, 4}; // (5, 6, 7) A and 4 of E int main() { TrafficInit(); - // PortInit(GPIO_PORTA_BASE, SYSCTL_PERIPH_GPIOA, 0x0, 0xFF); // Initialize porta - // GPIOPinWrite(GPIO_PORTA_BASE, 0xFF, 2); + // PortInit(GPIO_PORTE_BASE, SYSCTL_PERIPH_GPIOE, 0x0, 0xFF); // Initialize porta + // GPIOPinWrite(GPIO_PORTE_BASE, 0xFF, 0); + // GPIOPinWrite(GPIO_PORTE_BASE, 0xFF, (1 << 1) | (1 << 2)); } -- cgit v1.2.3