avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Pgmspace.h Use


From: David Kelly
Subject: Re: [avr-gcc-list] Pgmspace.h Use
Date: Wed, 10 Aug 2005 20:18:25 -0500

Ron wrote:

As Brano suggested, a macro is about as close as you can get. Not
_quite_ what you want, but close:

#define array(i)    pgm_read_byte(&Array[i])
const prog_char Array[7] = {0x10,0x20,0x30,0x40,0x50,0x60,0x70};

  y = array(4);

This is what I did:

unsigned char
ntohex(unsigned char n)
{
    return( pgm_read_byte(PSTR("0123456789ABCDEF")+(n&0xf)) );
}

--
David Kelly N4HHE, address@hidden
========================================================================
Whom computers would destroy, they must first drive mad.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]