From fb8de6ad566f41a9cbabeadc049d67d59ea3e171 Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Tue, 7 Jan 2020 00:20:18 +0200 Subject: [PATCH] Enable AVR build test --- .github/workflows/tests.yml | 15 +++++++++++- platforms/arduino/platformio.ini | 42 ++++++++++++++++++++++++++++---- source/m3_config_platforms.h | 33 +++++++++++++++---------- 3 files changed, 71 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fd7dff5..55e3c0d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -173,7 +173,7 @@ jobs: build-platformio: runs-on: ubuntu-latest - timeout-minutes: 5 + timeout-minutes: 10 steps: - uses: actions/checkout@v1 @@ -189,6 +189,11 @@ jobs: run: | cd platforms/arduino pio run -e mkr1000 + - name: Build Arduino Mega 1280 + run: | + cd platforms/arduino + pio run -e mega1280 + ! nm .pio/build/mega1280/firmware.elf | grep printf - name: Build ESP8266 run: | cd platforms/esp8266 @@ -209,6 +214,14 @@ jobs: run: | cd platforms/arduino pio run -e tinyBLE + - name: Build MXChip AZ3166 + run: | + cd platforms/arduino + pio run -e az3166 + - name: Build Sipeed MAIX + run: | + cd platforms/arduino + pio run -e maix build-esp32-idf: runs-on: ubuntu-latest diff --git a/platforms/arduino/platformio.ini b/platforms/arduino/platformio.ini index 39e9e15..0f8ead6 100644 --- a/platforms/arduino/platformio.ini +++ b/platforms/arduino/platformio.ini @@ -12,15 +12,16 @@ default_envs = mkr1000 due + mega1280 tinyBLE blenano blenano2 teensy31 bluepill-mapple - #bluepill TODO: region `FLASH' overflowed by 4484 bytes + bluepill az3166 - #maix TODO: undefined reference to `clock_gettime' - #titiva TODO: undefined reference to `_exit' and no LED_BUILTIN + maix + #titiva TODO: undefined reference to `_exit' [env:mkr1000] platform = atmelsam @@ -43,6 +44,36 @@ src_build_flags = -O3 -Wfatal-errors -flto +[env:mega1280] +platform = atmelavr +board = megaatmega1280 +framework = arduino +monitor_speed = 115200 + +src_build_flags = + -Os -Wfatal-errors + -flto + +[env:mega2560] +platform = atmelavr +board = megaatmega2560 +framework = arduino +monitor_speed = 115200 + +src_build_flags = + -Os -Wfatal-errors + -flto + +[env:mega1284] +platform = atmelavr +board = wildfirev3 +framework = arduino +monitor_speed = 115200 + +src_build_flags = + -Os -Wfatal-errors + -flto + [env:tinyBLE] platform = nordicnrf51 board = seeedTinyBLE @@ -95,7 +126,7 @@ upload_protocol = stlink monitor_speed = 115200 src_build_flags = - -Dd_m3FixedHeap=8192 -Dd_m3LogOutput=false + -Dd_m3FixedHeap=8192 -Os -Wfatal-errors -flto @@ -107,7 +138,7 @@ upload_protocol = stlink monitor_speed = 115200 src_build_flags = - -Dd_m3FixedHeap=8192 -Dd_m3LogOutput=false + -Dd_m3FixedHeap=8192 -Os -Wfatal-errors -flto @@ -138,4 +169,5 @@ framework = arduino monitor_speed = 115200 src_build_flags = + -DLED_BUILTIN=13 -O3 -Wfatal-errors diff --git a/source/m3_config_platforms.h b/source/m3_config_platforms.h index 633e493..bd08d42 100644 --- a/source/m3_config_platforms.h +++ b/source/m3_config_platforms.h @@ -185,33 +185,40 @@ static inline uint64_t strtoull ( const char* str, char ** endptr, int base ) { # elif defined (FOMU) # define vectorcall __attribute__((section(".ramtext"))) # elif defined(HIFIVE1) -# include # define vectorcall # else # define vectorcall # endif -# if defined(PARTICLE) +// Device-specific defaults +# if defined(ESP8266) # define d_m3LogOutput false -# define d_m3MaxFunctionStackHeight 256 -# elif defined(ESP8266) -# define d_m3LogOutput false -# define d_m3MaxFunctionStackHeight 256 +# define d_m3MaxFunctionStackHeight 64 # define d_m3FixedHeap (8*1024) # elif defined(WM_W600) -# define d_m3MaxFunctionStackHeight 256 +# define d_m3MaxFunctionStackHeight 64 # elif defined(BLUE_PILL) # define d_m3LogOutput false -# define d_m3MaxFunctionStackHeight 256 +# define d_m3MaxFunctionStackHeight 64 # define d_m3FixedHeap (8*1024) # elif defined(FOMU) # define d_m3LogOutput false -# define d_m3MaxFunctionStackHeight 256 -# define d_m3FixedHeap (8*1024) -# elif defined(__AVR__) -# define d_m3LogOutput false # define d_m3MaxFunctionStackHeight 64 +# define d_m3FixedHeap (8*1024) +#endif + +// Platform-specific defaults +# if defined(ARDUINO) || defined(PARTICLE) || defined(__MBED__) +# ifndef d_m3LogOutput +# define d_m3LogOutput false +# endif +# ifndef d_m3VerboseLogs +# define d_m3VerboseLogs false +# endif +# ifndef d_m3MaxFunctionStackHeight +# define d_m3MaxFunctionStackHeight 64 +# endif # endif -#endif +#endif // m3_config_platforms_h