Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3843

General discussion • How to make the GPIOD global

$
0
0
Just started using GPIOD and have run into a problem I hope someone can help me with. The main.c has the code that opens the chip, defines the lines used and declares them to be outputs. I call another function that I want to use the output lines, but it does not recognize "lines" in the code : gpiod_line_set_value_bulk(&lines, values);. Lines are declared in a line prior to main.c as struct gpiod_line_bulk lines;. When I compile gpiod_line_set_value_bulk(&lines, values) I get an error that states :
Move.c:76:28: error: ‘lines’ undeclared (first use in this function); did you mean ‘linger’?
76 | gpiod_line_set_value_bulk(&lines, values);
| ^~~~~
| linger

I tried declaring extern struct gpiod_line_bulk lines; in the BSP.h and struct gpiod_line_bulk lines; in the BSP.c (BSP = Board SupportPackage - a catch all for variables , #defines, etc), but that gives me a compile error also:
BSP.c:21:24: error: storage size of ‘lines’ isn’t known
21 | struct gpiod_line_bulk lines;
| ^~~~~
So, if anyone has any ideas on how to conquer this issue, I would appreciate your sharing with me.
Kind regards,
David

Statistics: Posted by DFansler — Sat Sep 28, 2024 12:59 am



Viewing all articles
Browse latest Browse all 3843

Trending Articles