41 case 0: LED5_PORT &= ~_BV(LED5); break; |
41 case 0: LED5_PORT &= ~_BV(LED5); break; |
42 case 1: LED5_PORT |= _BV(LED5); break; |
42 case 1: LED5_PORT |= _BV(LED5); break; |
43 case 2: LED5_PORT ^= _BV(LED5); break; |
43 case 2: LED5_PORT ^= _BV(LED5); break; |
44 } break; |
44 } break; |
45 } |
45 } |
|
46 } |
|
47 |
|
48 void LEDS_OFF(void) { |
|
49 LED1_PORT &= ~_BV(LED1); |
|
50 LED2_PORT &= ~_BV(LED1); |
|
51 LED3_PORT &= ~_BV(LED1); |
|
52 LED4_PORT &= ~_BV(LED1); |
|
53 LED5_PORT &= ~_BV(LED1); |
46 } |
54 } |
47 |
55 |
48 void init_hardware(void) { |
56 void init_hardware(void) { |
49 // reset all ports to input, no pullup |
57 // reset all ports to input, no pullup |
50 DDRA = 0; PORTA = 0; |
58 DDRA = 0; PORTA = 0; |
108 //TCCR1B = (1<<CS11) | (1<<CS10); //divide by 64 |
116 //TCCR1B = (1<<CS11) | (1<<CS10); //divide by 64 |
109 //TCNT1 = TIMER_7500NS; |
117 //TCNT1 = TIMER_7500NS; |
110 OCR1A = TIMER1_7500NS; |
118 OCR1A = TIMER1_7500NS; |
111 TIMSK |= 1<<OCIE1A; //enable timer1 interrupt |
119 TIMSK |= 1<<OCIE1A; //enable timer1 interrupt |
112 |
120 |
113 RS232_puts_p(PSTR("FreeSlot Blackbox v1.0\n")); |
121 RS232_puts_p(PSTR("FreeSlot Blackbox v")); |
|
122 RS232_puts(VERSION); |
|
123 RS232_putc('\n'); |
114 |
124 |
115 } |
125 } |
116 |
126 |
117 |
127 |
118 |
128 |