Code: Select all
//HEADER FILE
#define _MSG_1 "Message 1"
#define _MSG_2 "Message 2"
#define _MSG_3 "Message 3"
#define messages char*[] = {_MSG_1,_MSG_2_MSG_3}
Code: Select all
//MAIN FILE
#include "messages.h"
void WriteMessage(char *msg){
while(*msg) TXREG = *msg++;
}
WriteMessage(messages[1]);
My test program uses routines similar to above for outputting text and does work it is only the
#define messages char*[] = {_MSG_1,_MSG_2_MSG_3}
from the header file which i seem to have a problem with (nothing is sent).
If i use
char *messages[] = {_MSG_1,_MSG_2_MSG_3};
within the main file i have no problems.
Any help would be most appriciated.
thank you
day