Discussion:
[avr-libc-dev] missing pgm_read_ptr
Maurin Donneaud
2015-07-05 18:40:59 UTC
Permalink
Hello,

I have linux avr-libc 1:1.8.0-4.1 installed
I'm wondering why pgmspace.h do not have the pgm_read_byte macro ?

Maurin
Joerg Wunsch
2015-07-07 06:44:47 UTC
Permalink
Post by Maurin Donneaud
I have linux avr-libc 1:1.8.0-4.1 installed
I'm wondering why pgmspace.h do not have the pgm_read_byte macro ?
$ fgrep pgm_read_byte ~/src/avr-libc/include/avr/pgmspace.h
pgm_read_byte_near() or pgm_read_word_near() instead of
pgm_read_byte_far() or pgm_read_word_far() since it is more efficient that
\def pgm_read_byte_near(address_short)
#define pgm_read_byte_near(address_short) __LPM((uint16_t)(address_short))
\def pgm_read_byte_far(address_long)
#define pgm_read_byte_far(address_long) __ELPM((uint32_t)(address_long))
\def pgm_read_byte(address_short)
#define pgm_read_byte(address_short) pgm_read_byte_near(address_short)

So well, I think it's just there.
--
cheers, Joerg .-.-. --... ...-- -.. . DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)
Maurin Donneaud
2015-07-07 08:28:53 UTC
Permalink
Oops sorry sorry,

it is not pgm_read_byte but pgm_read_ptr who is missing.

Best regards,

Maurin
Post by Joerg Wunsch
Post by Maurin Donneaud
I have linux avr-libc 1:1.8.0-4.1 installed
I'm wondering why pgmspace.h do not have the pgm_read_byte macro ?
$ fgrep pgm_read_byte ~/src/avr-libc/include/avr/pgmspace.h
pgm_read_byte_near() or pgm_read_word_near() instead of
pgm_read_byte_far() or pgm_read_word_far() since it is more efficient that
\def pgm_read_byte_near(address_short)
#define pgm_read_byte_near(address_short) __LPM((uint16_t)(address_short))
\def pgm_read_byte_far(address_long)
#define pgm_read_byte_far(address_long) __ELPM((uint32_t)(address_long))
\def pgm_read_byte(address_short)
#define pgm_read_byte(address_short) pgm_read_byte_near(address_short)
So well, I think it's just there.
Loading...