Pārlūkot izejas kodu

Emulate AVR pgm_read_ptr() on 32 bit Teensy

main
PaulStoffregen pirms 7 gadiem
vecāks
revīzija
d63777ac8a
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. +6
    -0
      teensy3/avr/pgmspace.h

+ 6
- 0
teensy3/avr/pgmspace.h Parādīt failu

@@ -110,6 +110,10 @@ typedef uint64_t prog_uint64_t;
typeof(addr) _addr = (addr); \
*(const float *)(_addr); \
})
#define pgm_read_ptr(addr) ({ \
typeof(addr) _addr = (addr); \
*(void * const *)(_addr); \
})
#endif


@@ -117,9 +121,11 @@ typedef uint64_t prog_uint64_t;
#define pgm_read_word_near(addr) pgm_read_word(addr)
#define pgm_read_dword_near(addr) pgm_read_dword(addr)
#define pgm_read_float_near(addr) pgm_read_float(addr)
#define pgm_read_ptr_near(addr) pgm_read_float(addr)
#define pgm_read_byte_far(addr) pgm_read_byte(addr)
#define pgm_read_word_far(addr) pgm_read_word(addr)
#define pgm_read_dword_far(addr) pgm_read_dword(addr)
#define pgm_read_float_far(addr) pgm_read_float(addr)
#define pgm_read_ptr_far(addr) pgm_read_float(addr)

#endif

Notiek ielāde…
Atcelt
Saglabāt