Hello!
In the Test.Lib Library I am creating a function, which set a specific port and pin. The port and pin must be defined in the project to which i have added Test.Lib
In Library Project, I have Test.C
Test.C ======= extern char Port; extern bit pin; void func(unsigned char ch, bit bt) { Port = ch; pin = bt; }
the Test.Lib is successfully compiled and generated the .Lib file. Now I added this .Lib file to my working project. The main file look like this.
main.c ======
#define Port P1 sbit pin = P0^0;
void func(unsigned char ch, bit bt); //Prototype
void main(void) { func(0x55,1); while(1); }
It doest not set the desired values to Port and Pin. Please help me in this regard.
Thanks. with regards. SAJJAD
"have your program contain functions to set and clear the signals and have the library call these functions"
For an example of this, see how the C51 implementation of the library function printff uses the basic IO funtions:
http://www.keil.com/support/man/docs/c51/c51_printf.htm http://www.keil.com/support/man/docs/c51/c51_ap_basicio.htm