Skip to content

Commit d2b4e4c

Browse files
Pull in latest PSTR changes and fix GCC10.1 build
Somehow the prior GCC build's -mforce32 patch wasn't applying correctly, but I was still able to get a binary. Fixed. Also pulled in latest PSTR changes in progmem.h
1 parent 8ca6e78 commit d2b4e4c

16 files changed

+103
-89
lines changed

package/package_esp8266com_index.template.json

Lines changed: 85 additions & 85 deletions
Large diffs are not rendered by default.

tools/sdk/lib/libbearssl.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libgcc.a

2.13 KB
Binary file not shown.

tools/sdk/lib/libhal.a

0 Bytes
Binary file not shown.

tools/sdk/lib/liblwip2-1460-feat.a

-4 Bytes
Binary file not shown.

tools/sdk/lib/liblwip2-1460.a

0 Bytes
Binary file not shown.

tools/sdk/lib/liblwip2-536-feat.a

-4 Bytes
Binary file not shown.

tools/sdk/lib/liblwip2-536.a

0 Bytes
Binary file not shown.

tools/sdk/lib/liblwip6-1460-feat.a

-4 Bytes
Binary file not shown.

tools/sdk/lib/liblwip6-536-feat.a

-4 Bytes
Binary file not shown.

tools/sdk/lib/libstdc++-exc.a

844 Bytes
Binary file not shown.

tools/sdk/lib/libstdc++.a

832 Bytes
Binary file not shown.

tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,26 @@ extern "C" {
3131
#define PGM_VOID_P const void *
3232
#endif
3333

34-
// PSTR() macro modified to start on a 32-bit boundary. This adds on average
35-
// 1.5 bytes/string, but in return memcpy_P and strcpy_P will work 4~8x faster
36-
#ifndef PSTR
34+
#ifndef PSTR_ALIGN
35+
// PSTR() macro starts by default on a 32-bit boundary. This adds on average
36+
// 1.5 bytes/string, but in return memcpy_P and strcpy_P will work 4~8x faster
37+
// Allow users to override the alignment with PSTR_ALIGN
38+
#define PSTR_ALIGN 4
39+
#endif
40+
#ifndef PSTRN
41+
// Multi-alignment variant of PSTR, n controls the alignment and should typically be 1 or 4
3742
// Adapted from AVR-specific code at https://forum.arduino.cc/index.php?topic=194603.0
3843
// Uses C attribute section instead of ASM block to allow for C language string concatenation ("x" "y" === "xy")
39-
#define PSTR(s) (__extension__({static const char __pstr__[] __attribute__((__aligned__(4))) __attribute__((section( "\".irom0.pstr." __FILE__ "." __STRINGIZE(__LINE__) "." __STRINGIZE(__COUNTER__) "\", \"aSM\", @progbits, 1 #"))) = (s); &__pstr__[0];}))
44+
#define PSTRN(s,n) (__extension__({static const char __pstr__[] __attribute__((__aligned__(n))) __attribute__((section( "\".irom0.pstr." __FILE__ "." __STRINGIZE(__LINE__) "." __STRINGIZE(__COUNTER__) "\", \"aSM\", @progbits, 1 #"))) = (s); &__pstr__[0];}))
45+
#endif
46+
#ifndef PSTR
47+
// PSTR() uses the default alignment defined by PSTR_ALIGN
48+
#define PSTR(s) PSTRN(s,PSTR_ALIGN)
49+
#endif
50+
#ifndef PSTR4
51+
// PSTR4() enforces 4-bytes alignment whatever the value of PSTR_ALIGN
52+
// as required by functions like ets_strlen() or ets_memcpy()
53+
#define PSTR4(s) PSTRN(s,4)
4054
#endif
4155

4256
// Flash memory must be read using 32 bit aligned addresses else a processor
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)