Keil compiler doesn't allow us to use sbit in declaration file (.h - header) So I am using bit in declaration of 1-bit variable in my .h (header) file and sbit in definition (.c) file for sfr . I am working on a critical project so will this cause any problem while executing on hardware?? If yes, when??
It does not allow me to use sbit as extern sbit in File 1: var1.h for above case.
What do you mean, "does not allow me" ?
Show the exact, complete error message you get; and identify the line to which it relates
See: http://www.keil.com/forum/63979/
If you look at the Keil example, you'll see that they don't use extern with their sbit declarations ...
exampole on internet<code> static bit done_flag = 0; /* bit variable */
bit testfunc ( /* bit function */ bit flag1, /* bit arguments */ bit flag2) { . . . return (0); /* bit return value */ }