GrandAlf
Advanced Member level 2
Embedded C Question
I wonder if anyone can advise me on this one.
I am writing a program the uses sfr amd sbit to access mcu ports. At the moment they are specified outside of any function. When I have the all the functions declared in the main list, everything seem to work ok. But if I try to save the files as seperate functions, and then do an .h prototype, I am not able to access the ports. I have tried redefinig them in the function, but this just gives errors. I have looked in a few C guides, but they only talk about variables. Any pointers would be really appreciated.
I wonder if anyone can advise me on this one.
I am writing a program the uses sfr amd sbit to access mcu ports. At the moment they are specified outside of any function. When I have the all the functions declared in the main list, everything seem to work ok. But if I try to save the files as seperate functions, and then do an .h prototype, I am not able to access the ports. I have tried redefinig them in the function, but this just gives errors. I have looked in a few C guides, but they only talk about variables. Any pointers would be really appreciated.