blackbox/lowlevel.c

Mon, 05 Dec 2011 17:14:32 +0100

author
Malte Bayer <mbayer@neo-soft.org>
date
Mon, 05 Dec 2011 17:14:32 +0100
changeset 38
ff76255904c4
parent 37
136a79772098
child 41
9857c18c5e64
permissions
-rw-r--r--

implemented response reader to carrerashark

2
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
1 #include <avr/interrupt.h>
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
2 #include <avr/pgmspace.h>
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
3 #include <util/delay.h>
0
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
4 #include "stdint.h"
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
5 #include "main.h"
3
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
6 #include "driver/adc.h"
2
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
7 #include "driver/rs232.h"
3
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
8 #include "lowlevel.h"
0
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
9
34
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
10 void blinkdelay(void) {
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
11 _delay_ms(50);
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
12 }
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
13
0
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
14 void LED(uint8_t num, uint8_t state) {
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
15 switch (num) {
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
16 case 1: switch (state) {
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
17 case 0: LED1_PORT &= ~_BV(LED1); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
18 case 1: LED1_PORT |= _BV(LED1); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
19 case 2: LED1_PORT ^= _BV(LED1); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
20 } break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
21
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
22 case 2: switch (state) {
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
23 case 0: LED2_PORT &= ~_BV(LED2); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
24 case 1: LED2_PORT |= _BV(LED2); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
25 case 2: LED2_PORT ^= _BV(LED2); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
26 } break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
27
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
28 case 3: switch (state) {
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
29 case 0: LED3_PORT &= ~_BV(LED3); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
30 case 1: LED3_PORT |= _BV(LED3); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
31 case 2: LED3_PORT ^= _BV(LED3); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
32 } break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
33
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
34 case 4: switch (state) {
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
35 case 0: LED4_PORT &= ~_BV(LED4); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
36 case 1: LED4_PORT |= _BV(LED4); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
37 case 2: LED4_PORT ^= _BV(LED4); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
38 } break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
39
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
40 case 5: switch (state) {
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
41 case 0: LED5_PORT &= ~_BV(LED5); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
42 case 1: LED5_PORT |= _BV(LED5); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
43 case 2: LED5_PORT ^= _BV(LED5); break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
44 } break;
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
45 }
9b7de464f0ea initial commit - controller1 working
Malte Bayer <mbayer@neo-soft.org>
parents:
diff changeset
46 }
2
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
47
37
136a79772098 implemented race prepare phase, countdown and jumpstart detection
Malte Bayer <mbayer@neo-soft.org>
parents: 34
diff changeset
48 void LEDS_OFF(void) {
136a79772098 implemented race prepare phase, countdown and jumpstart detection
Malte Bayer <mbayer@neo-soft.org>
parents: 34
diff changeset
49 LED1_PORT &= ~_BV(LED1);
136a79772098 implemented race prepare phase, countdown and jumpstart detection
Malte Bayer <mbayer@neo-soft.org>
parents: 34
diff changeset
50 LED2_PORT &= ~_BV(LED1);
136a79772098 implemented race prepare phase, countdown and jumpstart detection
Malte Bayer <mbayer@neo-soft.org>
parents: 34
diff changeset
51 LED3_PORT &= ~_BV(LED1);
136a79772098 implemented race prepare phase, countdown and jumpstart detection
Malte Bayer <mbayer@neo-soft.org>
parents: 34
diff changeset
52 LED4_PORT &= ~_BV(LED1);
136a79772098 implemented race prepare phase, countdown and jumpstart detection
Malte Bayer <mbayer@neo-soft.org>
parents: 34
diff changeset
53 LED5_PORT &= ~_BV(LED1);
136a79772098 implemented race prepare phase, countdown and jumpstart detection
Malte Bayer <mbayer@neo-soft.org>
parents: 34
diff changeset
54 }
136a79772098 implemented race prepare phase, countdown and jumpstart detection
Malte Bayer <mbayer@neo-soft.org>
parents: 34
diff changeset
55
3
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
56 void init_hardware(void) {
7
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
57 // reset all ports to input, no pullup
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
58 DDRA = 0; PORTA = 0;
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
59 DDRB = 0; PORTB = 0;
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
60 DDRC = 0; PORTC = 0;
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
61 DDRD = 0; PORTD = 0;
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
62
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
63
34
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
64 RS232_init(); // initialize RS232 interface
3
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
65 initADC();
7
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
66 SFIOR = 0;
3
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
67
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
68 // set LED output
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
69 DDR(LED1_PORT) |= _BV(LED1);
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
70 DDR(LED2_PORT) |= _BV(LED2);
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
71 DDR(LED3_PORT) |= _BV(LED3);
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
72 DDR(LED4_PORT) |= _BV(LED4);
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
73 DDR(LED5_PORT) |= _BV(LED5);
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
74
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
75 // set Controller Input Pull-UPs
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
76 CONTROLLER_PORT |= (_BV(CONTROLLER1_SW) | _BV(CONTROLLER2_SW) | _BV(CONTROLLER3_SW) | _BV(CONTROLLER4_SW));
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
77
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
78 // switch pull-ups
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
79 SW_FUEL_PORT |= _BV(SW_FUEL);
7
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
80 SW_START_PORT |= _BV(SW_START);
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
81 SW_PACECAR_PORT |= _BV(SW_PACECAR);
3
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
82
7
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
83 // control outputs
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
84 DDR(LAP_COUNTER_PORT) |= _BV(LAP_COUNTER);
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
85
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
86 // setup rail control
3
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
87 //RAIL_DETECT_PORT |= _BV(RAIL_DETECT); // enable internal pull-up
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
88 DDR(RAIL_POWER_PORT) |= _BV(RAIL_POWER);
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
89
7
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
90 // display init sequence on LEDs
34
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
91 LED(1, 1); blinkdelay();
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
92 LED(2, 1); blinkdelay();
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
93 LED(3, 1); blinkdelay();
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
94 LED(4, 1); blinkdelay();
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
95 LED(5, 1); blinkdelay();
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
96 LED(1, 0); blinkdelay();
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
97 LED(2, 0); blinkdelay();
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
98 LED(3, 0); blinkdelay();
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
99 LED(4, 0); blinkdelay();
d12d095e3282 some code cleanup
Malte Bayer <mbayer@neo-soft.org>
parents: 33
diff changeset
100 LED(5, 0);
3
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
101
6
2405aff29a51 added response receiver timer
Malte Bayer <mbayer@neo-soft.org>
parents: 4
diff changeset
102
2405aff29a51 added response receiver timer
Malte Bayer <mbayer@neo-soft.org>
parents: 4
diff changeset
103 // setup response receiver timer
2405aff29a51 added response receiver timer
Malte Bayer <mbayer@neo-soft.org>
parents: 4
diff changeset
104 TCCR0 = (1<<CS01); //divide by 8
2405aff29a51 added response receiver timer
Malte Bayer <mbayer@neo-soft.org>
parents: 4
diff changeset
105 // interrupt enable + tcnt0 set in timer2
3
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
106
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
107
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
108 // setup data bit timer
7
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
109 TCCR2 = (1<<CS21) | (1<<WGM21); //divide by 8, set compare match
3
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
110 OCR2 = TIMER2_50US;
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
111 TIMSK |= 1<<OCIE2; //enable timer2 interrupt
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
112
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
113 // setup data packet timer
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
114 //TCCR1A = (1<<COM1A1);
7
f4e250d5402b fixes, bound lap counter reset to race start button
Malte Bayer <mbayer@neo-soft.org>
parents: 6
diff changeset
115 TCCR1B = (1<<CS11) | (1<<WGM12); //divide by 8, set compare match
3
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
116 //TCCR1B = (1<<CS11) | (1<<CS10); //divide by 64
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
117 //TCNT1 = TIMER_7500NS;
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
118 OCR1A = TIMER1_7500NS;
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
119 TIMSK |= 1<<OCIE1A; //enable timer1 interrupt
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
120
37
136a79772098 implemented race prepare phase, countdown and jumpstart detection
Malte Bayer <mbayer@neo-soft.org>
parents: 34
diff changeset
121 RS232_puts_p(PSTR("FreeSlot Blackbox v"));
136a79772098 implemented race prepare phase, countdown and jumpstart detection
Malte Bayer <mbayer@neo-soft.org>
parents: 34
diff changeset
122 RS232_puts(VERSION);
136a79772098 implemented race prepare phase, countdown and jumpstart detection
Malte Bayer <mbayer@neo-soft.org>
parents: 34
diff changeset
123 RS232_putc('\n');
3
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
124
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
125 }
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
126
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
127
1a0ef40ef458 fixed track change keys
Malte Bayer <mbayer@neo-soft.org>
parents: 2
diff changeset
128
2
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
129 void check_rails_shortcut(void) {
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
130 // check for short circuit on the rails
10
6d6e982bbc41 meeting2 stuff
Malte Bayer <mbayer@neo-soft.org>
parents: 7
diff changeset
131 uint8_t i = 100;
2
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
132 if ((PIN(RAIL_DETECT_PORT) & _BV(RAIL_DETECT)) == 0) {
10
6d6e982bbc41 meeting2 stuff
Malte Bayer <mbayer@neo-soft.org>
parents: 7
diff changeset
133 while (i>0) {
6d6e982bbc41 meeting2 stuff
Malte Bayer <mbayer@neo-soft.org>
parents: 7
diff changeset
134 if ((PIN(RAIL_DETECT_PORT) & _BV(RAIL_DETECT)) != 0) return 0;
6d6e982bbc41 meeting2 stuff
Malte Bayer <mbayer@neo-soft.org>
parents: 7
diff changeset
135 _delay_us(20);
33
c261350bb394 fixed shortcut detection
Malte Bayer <mbayer@neo-soft.org>
parents: 10
diff changeset
136 i--;
10
6d6e982bbc41 meeting2 stuff
Malte Bayer <mbayer@neo-soft.org>
parents: 7
diff changeset
137 }
2
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
138 if ((PIN(RAIL_DETECT_PORT) & _BV(RAIL_DETECT)) == 0) {
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
139 cli(); // disable ALL Interrupts
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
140 RAIL_POWER_PORT &= ~_BV(RAIL_POWER); // disable rails power
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
141 RS232_puts_p(PSTR("!!! SHORT CIRCUIT ON RAILS, POWERED OFF !!!\n"));
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
142 LED(1, 1);
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
143 LED(2, 1);
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
144 LED(3, 0);
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
145 LED(4, 0);
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
146 LED(5, 0);
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
147 while (1) {
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
148 LED(1, 2);
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
149 LED(2, 2);
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
150 LED(4, 2);
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
151 LED(5, 2);
33
c261350bb394 fixed shortcut detection
Malte Bayer <mbayer@neo-soft.org>
parents: 10
diff changeset
152 blinkdelay();
2
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
153 LED(3, 2);
33
c261350bb394 fixed shortcut detection
Malte Bayer <mbayer@neo-soft.org>
parents: 10
diff changeset
154 blinkdelay();
2
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
155 LED(3, 2);
33
c261350bb394 fixed shortcut detection
Malte Bayer <mbayer@neo-soft.org>
parents: 10
diff changeset
156 blinkdelay();
2
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
157 LED(3, 2);
33
c261350bb394 fixed shortcut detection
Malte Bayer <mbayer@neo-soft.org>
parents: 10
diff changeset
158 blinkdelay();
2
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
159 LED(3, 2);
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
160 }
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
161 }
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
162 }
6c59b4293fa9 finished: rails short circuit check
Malte Bayer <mbayer@neo-soft.org>
parents: 0
diff changeset
163 }

mercurial