ocpoc_adc: make xadc_fd a local variable instead of a class member

This commit is contained in:
Beat Küng
2017-07-13 16:53:28 +02:00
parent 2cf88156a9
commit 5cbee15309
+1 -2
View File
@@ -79,7 +79,6 @@ private:
pthread_mutex_t _samples_lock;
adc_msg_s _samples;
FILE *xadc_fd;
};
OcpocADC::OcpocADC()
@@ -153,7 +152,7 @@ int OcpocADC::read(struct adc_msg_s(*buf)[12], unsigned int len)
uint32_t buff[1];
int ret = 0;
xadc_fd = fopen(ADC_VOLTAGE_PATH, "r");
FILE *xadc_fd = fopen(ADC_VOLTAGE_PATH, "r");
if (xadc_fd != NULL) {
fscanf(xadc_fd, "%d", buff);