Revision 1406
Merged analog and bom changes from analog branch. Tested and working. Fixes #560
bom.c | ||
---|---|---|
167 | 167 |
**/ |
168 | 168 |
void bom_refresh(int bit_field) { |
169 | 169 |
int i; |
170 |
int loop_was_running = 0; |
|
170 | 171 |
|
171 |
analog_stop_loop(); |
|
172 |
//Check analog loop status |
|
173 |
if(analog_loop_status() == ADC_LOOP_RUNNING) { |
|
174 |
loop_was_running = 1; |
|
175 |
analog_stop_loop(); |
|
176 |
} |
|
172 | 177 |
|
178 |
//Read BOM values |
|
173 | 179 |
for(i = 0; i < NUM_BOM_LEDS; i++) { |
174 | 180 |
if(bit_field & 0x1) { |
175 | 181 |
bom_select(i); |
... | ... | |
178 | 184 |
bit_field = bit_field >> 1; |
179 | 185 |
} |
180 | 186 |
|
181 |
analog_start_loop(); |
|
187 |
//Restore analog loop status |
|
188 |
if(loop_was_running) |
|
189 |
analog_start_loop(); |
|
182 | 190 |
} |
183 | 191 |
|
184 | 192 |
/** |
Also available in: Unified diff