Embedded C Question / writing a program / sfr amd sbit

Status
Not open for further replies.

GrandAlf

Advanced Member level 2
Joined
Mar 9, 2002
Messages
520
Helped
47
Reputation
92
Reaction score
6
Trophy points
1,298
Location
UK
Activity points
4,730
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.
 

make sure you know the difference of
#include <my_header.h>
and
#include "my_header.h"

was this the problem?
 

Thanks Thomaz,

I am using "xxx.h".

I thought that if I specified port definitions outside any functions, they would be available to all functions. Maybe I need to specify these first, before any includes. I will try on Monday when I get back to the office.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…