Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Re: WinAVR / GCC question re Stack

2009-03-25 by David VanHorn

> You're passing to pgm_read_byte_near() character values taken from data memory at the address of BootString in program memory.  I would expect some kind of warning from the compiler about the implicit cast from the char value to the pointer expected as the argument.  Do you have all the warnings turned on?

Well.. I thought so..  :)

Casting is something that I'm not up on yet.


> You need to pass to pgm_read_byte_near() the address of the character you want to read, thus:
> LCD_Data_A = pgm_read_byte_near( &(BootString[i]) );

Ah.. So the final form, since I was using LCD_Data_A as an
intermediate to see what was being passed, is:

for (i=0; 16 > i; i++)	{
  lcd_putc(pgm_read_byte_near(&(BootString[i])));
}

So since this is the address of the char, what was I passing it without the &?

> Graham.
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>



-- 
There is no computer problem which cannot be solved by proper
application of a sufficiently large hammer.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.