mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
Export pgmspace symbols to C (#3955)
This commit is contained in:
parent
cc9e799fc1
commit
4a0cdca28c
@ -24,6 +24,8 @@
|
||||
#include <stdarg.h>
|
||||
#include "pgmspace.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
size_t strnlen_P(PGM_P s, size_t size) {
|
||||
const char* cp;
|
||||
for (cp = s; size != 0 && pgm_read_byte(cp) != '\0'; cp++, size--);
|
||||
@ -286,3 +288,5 @@ int vsnprintf_P(char* str, size_t strSize, PGM_P formatP, va_list ap) {
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
@ -4,16 +4,14 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __ets__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __ets__
|
||||
|
||||
#include "ets_sys.h"
|
||||
#include "osapi.h"
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define PROGMEM ICACHE_RODATA_ATTR
|
||||
#define PGM_P const char *
|
||||
@ -136,4 +134,8 @@ static inline uint16_t pgm_read_word_inlined(const void* addr) {
|
||||
#define pgm_read_float_far(addr) pgm_read_float(addr)
|
||||
#define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //__PGMSPACE_H_
|
||||
|
Loading…
x
Reference in New Issue
Block a user