summaryrefslogtreecommitdiff
path: root/trafficlight.h
diff options
context:
space:
mode:
authorOmar Magdy <omar.professional8777@gmail.com>2022-08-23 21:19:38 +0200
committerOmar Magdy <omar.professional8777@gmail.com>2022-08-23 21:19:38 +0200
commiteac8a1b2ee3761ed3107587b36c10c1e26f9d59f (patch)
tree17d3ac75ae58821afe298383ad3a43647aabb781 /trafficlight.h
parent291bed5067c1eac811f041c056130135725c8148 (diff)
downloadTraffic-light-eac8a1b2ee3761ed3107587b36c10c1e26f9d59f.tar.xz
Traffic-light-eac8a1b2ee3761ed3107587b36c10c1e26f9d59f.zip
Added switch_handler() function which allows the pedestrian to make the
other traffic lights red and his green and at the same time when his light turns red the other continue where they left off + Moved all code to trafficlight.c and made the main less clutered
Diffstat (limited to 'trafficlight.h')
-rw-r--r--trafficlight.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/trafficlight.h b/trafficlight.h
index 6d86982..510b89c 100644
--- a/trafficlight.h
+++ b/trafficlight.h
@@ -1,5 +1,6 @@
#include <stdint.h>
#include <stdbool.h>
+#include <stdlib.h>
#include "tivaware.h"
#define TIVA_CLK 16e6
@@ -22,7 +23,14 @@ typedef struct Traffic{
extern Traffic tf1;
extern Traffic tf2;
+extern Traffic tf_ped;
+extern bool switch_pressed;
+extern uint32_t period_1;
+extern uint32_t period_2;
+extern uint32_t period_3;
+void TrafficInit();
void set_tf_color(Traffic tf, uint8_t color);
-void PortInit(uint32_t port, uint32_t clk);
+void PortInit(uint32_t port, uint32_t clk, uint32_t input, uint32_t output);
void TimerInit(uint32_t timer, void(*timer_handler)(), uint32_t clk, uint32_t delay);
+