Revision 1543
Added a bunch of debug prints to the library
analog.c | ||
---|---|---|
81 | 81 |
* |
82 | 82 |
**/ |
83 | 83 |
int analog_init(int start_conversion) { |
84 |
if(analog_initd) |
|
84 |
if(analog_initd){ |
|
85 |
DRAGONFLY_DEBUG_PRINT("ERROR: analog already init'd\r\n"); |
|
85 | 86 |
return ERROR_INIT_ALREADY_INITD; |
87 |
} |
|
86 | 88 |
|
87 | 89 |
for (int i = 0; i < 11; i++) { |
88 | 90 |
an_val[i].adc10 = 0; |
... | ... | |
188 | 190 |
* @see analog_stop_loop, analog_loop_status |
189 | 191 |
**/ |
190 | 192 |
int analog_start_loop(void) { |
191 |
if(!analog_initd) |
|
193 |
if(!analog_initd) { |
|
194 |
DRAGONFLY_DEBUG_PRINT("ERROR: analog not init'd\r\n"); |
|
192 | 195 |
return ERROR_LIBRARY_NOT_INITD; |
196 |
} |
|
193 | 197 |
|
194 | 198 |
if(adc_loop_status != ADC_LOOP_RUNNING){ |
195 | 199 |
//Start the conversion, enable ADC interrupt |
... | ... | |
212 | 216 |
* @see analog_start_loop, analog_loop_status |
213 | 217 |
**/ |
214 | 218 |
int analog_stop_loop() { |
215 |
if(!analog_initd) |
|
219 |
if(!analog_initd) { |
|
220 |
DRAGONFLY_DEBUG_PRINT("ERROR: analog not init'd\r\n"); |
|
216 | 221 |
return ERROR_LIBRARY_NOT_INITD; |
222 |
} |
|
217 | 223 |
|
218 | 224 |
//Signal to stop after the next conversion |
219 | 225 |
adc_sig_stop_loop = 1; |
Also available in: Unified diff