summaryrefslogtreecommitdiff
path: root/trafficlight.h
diff options
context:
space:
mode:
authorOmar Magdy <omar.professional8777@gmail.com>2022-08-23 17:26:28 +0200
committerOmar Magdy <omar.professional8777@gmail.com>2022-08-23 17:26:28 +0200
commit8a5f32723ef73e25fd6a19d199e1f3f1f1ca7f94 (patch)
tree47b4bd0bd8682833a602d8f1ffee805231321b84 /trafficlight.h
parente304ce76cb2e66b3009cee4386d9de098e09ce94 (diff)
downloadTraffic-light-8a5f32723ef73e25fd6a19d199e1f3f1f1ca7f94.tar.xz
Traffic-light-8a5f32723ef73e25fd6a19d199e1f3f1f1ca7f94.zip
Removed color.h and color.c
Diffstat (limited to 'trafficlight.h')
-rw-r--r--trafficlight.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/trafficlight.h b/trafficlight.h
index 2f8f33d..6d86982 100644
--- a/trafficlight.h
+++ b/trafficlight.h
@@ -1,12 +1,14 @@
#include <stdint.h>
#include <stdbool.h>
#include "tivaware.h"
-#include "color.h"
#define TIVA_CLK 16e6
#define GREEN_PERIOD TIVA_CLK * 5
#define YELLOW_PERIOD TIVA_CLK * 2
#define RED_PERIOD TIVA_CLK * 7
+#define RED 1
+#define YELLOW 2
+#define GREEN 3
typedef struct Traffic{
@@ -15,6 +17,7 @@ typedef struct Traffic{
uint8_t red;
uint8_t yellow;
uint8_t green;
+ uint32_t prevPeriod;
} Traffic;
extern Traffic tf1;