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