I am not very much familiar with modular structure of C programming, so I decided to ask you for help. Let pretend I have two modules into the project. The one is sx1272.c and the other is sx1272_ll.c. The variable radio_is_on is declared in sx1272_ll.c as follows:
static uint8_t volatile radio_is_on;
and then accessed by function in sx1272.c like this:
foo(){
...............
if(radio_is_on){
blablabla...
............
}
...............
}
So if radio_is_on is static (in module scope) how come it is accessed by other modules?
sx1272_ll.c
sx1272.c
It seems to me that you included
#include "sx1272_ll.c"
in you your source file sx1272.c
So the whole content of file sx1272_ll.c is just copy-pasted into sx1272.c, at the position where you have written #include "sx1272_ll.c" during the pre-proccesing stage.
Refer this link: https://en.wikipedia.org/wiki/C_preprocessor#Including_files
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With