13 #include <sys/features.h> 14 #include "../c_types.h" 15 #include "../esp_attr.h" 29 #define PROGMEM STORE_ATTR ICACHE_RODATA_ATTR 37 #define PROGMEM_PSTR \ 39 __attribute__((section("\".irom0.pstr." __FILE__ \ 40 "." MACROQUOTE(__LINE__) "." MACROQUOTE(__COUNTER__) "\", \"aSM\", @progbits, 1 #"))) 50 static const char __pstr__[] PROGMEM_PSTR = str; \ 58 #include_next <sys/pgmspace.h> 75 #define PGM_P const char* 104 #define pgm_read_with_offset(addr, res) \ 105 __asm__("extui %0, %1, 0, 2\n" \ 107 "l32i.n %1, %1, 0x0\n" \ 110 : "=r"(res), "=r"(addr) \ 135 #define pgm_read_byte(addr) pgm_read_byte_inlined(addr) 136 #define pgm_read_word(addr) pgm_read_word_inlined(addr) 139 #define pgm_read_dword(addr) (*(const unsigned long*)(addr)) 140 #define pgm_read_float(addr) (*(const float*)(addr)) 149 void*
memcpy_P(
void* dest,
const void* src_P,
size_t length);
150 int memcmp_P(
const void* a1,
const void* b1,
size_t len);
152 char*
strcpy_P(
char* dest,
const char* src_P);
153 char*
strncpy_P(
char* dest,
const char* src_P,
size_t size);
154 int strcmp_P(
const char* str1,
const char* str2_P);
155 int strncmp_P(
const char* str1,
const char* str2_P,
const size_t size);
157 char*
strcat_P(
char* dest,
const char* src_P);
158 char*
strstr_P(
char* haystack,
const char* needle_P);
160 #define sprintf_P(s, f_P, ...) \ 162 int len_P = strlen_P(f_P); \ 164 char* __localF = (char*)malloc(len_P + 1); \ 166 strcpy_P(__localF, f_P); \ 167 __localF[len_P] = '\0'; \ 169 __result = m_snprintf(s, len_P, __localF, ##__VA_ARGS__); \ 180 #define pgm_read_byte_near(addr) pgm_read_byte(addr) 181 #define pgm_read_word_near(addr) pgm_read_word(addr) 182 #define pgm_read_dword_near(addr) pgm_read_dword(addr) 183 #define pgm_read_float_near(addr) pgm_read_float(addr) 184 #define pgm_read_byte_far(addr) pgm_read_byte(addr) 185 #define pgm_read_word_far(addr) pgm_read_word(addr) 186 #define pgm_read_dword_far(addr) pgm_read_dword(addr) 187 #define pgm_read_float_far(addr) pgm_read_float(addr) int memcmp_P(const void *a1, const void *b1, size_t len)
char * strcpy_P(char *dest, const char *src_P)
size_t strlen_P(const char *src_P)
int32_t prog_int32_t
Definition: Arch/Esp8266/Components/libc/include/sys/pgmspace.h:94
uint16_t prog_uint16_t
Definition: Arch/Esp8266/Components/libc/include/sys/pgmspace.h:93
int8_t prog_int8_t
Definition: Arch/Esp8266/Components/libc/include/sys/pgmspace.h:90
char * strstr_P(char *haystack, const char *needle_P)
char prog_char
Definition: Arch/Esp8266/Components/libc/include/sys/pgmspace.h:88
char * strcat_P(char *dest, const char *src_P)
#define pgm_read_with_offset(addr, res)
Definition: Arch/Esp8266/Components/libc/include/sys/pgmspace.h:104
uint8_t prog_uint8_t
Definition: Arch/Esp8266/Components/libc/include/sys/pgmspace.h:91
int16_t prog_int16_t
Definition: Arch/Esp8266/Components/libc/include/sys/pgmspace.h:92
void * memcpy_P(void *dest, const void *src_P, size_t length)
unsigned char prog_uchar
Definition: Arch/Esp8266/Components/libc/include/sys/pgmspace.h:89
static uint16_t pgm_read_word_inlined(const void *addr)
Definition: Arch/Esp8266/Components/libc/include/sys/pgmspace.h:122
char * strncpy_P(char *dest, const char *src_P, size_t size)
int strncmp_P(const char *str1, const char *str2_P, const size_t size)
uint32_t prog_uint32_t
Definition: Arch/Esp8266/Components/libc/include/sys/pgmspace.h:95
int strcasecmp_P(const char *str1, const char *str2_P)
int strcmp_P(const char *str1, const char *str2_P)
static uint8_t pgm_read_byte_inlined(const void *addr)
Definition: Arch/Esp8266/Components/libc/include/sys/pgmspace.h:114
void prog_void
Definition: Arch/Esp8266/Components/libc/include/sys/pgmspace.h:87