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

Warning: c259: pointer: different mspace

I cannot get rid of this warning. All the documents I have read do not help at all. ( these include Keil forum search, Keil help function, the 8051 "bible", google e.t.c).

void halLcdWriteLine(uint8 line, const char* text)
{
   BYTE sendBuffer[50];
   UINT8 i, j;
   char c;

    if (text == NULL)
        return;

   i = 0;
   sendBuffer[i++] = LCD_ADDR;
   sendBuffer[i++] = REG_SEL_0;
   sendBuffer[i++] = ((line == HAL_LCD_LINE_1) ? LINE1_ADDR : LINE2_ADDR);
   smbSend(sendBuffer, i);

   i = j = 0;
   sendBuffer[i++] = LCD_ADDR;
   sendBuffer[i++] = REG_SEL_1;

   while( ( (c = text[j]) != '\0' ) && j < HAL_LCD_LINE_SIZE ){
      sendBuffer[i++] = lcdConvertChar(c);
      j++;
   }
   for ( ;j < HAL_LCD_LINE_SIZE; j++){
      sendBuffer[i++] = lcdConvertChar(' ');
   }
   smbSend(sendBuffer, i);
}

This function writes a line of text on an LCD (communicates using I2C). A typical call to this function looks like this:

  halLcdWriteLine(1, "Hello world");

Please help if you can.

Parents
  • I added the memory space specifier in the source file (it wasn't there before) and that is how i got less warnings. The declaration (in the header file) had a memory space identifier but the function definition did not.

    To eliminate the warnings, I decided to use generic pointers throughout the program and it worked. I'll try tailoring the system for efficiency (use memory specific pointers) later once I know that at least everything works. Thanks guys, couldn't have done it without you.

Reply
  • I added the memory space specifier in the source file (it wasn't there before) and that is how i got less warnings. The declaration (in the header file) had a memory space identifier but the function definition did not.

    To eliminate the warnings, I decided to use generic pointers throughout the program and it worked. I'll try tailoring the system for efficiency (use memory specific pointers) later once I know that at least everything works. Thanks guys, couldn't have done it without you.

Children
No data