blackbox/lowlevel.c

changeset 0
9b7de464f0ea
child 2
6c59b4293fa9
equal deleted inserted replaced
-1:000000000000 0:9b7de464f0ea
1 #include "stdint.h"
2 #include "main.h"
3
4 void LED(uint8_t num, uint8_t state) {
5 switch (num) {
6 case 1: switch (state) {
7 case 0: LED1_PORT &= ~_BV(LED1); break;
8 case 1: LED1_PORT |= _BV(LED1); break;
9 case 2: LED1_PORT ^= _BV(LED1); break;
10 } break;
11
12 case 2: switch (state) {
13 case 0: LED2_PORT &= ~_BV(LED2); break;
14 case 1: LED2_PORT |= _BV(LED2); break;
15 case 2: LED2_PORT ^= _BV(LED2); break;
16 } break;
17
18 case 3: switch (state) {
19 case 0: LED3_PORT &= ~_BV(LED3); break;
20 case 1: LED3_PORT |= _BV(LED3); break;
21 case 2: LED3_PORT ^= _BV(LED3); break;
22 } break;
23
24 case 4: switch (state) {
25 case 0: LED4_PORT &= ~_BV(LED4); break;
26 case 1: LED4_PORT |= _BV(LED4); break;
27 case 2: LED4_PORT ^= _BV(LED4); break;
28 } break;
29
30 case 5: switch (state) {
31 case 0: LED5_PORT &= ~_BV(LED5); break;
32 case 1: LED5_PORT |= _BV(LED5); break;
33 case 2: LED5_PORT ^= _BV(LED5); break;
34 } break;
35 }
36 }

mercurial