source: firmware/FSC/src/tests.c@ 13314

Last change on this file since 13314 was 10094, checked in by neise, 14 years ago
initial commit of FSC firmware - use for FSC testing only -
File size: 684 bytes
Line 
1#include "tests.h"
2
3#include "typedefs.h"
4
5void test_out_spare_pins(void)
6{
7
8 // set everything as inputs -- high Z
9 DDRA = 0x00;
10 DDRB = 0x00;
11 DDRC = 0x00;
12 DDRD = 0x00;
13
14 DDRB |= 1<<PB2; // set spare out1 as output
15 DDRB |= 1<<PB3; // set spare out2 as output
16
17 DDRB |= 1<<PB4;
18
19 PORTC |= 1<<PC7; // switch PC7 pullup on
20 PORTA |= 1<<PA7; // switch PA7 pullup on
21
22 while (true)
23 {
24
25 if ( (PINC & (1<<PC7)) == 0 )
26 {
27 PORTB |= 1 << PB2;
28 } else {
29 PORTB &= ~(1<<PB2);
30 }
31
32 /*
33 if ( (PINA & (1<<PA7)) == 0 )
34 {
35 PORTB |= 1 << PB3;
36 } else {
37 PORTB &= ~(1<<PB3);
38 }
39*/
40
41 PORTB ^= 1<<PB3;
42 PORTB ^= 1<<PB4;
43 }
44
45
46
47}
Note: See TracBrowser for help on using the repository browser.