Skip to content

Commit 6d2610b

Browse files
committed
clean up source
1 parent 7075f7a commit 6d2610b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/c_adc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ int adc_initialized = 0;
3636

3737
int initialize_adc(void)
3838
{
39+
char test_path[40];
40+
FILE *fh;
3941
if (adc_initialized) {
4042
return 1;
4143
}
@@ -46,10 +48,9 @@ int initialize_adc(void)
4648
strncat(adc_prefix_dir, "/AIN", sizeof(adc_prefix_dir));
4749

4850
// Test that the directory has an AIN entry (found correct devicetree)
49-
char test_path[40];
5051
snprintf(test_path, sizeof(test_path), "%s%d", adc_prefix_dir, 0);
5152

52-
FILE *fh = fopen(test_path, "r");
53+
fh = fopen(test_path, "r");
5354

5455
if (!fh) {
5556
return 0;

0 commit comments

Comments
 (0)