I decided to activate the free trial of the Hi-Tech C compiler and tried to compile the RGB LED LUT program using it. The BoostC compiler has no problems with the code but the HTC compiler didn't like the program and is returning the following errors:
Warning [374] C:\...\RGB_lut_MAIN.C; 105.5 missing basic type; int assumed
Error [314] C:\...\RGB_lut_MAIN.C; 105.5 ";" expected
Warning [374] C:\...\RGB_lut_MAIN.C; 112.5 missing basic type; int assumed
Error [314] C:\...\RGB_lut_MAIN.C; 112.5 ";" expected
Warning [374] C:\...\RGB_lut_MAIN.C; 119.5 missing basic type; int assumed
Error [314] C:\...\RGB_lut_MAIN.C; 119.5 ";" expected
Error [192] C:\...\RGB_lut_MAIN.C; 479.15 undefined identifier "RED"
Error [981] C:\...\RGB_lut_MAIN.C; 479.33 pointer required
Error [981] C:\...\RGB_lut_MAIN.C; 479.33 pointer required
Error [192] C:\...\RGB_lut_MAIN.C; 480.17 undefined identifier "GREEN"
Error [981] C:\...\RGB_lut_MAIN.C; 480.37 pointer required
Error [981] C:\...\RGB_lut_MAIN.C; 480.37 pointer required
Error [192] C:\...\RGB_lut_MAIN.C; 481.16 undefined identifier "BLUE"
Error [981] C:\...\RGB_lut_MAIN.C; 481.35 pointer required
Error [981] C:\...\RGB_lut_MAIN.C; 481.35 pointer required
Ive tried several different ways to declare the " rom char* RED |BLUE|GREEN {1,2,3,......}; " array and get a different error every time. I'm not sure what must be done differently to make the LUT work for both compilers.
edit--------------------link to htc website on this topic
http://www.htsoft.com/support/faqs.php#faq22
edit #2---------------------------------------------
note: the original code that won't work with HTC used the format: "rom char * red = {1,2,3....}; "
I was able to make this program work by using any one of the following 3 formats:
1. char* red[]= {1,2,3....}; // All of these examples worked the same from what I could tell
2. unsigned char* red[] = {1,2,3....};
3. volatile unsigned char* red[] = {1,2,3....};
char* red[] = {red, array, here,....};
unsigned char* green[] = {green, array, here,....};
volatile unsigned char* blue[] ={blue, array, here,....};
I'm still getting a massive list of warnings saying "illegal conversion of integer to pointer", especially if I compile the code in MPlab instead of FC. I sort of understand the problem but don't either. All I know is that the program is working as usual and compileable with HTC.