Project

General

Profile

Revision 1387

Added by James Kong over 13 years ago

Changed analog to support status checking. Updated bom_refresh to use it.

View differences:

bom.c
167 167
 **/
168 168
void bom_refresh(int bit_field) {
169 169
    int i;
170
	int loop_running;
170
	int loop_was_running = 0;
171 171
    
172 172
	//Check analog loop status
173
	loop_running = analog_loop_running();
174
    if(loop_running)
173
    if(analog_loop_status() == ADC_LOOP_RUNNING) {
174
		loop_was_running = 1;
175 175
		analog_stop_loop();
176
	}
176 177
    
178
	//Read BOM values
177 179
    for(i = 0; i < NUM_BOM_LEDS; i++) {
178 180
        if(bit_field & 0x1) {
179 181
            bom_select(i);
......
183 185
    }
184 186
    
185 187
	//Restore analog loop status
186
	if(loop_running)
188
	if(loop_was_running)
187 189
		analog_start_loop();
188 190
}
189 191

  

Also available in: Unified diff