Of course everything must be re-compiled, this is not the problem. The problem is that the module with
is used in other programs. If i change this module then all other programs which make use of this module also have to change. Alternatively they must branch which is also not desireable. I don't want to get into a discsussion about SW reuse but I do not have the freedom to change/edit anything I like.
value = index_table[i];
Your response did make me think about what new functionality I wanted and if it could not be done inside a table.
Below is a simple example:
However now I'd like to index into another table from this table based on the value of [i]. Something like:
static const u8 index_table =
static const u8* index_table =
static const u8 new_index_table =
Hope this clarifies what I would like to do.
value = index_table[i]; //when i=2, value will equal 0x06
Thanks for the help.