??? 02/28/11 13:03 Read: times |
#181333 - extern const code declaration Responding to: ???'s previous message |
We defined an array in code bank 0 as:
static const unsigned char code led_array[8] = {0xFE,0xFD,0xFB,0xF7,oxEF,0xDF,0xBF,0x7F}; and defined one more copy of this array in code bank 1 as: static const unsigned char code b1_led_array[8] = {0xFE,oxFD,0xFB,0xF7,oxEF,0xDF,0xBF,0x7F}; There are few more arrays of this type of usage in our project. At a later stage in code development, inorder to save the code, We made use of extern . For this, we changed the above usage in code bank 0 as: const unsigned char code led_array[8] = {0xFE,oxFD,0xFB,0xF7,oxEF,0xDF,0xBF,0x7F}; and in code bank 1 as: extern const unsigned char code led_array[8]; For this usage, there is no problem with compilation. but, we are getting wrong results in runtime. What is the error in this declaration? How to share common code arrays in code banking? Thanks in advance |
Topic | Author | Date |
Multiple public definitions in code banking | 01/01/70 00:00 | |
single const byte in code | 01/01/70 00:00 | |
The meaning of 'const' in ANSI 'C' | 01/01/70 00:00 | |
Yes | 01/01/70 00:00 | |
Keil C51 isn't a C++ compiler | 01/01/70 00:00 | |
Coding Standard Rules - Netrino | 01/01/70 00:00 | |
Rule #2 is a bit broken or at least incompletely formulated | 01/01/70 00:00 | |
issue with #define usage | 01/01/70 00:00 | |
extern const code declaration | 01/01/70 00:00 | |
Insufficient detail | 01/01/70 00:00 | |
Conceptually wrong | 01/01/70 00:00 | |
Thanks, it's working ! | 01/01/70 00:00 | |
Why? | 01/01/70 00:00 | |
correction | 01/01/70 00:00 | |
Fundamental 'C' programming error! | 01/01/70 00:00 |