Revision 378
fixed style problems
dragonfly_lib.c | ||
---|---|---|
62 | 62 |
* @see analog_init, usb_init, xbee_init, buzzer_init, |
63 | 63 |
* bom_init, orb_init, motors_init, lcd_init |
64 | 64 |
**/ |
65 |
void dragonfly_init(int config) |
|
66 |
{ |
|
67 |
sei(); |
|
65 |
void dragonfly_init(int config) { |
|
66 |
sei(); |
|
68 | 67 |
|
69 |
// Set directionality of various IO pins
|
|
70 |
DDRG &= ~(_BV(PING0)|_BV(PING1));
|
|
71 |
PORTG |= _BV(PING0)|_BV(PING1);
|
|
68 |
// Set directionality of various IO pins
|
|
69 |
DDRG &= ~(_BV(PING0)|_BV(PING1));
|
|
70 |
PORTG |= _BV(PING0)|_BV(PING1);
|
|
72 | 71 |
|
73 |
if(config & ANALOG)
|
|
74 |
analog_init(ADC_START);
|
|
72 |
if(config & ANALOG)
|
|
73 |
analog_init(ADC_START);
|
|
75 | 74 |
|
76 |
if(config & COMM) |
|
77 |
{ |
|
78 |
//Defaults to 115200. Check serial.h for more information. |
|
79 |
usb_init(); |
|
80 |
xbee_init(); |
|
81 |
} |
|
75 |
if(config & COMM) { |
|
76 |
//Defaults to 115200. Check serial.h for more information. |
|
77 |
usb_init(); |
|
78 |
xbee_init(); |
|
79 |
} |
|
82 | 80 |
|
83 |
if(config & BUZZER) |
|
84 |
{ |
|
85 |
sei(); |
|
86 |
buzzer_init(); |
|
87 |
} |
|
81 |
if(config & BUZZER) { |
|
82 |
sei(); |
|
83 |
buzzer_init(); |
|
84 |
} |
|
88 | 85 |
|
89 |
if(config & ORB) |
|
90 |
{ |
|
91 |
sei(); |
|
92 |
orb_init(); |
|
93 |
} |
|
86 |
if(config & ORB) { |
|
87 |
sei(); |
|
88 |
orb_init(); |
|
89 |
} |
|
94 | 90 |
|
95 |
if(config & MOTORS)
|
|
96 |
motors_init();
|
|
91 |
if(config & MOTORS)
|
|
92 |
motors_init();
|
|
97 | 93 |
|
98 |
if(config & LCD)
|
|
99 |
lcd_init();
|
|
94 |
if(config & LCD)
|
|
95 |
lcd_init();
|
|
100 | 96 |
|
101 |
if(config & ORB) |
|
102 |
{ |
|
103 |
sei(); |
|
104 |
orb_init(); |
|
105 |
} |
|
97 |
if(config & ORB) { |
|
98 |
sei(); |
|
99 |
orb_init(); |
|
100 |
} |
|
106 | 101 |
|
107 |
// delay a bit for stability
|
|
108 |
_delay_ms(1);
|
|
102 |
// delay a bit for stability
|
|
103 |
_delay_ms(1);
|
|
109 | 104 |
} |
110 | 105 |
|
111 | 106 |
|
Also available in: Unified diff