From 2b73ea79cfb9f138b42f371693bcdc63e853eb33 Mon Sep 17 00:00:00 2001 From: giulcioffi Date: Tue, 3 Nov 2020 18:28:32 +0100 Subject: [PATCH 1/6] Compile modified pgmspace.h before avr-libc one --- bootloaders/boot.c | 1 + cores/arduino/Arduino.h | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bootloaders/boot.c b/bootloaders/boot.c index 1a8dcb1e..8f2410a5 100644 --- a/bootloaders/boot.c +++ b/bootloaders/boot.c @@ -36,6 +36,7 @@ */ #define F_CPU_RESET (16E6/6) +#include "api/deprecated-avr-comp/avr/pgmspace.h" #include #include #include diff --git a/cores/arduino/Arduino.h b/cores/arduino/Arduino.h index 83017230..227989eb 100644 --- a/cores/arduino/Arduino.h +++ b/cores/arduino/Arduino.h @@ -20,15 +20,19 @@ #ifndef Arduino_h #define Arduino_h -#include "api/ArduinoAPI.h" +#ifdef __PGMSPACE_H_ +#undef __PGMSPACE_H_ +#endif -#include +#include "api/deprecated-avr-comp/avr/pgmspace.h" #include #include - + +#include "api/ArduinoAPI.h" +/* #undef F #define F(str) (str) - +*/ #ifdef __cplusplus extern "C"{ #endif From cbb346636e275243a5dbb349b546f44481bc160a Mon Sep 17 00:00:00 2001 From: giulcioffi Date: Tue, 3 Nov 2020 18:41:03 +0100 Subject: [PATCH 2/6] Use my FmacroIssue branch of ArduinoCore-API --- .github/workflows/compile-examples.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 313c270e..4a9ddb90 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -87,7 +87,8 @@ jobs: - name: Checkout ArduinoCore-API uses: actions/checkout@v2 with: - repository: arduino/ArduinoCore-API + repository: giulcioffi/ArduinoCore-API + ref: FmacroIssue path: extras/ArduinoCore-API - name: Install ArduinoCore-API From 19fa1b7fd2e40e263ceac3a842521780cbc54ea9 Mon Sep 17 00:00:00 2001 From: giulcioffi Date: Wed, 4 Nov 2020 10:41:10 +0100 Subject: [PATCH 3/6] Cast F() to __FlashStringHelper* --- cores/arduino/Arduino.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cores/arduino/Arduino.h b/cores/arduino/Arduino.h index 227989eb..ba4886a9 100644 --- a/cores/arduino/Arduino.h +++ b/cores/arduino/Arduino.h @@ -20,19 +20,15 @@ #ifndef Arduino_h #define Arduino_h -#ifdef __PGMSPACE_H_ -#undef __PGMSPACE_H_ -#endif - #include "api/deprecated-avr-comp/avr/pgmspace.h" #include #include #include "api/ArduinoAPI.h" -/* + #undef F -#define F(str) (str) -*/ +#define F(str) (const __FlashStringHelper*)(str) + #ifdef __cplusplus extern "C"{ #endif From d5799abc578a367f41aa4b0456d1638bf4e3b05d Mon Sep 17 00:00:00 2001 From: giulcioffi Date: Wed, 4 Nov 2020 13:04:04 +0100 Subject: [PATCH 4/6] pgmspace.h from ArduinoCore-API is already included with #include api/ArduinoAPI.h --- bootloaders/boot.c | 1 - cores/arduino/Arduino.h | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/bootloaders/boot.c b/bootloaders/boot.c index 8f2410a5..1a8dcb1e 100644 --- a/bootloaders/boot.c +++ b/bootloaders/boot.c @@ -36,7 +36,6 @@ */ #define F_CPU_RESET (16E6/6) -#include "api/deprecated-avr-comp/avr/pgmspace.h" #include #include #include diff --git a/cores/arduino/Arduino.h b/cores/arduino/Arduino.h index ba4886a9..ed21105d 100644 --- a/cores/arduino/Arduino.h +++ b/cores/arduino/Arduino.h @@ -20,14 +20,10 @@ #ifndef Arduino_h #define Arduino_h -#include "api/deprecated-avr-comp/avr/pgmspace.h" -#include -#include - #include "api/ArduinoAPI.h" -#undef F -#define F(str) (const __FlashStringHelper*)(str) +#include +#include #ifdef __cplusplus extern "C"{ From 6cf1bb6396445bbb4e54357853cd942de16b1760 Mon Sep 17 00:00:00 2001 From: giulcioffi Date: Wed, 4 Nov 2020 15:54:52 +0100 Subject: [PATCH 5/6] Update workflow with latest versions of the actions --- .github/workflows/compile-examples.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 4a9ddb90..c628735d 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -108,8 +108,9 @@ jobs: rm -r "$GITHUB_WORKSPACE/extras/examples/10.StarterKit_BasicKit/p11_CrystalBall" # CapacitiveSensor library does not support megaAVR core yet rm -r "$GITHUB_WORKSPACE/extras/examples/10.StarterKit_BasicKit/p13_TouchSensorLamp" + - name: Compile examples - uses: arduino/actions/libraries/compile-examples@master + uses: arduino/compile-sketches@main with: fqbn: ${{ matrix.board.fqbn }} libraries: | @@ -147,7 +148,7 @@ jobs: verbose: 'true' - name: Save memory usage change report as artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v2 with: name: size-deltas-reports path: size-deltas-reports \ No newline at end of file From 59b30b57c27a0e1b945dcbc71b4175a31b3bb69f Mon Sep 17 00:00:00 2001 From: giulcioffi Date: Wed, 4 Nov 2020 16:14:53 +0100 Subject: [PATCH 6/6] Allow failures in order to generate the artifact --- .github/workflows/compile-examples.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index c628735d..57c98f42 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -110,7 +110,7 @@ jobs: rm -r "$GITHUB_WORKSPACE/extras/examples/10.StarterKit_BasicKit/p13_TouchSensorLamp" - name: Compile examples - uses: arduino/compile-sketches@main + uses: giulcioffi/compile-sketches@CheckAgainstDatabase with: fqbn: ${{ matrix.board.fqbn }} libraries: | @@ -145,10 +145,11 @@ jobs: ${{ env.UNIVERSAL_SKETCH_PATHS }} ${{ matrix.additional-sketch-paths }} enable-deltas-report: 'true' + allow-failures: 'true' verbose: 'true' - name: Save memory usage change report as artifact uses: actions/upload-artifact@v2 with: - name: size-deltas-reports - path: size-deltas-reports \ No newline at end of file + name: sketches-reports + path: sketches-reports \ No newline at end of file