You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
642 B

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