Illegal pointer conversion error for AVRstudio to Mikroc For

General discussion on mikroC PRO for AVR.
Post Reply
Author
Message
soheil_sab
Posts: 12
Joined: 23 Oct 2015 11:37
Location: iran
Contact:

Illegal pointer conversion error for AVRstudio to Mikroc For

#1 Post by soheil_sab » 21 Dec 2015 19:38

i am going to change an AVR Studio V4 code converting to Mikroc For AVR, SO i got this error for converting this part of codes:

Code: Select all

 Illegal pointer conversion 

Code: Select all

#define PGM_P                                  	char flash *
		#define PROGMEM                                	flash
		#define flash																		const
		#define PSTR(x)                                	x

		#define EEMEM                                 	eeprom
		
		#define pgm_read_byte(x)                  	   	(*((uint8  flash *)(x)))
		#define pgm_read_word(x)                   	    (*((uint16 flash *)(x)))

// ************************************************ ******************************
// Display the string of characters on the LCD-controller in the current location of the program memory.
// If the string is out of the screen in the current line, the balance is transferred to the next line.
// Message: a pointer to a string in program memory. 0x00 - a sign of the end of the line.
void nlcd_PrintF(unsigned char * message)
{
         unsigned char const data_1;
//        while (data_=pgm_read_byte(message), data_)
          data_1=pgm_read_byte(message);
        while (data_1)
        {
            nlcd_Putc(data_1);
                message++;
    }
}

User avatar
Aleksandar.Mitrovic
mikroElektronika team
Posts: 1697
Joined: 11 Mar 2015 12:48

Re: Illegal pointer conversion error for AVRstudio to Mikroc

#2 Post by Aleksandar.Mitrovic » 22 Dec 2015 10:55

HI,

I didn't manage to compile this part of code.
Since this is just a part of your code.

In which line do you have error?

Did you try to use some examples from our compiler and try to translate your code following that examples?

Best regards,
Aleksandar

Post Reply

Return to “mikroC PRO for AVR General”