This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

external code variable

Hello,

We are using PK51 for our project using code banking technique.

For this we have created 3 source files,

1. One is for common area which contains time ISR, Serial Part ISR and function which are common for anther 2 banks.
2. 2nd source file will load in bank "0"
3. 3rd source file will load in bank "1"

Now we having variable for these 3 files. We declared these variables in common source file and declared them variables as external for remaining 2 files.

We are having constant variables which are same for these 3 files. But when we compile; PK51 gives us error and it is required that we have to defined these constants variables with separate names in 3 same files.

Is there any method like "external variables" so that we can define this constant single time?

Example:

Part1.c >>> part1.h
Part2.c>>> part2.h
Part3.c >>> part3.h

Constants

Part1.h
Unsigned char code xyz = {0x01,0X02,0x03};
Part2.h
Unsigned char code pqr = {0x01,0X02,0x03};
Part2.h
Unsigned char code lmn = {0x01,0X02,0x03};

0