summaryrefslogtreecommitdiff
path: root/rushs/tinyprintf/traffic_lights/traffic_lights.c
diff options
context:
space:
mode:
Diffstat (limited to 'rushs/tinyprintf/traffic_lights/traffic_lights.c')
-rw-r--r--rushs/tinyprintf/traffic_lights/traffic_lights.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/rushs/tinyprintf/traffic_lights/traffic_lights.c b/rushs/tinyprintf/traffic_lights/traffic_lights.c
deleted file mode 100644
index 76ea94f..0000000
--- a/rushs/tinyprintf/traffic_lights/traffic_lights.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "traffic_lights.h"
-
-void init(unsigned char *lights)
-{
- *lights <<= 4;
-}
-
-void turn_on(unsigned char *lights, unsigned char light_num)
-{
- *lights |= 1 << (light_num - 1);
-}
-
-void turn_off(unsigned char *lights, unsigned char light_num)
-{
- *lights &= ~(1 << (light_num - 1));
-}
-
-void next_step(unsigned char *lights)
-{
- *lights <<= 1;
- *lights += *lights >> 4;
-}
-
-void reverse(unsigned char *lights)
-{
- *lights = ~*lights;
-}
-
-void swap(unsigned char *lights_1, unsigned char *lights_2)
-{
- if (lights_1 == lights_2)
- {
- return;
- }
- *lights_1 = *lights_2 ^ *lights_1;
- *lights_2 = *lights_1 ^ *lights_2;
- *lights_1 = *lights_2 ^ *lights_1;
-}