progmem.h 596 B

12345678910111213141516
  1. #pragma once
  2. #if defined(__AVR__)
  3. # include <avr/pgmspace.h>
  4. #else
  5. # define PROGMEM
  6. # define PGM_P const char*
  7. # define memcpy_P(dest, src, n) memcpy(dest, src, n)
  8. # define pgm_read_byte(address_short) *((uint8_t*)(address_short))
  9. # define pgm_read_word(address_short) *((uint16_t*)(address_short))
  10. # define pgm_read_dword(address_short) *((uint32_t*)(address_short))
  11. # define pgm_read_ptr(address_short) *((void**)(address_short))
  12. # define strcmp_P(s1, s2) strcmp(s1, s2)
  13. # define strcpy_P(dest, src) strcpy(dest, src)
  14. # define strlen_P(src) strlen(src)
  15. #endif