Revision 1513
slightly modified makefile, added more error checking to bom beacon code
dragonfly_lib.c | ||
---|---|---|
65 | 65 |
|
66 | 66 |
void flash_red(void); |
67 | 67 |
|
68 |
void dragonfly_init(int config)
|
|
68 |
int dragonfly_init(int config)
|
|
69 | 69 |
{ |
70 | 70 |
sei(); |
71 | 71 |
// Set directionality of various IO pins |
... | ... | |
106 | 106 |
if(config & BOM) |
107 | 107 |
{ |
108 | 108 |
unsigned char bom_read = get_bom_type(); |
109 |
if(bom_read == 0xFF) |
|
109 |
if(bom_read == 0xFF) {
|
|
110 | 110 |
//warn that bom initialization failed |
111 | 111 |
flash_red(); |
112 |
return ERROR_INIT_FAILED; |
|
113 |
} |
|
112 | 114 |
else |
113 |
bom_init(bom_read); |
|
115 |
if (bom_init(bom_read) != 0) |
|
116 |
return ERROR_INIT_FAILED; |
|
114 | 117 |
} |
115 | 118 |
|
116 | 119 |
if (config & ENCODERS) |
... | ... | |
120 | 123 |
|
121 | 124 |
// delay a bit for stability |
122 | 125 |
_delay_ms(1); |
126 |
|
|
127 |
return 0; |
|
123 | 128 |
} |
124 | 129 |
|
125 | 130 |
//flash lights red three times and restore ports |
Also available in: Unified diff