summaryrefslogtreecommitdiff
path: root/color.c
diff options
context:
space:
mode:
authorOmar Magdy <omar.professional8777@gmail.com>2022-08-23 17:27:30 +0200
committerOmar Magdy <omar.professional8777@gmail.com>2022-08-23 17:27:30 +0200
commit291bed5067c1eac811f041c056130135725c8148 (patch)
treef70249ab23f5e7db4defc41995fafc234c34c229 /color.c
parent8a5f32723ef73e25fd6a19d199e1f3f1f1ca7f94 (diff)
downloadTraffic-light-291bed5067c1eac811f041c056130135725c8148.tar.xz
Traffic-light-291bed5067c1eac811f041c056130135725c8148.zip
Removed color.h and color.c
Diffstat (limited to 'color.c')
-rw-r--r--color.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/color.c b/color.c
deleted file mode 100644
index 297bd02..0000000
--- a/color.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "trafficlight.h"
-
-void set_color(uint8_t color) {
- uint32_t pins = GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6;
- switch (color) {
- case RED_TF1:
- GPIOPinWrite(GPIO_PORTF_BASE, pins, 0x2);
- break;
- case YELLOW_TF1:
- GPIOPinWrite(GPIO_PORTF_BASE, pins, 0x4);
- break;
- case GREEN_TF1:
- GPIOPinWrite(GPIO_PORTF_BASE, pins, 0x8);
- break;
- case RED_TF2:
- GPIOPinWrite(GPIO_PORTA_BASE, pins, 0x4);
- break;
- case YELLOW_TF2:
- GPIOPinWrite(GPIO_PORTA_BASE, pins, 0x8);
- break;
- case GREEN_TF2:
- GPIOPinWrite(GPIO_PORTA_BASE, pins, 0x10);
- break;
- }
-}
-
-// void toggle_color(uint8_t color) {
-// switch (color) {
-// case RED:
-// GPIO_PORTF_DATA_R ^= LED_RED;
-// break;
-// case BLUE:
-// GPIO_PORTF_DATA_R ^= LED_BLUE;
-// break;
-// case GREEN:
-// GPIO_PORTF_DATA_R ^= LED_GREEN;
-// break;
-// case WHITE:
-// GPIO_PORTF_DATA_R ^= (LED_RED | LED_BLUE | LED_GREEN);
-// break;
-// }
-// }
-
-void reset_color() {
- PORTF &= 0x11;
-}