- sprintf(g_buffer, "%s/AIN%d", g_options.adc_device_path, i);
- g_adc[i].fd_value = open(g_buffer, O_RDONLY);
- if (g_adc[i].fd_value < 0)
- {
- Abort("Couldn't open ADC %d device file %s - %s", i, g_buffer, strerror(errno));
- }
-
- //setbuf(g_adc[i].file_value, NULL);
+ AbortBool("Invalid ADC pin %d specified.", pin);
+ }
+ else if (g_adc[pin].initialised)
+ {
+ Log(LOGNOTE, "ADC %d already initialised", pin);
+ return true;
+ }