Clean up envs / variants

This commit is contained in:
Scott Lahteine 2020-06-11 20:17:22 -05:00
parent 85e48bbb0d
commit ea20c77df9
4 changed files with 163 additions and 118 deletions

View file

@ -7,5 +7,3 @@ for i, flag in enumerate(env["LINKFLAGS"]):
env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script
elif flag == "-T": elif flag == "-T":
env["LINKFLAGS"][i + 1] = custom_ld_script env["LINKFLAGS"][i + 1] = custom_ld_script

View file

@ -1,20 +1,17 @@
#ifndef _VARIANT_ARDUINO_STM32_ #pragma once
#define _VARIANT_ARDUINO_STM32_
#define digitalPinToPort(P) ( PIN_MAP[P].gpio_device ) #define digitalPinToPort(P) ( PIN_MAP[P].gpio_device )
#define digitalPinToBitMask(P) ( BIT(PIN_MAP[P].gpio_bit) ) #define digitalPinToBitMask(P) ( BIT(PIN_MAP[P].gpio_bit) )
#define portOutputRegister(port) ( &(port->regs->ODR) ) #define portOutputRegister(port) ( &(port->regs->ODR) )
#define portInputRegister(port) ( &(port->regs->IDR) ) #define portInputRegister(port) ( &(port->regs->IDR) )
#define portSetRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BSRR) ) #define portSetRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BSRR) )
#define portClearRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BRR) ) #define portClearRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BRR) )
#define portConfigRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->CRL) ) #define portConfigRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->CRL) )
static const uint8_t SS = BOARD_SPI1_NSS_PIN; static const uint8_t SS = BOARD_SPI1_NSS_PIN;
static const uint8_t SS1 = BOARD_SPI2_NSS_PIN; static const uint8_t SS1 = BOARD_SPI2_NSS_PIN;
static const uint8_t MOSI = BOARD_SPI1_MOSI_PIN; static const uint8_t MOSI = BOARD_SPI1_MOSI_PIN;
static const uint8_t MISO = BOARD_SPI1_MISO_PIN; static const uint8_t MISO = BOARD_SPI1_MISO_PIN;
static const uint8_t SCK = BOARD_SPI1_SCK_PIN; static const uint8_t SCK = BOARD_SPI1_SCK_PIN;
#endif /* _VARIANT_ARDUINO_STM32_ */

View file

@ -8,7 +8,7 @@
# #
# Automatic targets - enable auto-uploading # Automatic targets - enable auto-uploading
# targets = upload #targets = upload
# #
# By default platformio build will abort after 5 errors. # By default platformio build will abort after 5 errors.
@ -20,6 +20,9 @@ src_dir = Marlin
boards_dir = buildroot/share/PlatformIO/boards boards_dir = buildroot/share/PlatformIO/boards
default_envs = mega2560 default_envs = mega2560
#
# The 'common' values are used for most Marlin builds
#
[common] [common]
default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared> default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
@ -35,44 +38,9 @@ lib_deps =
SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip
SlowSoftI2CMaster=https://github.com/mikeshub/SlowSoftI2CMaster/archive/master.zip SlowSoftI2CMaster=https://github.com/mikeshub/SlowSoftI2CMaster/archive/master.zip
# Common traits for environments using HAL/STM32 #
[base_stm32] # Default values apply to all 'env:' prefixed environments
platform = ststm32@<6.2.0 #
platform_packages = framework-arduinoststm32@>=4.10700,<4.10800
lib_deps = ${common.lib_deps}
lib_ignore = SoftwareSerial
build_flags = ${common.build_flags}
-IMarlin/src/HAL/STM32 -std=gnu++14
-DUSBCON -DUSBD_USE_CDC
build_unflags = -std=gnu++11
src_filter = ${common.default_src_filter} +<src/HAL/STM32>
[common_stm32]
platform = ${base_stm32.platform}
extends = base_stm32
build_flags = ${base_stm32.build_flags} -DUSBD_VID=0x0483
# Common traits for environments using HAL/STM32F1
[common_stm32f1]
platform = ${common_stm32.platform}
build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py
${common.build_flags} -std=gnu++14 -DHAVE_SW_SERIAL
build_unflags = -std=gnu++11
src_filter = ${common.default_src_filter} +<src/HAL/STM32F1>
lib_ignore =
Adafruit NeoPixel
SPI
lib_deps = ${common.lib_deps}
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
[common_avr8]
board_build.f_cpu = 16000000L
lib_deps = ${common.lib_deps}
TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
src_filter = ${common.default_src_filter} +<src/HAL/AVR>
# Globally defined properties
# inherited by all environments
[env] [env]
framework = arduino framework = arduino
build_flags = ${common.build_flags} build_flags = ${common.build_flags}
@ -89,6 +57,21 @@ monitor_speed = 250000
# # # #
################################# #################################
#################################
# #
# AVR Architecture #
# #
#################################
#
# AVR (8-bit) Common Environment values
#
[common_avr8]
board_build.f_cpu = 16000000L
lib_deps = ${common.lib_deps}
TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
src_filter = ${common.default_src_filter} +<src/HAL/AVR>
# #
# ATmega2560 # ATmega2560
# #
@ -206,6 +189,12 @@ lib_ignore = TMCStepper
platform = teensy platform = teensy
extends = env:at90usb1286_cdc extends = env:at90usb1286_cdc
#################################
# #
# DUE Architecture #
# #
#################################
# #
# Due (Atmel SAM3X8E ARM Cortex-M3) # Due (Atmel SAM3X8E ARM Cortex-M3)
# #
@ -252,6 +241,32 @@ platform = ${common_DUE_archim.platform}
extends = common_DUE_archim extends = common_DUE_archim
build_flags = ${common_DUE_archim.build_flags} -funwind-tables -mpoke-function-name build_flags = ${common_DUE_archim.build_flags} -funwind-tables -mpoke-function-name
#################################
# #
# SAMD51 Architecture #
# #
#################################
#
# Adafruit Grand Central M4 (Atmel SAMD51P20A ARM Cortex-M4)
#
[env:SAMD51_grandcentral_m4]
platform = atmelsam
board = adafruit_grandcentral_m4
build_flags = ${common.build_flags} -std=gnu++17 -Wno-register
build_unflags = -std=gnu++11
src_filter = ${common.default_src_filter} +<src/HAL/SAMD51>
lib_deps = ${common.lib_deps}
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
Adafruit_SPIFlash=https://github.com/adafruit/Adafruit_SPIFlash/archive/master.zip
debug_tool = jlink
#################################
# #
# LPC176x Architecture #
# #
#################################
# #
# NXP LPC176x ARM Cortex-M3 # NXP LPC176x ARM Cortex-M3
# #
@ -286,6 +301,49 @@ platform = ${common_LPC.platform}
extends = common_LPC extends = common_LPC
board = nxp_lpc1769 board = nxp_lpc1769
#################################
# #
# STM32 Architecture #
# #
#################################
#
# HAL/STM32 Base Environment values
#
[base_stm32]
platform = ststm32@<6.2.0
platform_packages = framework-arduinoststm32@>=4.10700,<4.10800
lib_deps = ${common.lib_deps}
lib_ignore = SoftwareSerial
build_flags = ${common.build_flags}
-IMarlin/src/HAL/STM32 -std=gnu++14
-DUSBCON -DUSBD_USE_CDC
build_unflags = -std=gnu++11
src_filter = ${common.default_src_filter} +<src/HAL/STM32>
#
# HAL/STM32 Common Environment values
#
[common_stm32]
platform = ${base_stm32.platform}
extends = base_stm32
build_flags = ${base_stm32.build_flags} -DUSBD_VID=0x0483
#
# HAL/STM32F1 Common Environment values
#
[common_stm32f1]
platform = ${common_stm32.platform}
build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py
${common.build_flags} -std=gnu++14 -DHAVE_SW_SERIAL
build_unflags = -std=gnu++11
src_filter = ${common.default_src_filter} +<src/HAL/STM32F1>
lib_ignore =
Adafruit NeoPixel
SPI
lib_deps = ${common.lib_deps}
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
# #
# STM32F103RC # STM32F103RC
# #
@ -312,7 +370,7 @@ build_flags = ${common_stm32f1.build_flags}
-DUSE_USB_COMPOSITE -DUSE_USB_COMPOSITE
-DVECT_TAB_OFFSET=0x2000 -DVECT_TAB_OFFSET=0x2000
-DGENERIC_BOOTLOADER -DGENERIC_BOOTLOADER
extra_scripts = pre:buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP_create_variant.py extra_scripts = pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py
lib_deps = ${common_stm32f1.lib_deps} lib_deps = ${common_stm32f1.lib_deps}
USBComposite for STM32F1@==0.91 USBComposite for STM32F1@==0.91
@ -701,75 +759,6 @@ build_flags = ${common_stm32.build_flags}
extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
lib_ignore = Adafruit NeoPixel, SailfishLCD, SlowSoftI2CMaster, SoftwareSerial lib_ignore = Adafruit NeoPixel, SailfishLCD, SlowSoftI2CMaster, SoftwareSerial
#
# Teensy 3.1 / 3.2 (ARM Cortex-M4)
#
[env:teensy31]
platform = teensy
board = teensy31
lib_deps = ${common.lib_deps}
TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
lib_ignore = Adafruit NeoPixel
src_filter = ${common.default_src_filter} +<src/HAL/TEENSY31_32>
#
# Teensy 3.5 / 3.6 (ARM Cortex-M4)
#
[env:teensy35]
platform = teensy
board = teensy35
lib_deps = ${common.lib_deps}
TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
lib_ignore = Adafruit NeoPixel
src_filter = ${common.default_src_filter} +<src/HAL/TEENSY35_36>
#
# Espressif ESP32
#
[env:esp32]
platform = espressif32@1.11.2
board = esp32dev
build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0
lib_deps = ${common.lib_deps}
AsyncTCP=https://github.com/me-no-dev/AsyncTCP/archive/master.zip
ESPAsyncWebServer=https://github.com/me-no-dev/ESPAsyncWebServer/archive/master.zip
ESP3DLib=https://github.com/luc-github/ESP3DLib.git
arduinoWebSockets=https://github.com/Links2004/arduinoWebSockets.git
ESP32SSDP=https://github.com/luc-github/ESP32SSDP.git
lib_ignore = LiquidCrystal, LiquidTWI2, SailfishLCD, ESPAsyncTCP
src_filter = ${common.default_src_filter} +<src/HAL/ESP32>
upload_speed = 115200
#upload_port = marlinesp.local
#board_build.flash_mode = qio
#
# Native
# No supported Arduino libraries, base Marlin only
#
[env:linux_native]
platform = native
framework =
build_flags = -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread -D__MARLIN_FIRMWARE__ -Wno-expansion-to-defined
src_build_flags = -Wall -IMarlin/src/HAL/LINUX/include
build_unflags = -Wall
lib_ldf_mode = off
lib_deps =
src_filter = ${common.default_src_filter} +<src/HAL/LINUX>
#
# Adafruit Grand Central M4 (Atmel SAMD51P20A ARM Cortex-M4)
#
[env:SAMD51_grandcentral_m4]
platform = atmelsam
board = adafruit_grandcentral_m4
build_flags = ${common.build_flags} -std=gnu++17 -Wno-register
build_unflags = -std=gnu++11
src_filter = ${common.default_src_filter} +<src/HAL/SAMD51>
lib_deps = ${common.lib_deps}
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
Adafruit_SPIFlash=https://github.com/adafruit/Adafruit_SPIFlash/archive/master.zip
debug_tool = jlink
# #
# RUMBA32 # RUMBA32
# #
@ -803,6 +792,67 @@ platform = ${common_rumba32.platform}
extends = common_rumba32 extends = common_rumba32
build_flags = ${common_rumba32.build_flags} -DUSBD_VID=0x8000 build_flags = ${common_rumba32.build_flags} -DUSBD_VID=0x8000
#################################
# #
# Other Architectures #
# #
#################################
#
# Espressif ESP32
#
[env:esp32]
platform = espressif32@1.11.2
board = esp32dev
build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0
lib_deps = ${common.lib_deps}
AsyncTCP=https://github.com/me-no-dev/AsyncTCP/archive/master.zip
ESPAsyncWebServer=https://github.com/me-no-dev/ESPAsyncWebServer/archive/master.zip
ESP3DLib=https://github.com/luc-github/ESP3DLib.git
arduinoWebSockets=https://github.com/Links2004/arduinoWebSockets.git
ESP32SSDP=https://github.com/luc-github/ESP32SSDP.git
lib_ignore = LiquidCrystal, LiquidTWI2, SailfishLCD, ESPAsyncTCP
src_filter = ${common.default_src_filter} +<src/HAL/ESP32>
upload_speed = 115200
#upload_port = marlinesp.local
#board_build.flash_mode = qio
#
# Teensy 3.1 / 3.2 (ARM Cortex-M4)
#
[env:teensy31]
platform = teensy
board = teensy31
lib_deps = ${common.lib_deps}
TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
lib_ignore = Adafruit NeoPixel
src_filter = ${common.default_src_filter} +<src/HAL/TEENSY31_32>
#
# Teensy 3.5 / 3.6 (ARM Cortex-M4)
#
[env:teensy35]
platform = teensy
board = teensy35
lib_deps = ${common.lib_deps}
TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
lib_ignore = Adafruit NeoPixel
src_filter = ${common.default_src_filter} +<src/HAL/TEENSY35_36>
#
# Native
# No supported Arduino libraries, base Marlin only
#
[env:linux_native]
platform = native
framework =
build_flags = -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread -D__MARLIN_FIRMWARE__ -Wno-expansion-to-defined
src_build_flags = -Wall -IMarlin/src/HAL/LINUX/include
build_unflags = -Wall
lib_ldf_mode = off
lib_deps =
src_filter = ${common.default_src_filter} +<src/HAL/LINUX>
# #
# Just print the dependency tree # Just print the dependency tree
# #