From 5cbee15309f6e0eea21e68d0997f43ac220c730a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Tue, 6 Jun 2017 15:33:58 +0200 Subject: [PATCH] ocpoc_adc: make xadc_fd a local variable instead of a class member --- src/drivers/ocpoc_adc/ocpoc_adc.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/drivers/ocpoc_adc/ocpoc_adc.cpp b/src/drivers/ocpoc_adc/ocpoc_adc.cpp index 2a4a8bf2f0..757be1c549 100644 --- a/src/drivers/ocpoc_adc/ocpoc_adc.cpp +++ b/src/drivers/ocpoc_adc/ocpoc_adc.cpp @@ -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);