Skip to content

Commit

Permalink
Updated PIO
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 4, 2022
1 parent d72ebb6 commit d47a4e9
Show file tree
Hide file tree
Showing 14 changed files with 274 additions and 274 deletions.
20 changes: 10 additions & 10 deletions buildroot/share/PlatformIO/scripts/common-dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def add_to_feat_cnf(feature, flines):
for line in atoms:
parts = line.split('=')
name = parts.pop(0)
if name in ['build_flags', 'extra_scripts', 'src_filter', 'lib_ignore']:
if name in ['build_flags', 'extra_scripts', 'build_src_filter', 'lib_ignore']:
feat[name] = '='.join(parts)
blab("[%s] %s=%s" % (feature, name, feat[name]), 3)
else:
Expand Down Expand Up @@ -173,19 +173,19 @@ def apply_features_config():
blab("Running extra_scripts for %s... " % feature, 2)
env.SConscript(feat['extra_scripts'], exports="env")

if 'src_filter' in feat:
blab("========== Adding src_filter for %s... " % feature, 2)
src_filter = ' '.join(env.GetProjectOption('src_filter'))
if 'build_src_filter' in feat:
blab("========== Adding build_src_filter for %s... " % feature, 2)
build_src_filter = ' '.join(env.GetProjectOption('build_src_filter'))
# first we need to remove the references to the same folder
my_srcs = re.findall(r'[+-](<.*?>)', feat['src_filter'])
cur_srcs = re.findall(r'[+-](<.*?>)', src_filter)
my_srcs = re.findall(r'[+-](<.*?>)', feat['build_src_filter'])
cur_srcs = re.findall(r'[+-](<.*?>)', build_src_filter)
for d in my_srcs:
if d in cur_srcs:
src_filter = re.sub(r'[+-]' + d, '', src_filter)
build_src_filter = re.sub(r'[+-]' + d, '', build_src_filter)

src_filter = feat['src_filter'] + ' ' + src_filter
set_env_field('src_filter', [src_filter])
env.Replace(SRC_FILTER=src_filter)
build_src_filter = feat['build_src_filter'] + ' ' + build_src_filter
set_env_field('build_src_filter', [build_src_filter])
env.Replace(SRC_FILTER=build_src_filter)

if 'lib_ignore' in feat:
blab("========== Adding lib_ignore for %s... " % feature, 2)
Expand Down
2 changes: 1 addition & 1 deletion ini/avr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
platform = atmelavr@~3.4
build_flags = ${common.build_flags} -Wl,--relax
board_build.f_cpu = 16000000L
src_filter = ${common.default_src_filter} +<src/HAL/AVR>
build_src_filter = ${common.default_src_filter} +<src/HAL/AVR>

#
# ATmega2560
Expand Down
6 changes: 3 additions & 3 deletions ini/due.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
# - RADDS
#
[env:DUE]
platform = atmelsam
board = due
src_filter = ${common.default_src_filter} +<src/HAL/DUE> +<src/HAL/shared/backtrace>
platform = atmelsam
board = due
build_src_filter = ${common.default_src_filter} +<src/HAL/DUE> +<src/HAL/shared/backtrace>

[env:DUE_USB]
extends = env:DUE
Expand Down
16 changes: 8 additions & 8 deletions ini/esp32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
# Espressif ESP32
#
[env:esp32]
platform = espressif32@2.1.0
board = esp32dev
build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0
src_filter = ${common.default_src_filter} +<src/HAL/ESP32>
lib_ignore = NativeEthernet
upload_speed = 500000
monitor_speed = 250000
#upload_port = marlinesp.local
platform = espressif32@2.1.0
board = esp32dev
build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0
build_src_filter = ${common.default_src_filter} +<src/HAL/ESP32>
lib_ignore = NativeEthernet
upload_speed = 500000
monitor_speed = 250000
#upload_port = marlinesp.local
#board_build.flash_mode = qio

[env:FYSETC_E4]
Expand Down
416 changes: 208 additions & 208 deletions ini/features.ini

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ini/lpc176x.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ lib_ldf_mode = off
lib_compat_mode = strict
extra_scripts = ${common.extra_scripts}
Marlin/src/HAL/LPC1768/upload_extra_script.py
src_filter = ${common.default_src_filter} +<src/HAL/LPC1768> +<src/HAL/shared/backtrace>
build_src_filter = ${common.default_src_filter} +<src/HAL/LPC1768> +<src/HAL/shared/backtrace>
lib_deps = ${common.lib_deps}
Servo
custom_marlin.USES_LIQUIDCRYSTAL = arduino-libraries/LiquidCrystal@~1.0.7
Expand Down
22 changes: 11 additions & 11 deletions ini/native.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
# 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>
platform = native
framework =
build_flags = -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread -D__MARLIN_FIRMWARE__ -Wno-expansion-to-defined
build_src_flags = -Wall -IMarlin/src/HAL/LINUX/include
build_unflags = -Wall
lib_ldf_mode = off
lib_deps =
build_src_filter = ${common.default_src_filter} +<src/HAL/LINUX>

#
# Native Simulation
Expand All @@ -35,11 +35,11 @@ src_filter = ${common.default_src_filter} +<src/HAL/LINUX>
platform = native
framework =
build_flags = ${common.build_flags} -std=gnu++17 -D__PLAT_NATIVE_SIM__ -DU8G_HAL_LINKS -I/usr/include/SDL2 -IMarlin -IMarlin/src/HAL/NATIVE_SIM/u8g
src_build_flags = -Wall -Wno-expansion-to-defined -Wcast-align
build_src_flags = -Wall -Wno-expansion-to-defined -Wcast-align
release_flags = -g0 -O3 -flto
debug_build_flags = -fstack-protector-strong -g -g3 -ggdb
lib_compat_mode = off
src_filter = ${common.default_src_filter} +<src/HAL/NATIVE_SIM>
build_src_filter = ${common.default_src_filter} +<src/HAL/NATIVE_SIM>
lib_deps = ${common.lib_deps}
MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/0.0.2.zip
Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/marlin_sim_native.zip
Expand Down Expand Up @@ -107,6 +107,6 @@ build_unflags = ${simulator_macos.build_unflags}
#
[env:simulator_windows]
extends = simulator_common
src_build_flags = ${simulator_common.src_build_flags} -fpermissive
build_src_flags = ${simulator_common.build_src_flags} -fpermissive
build_flags = ${simulator_common.build_flags} ${simulator_common.debug_build_flags} -IC:\\msys64\\mingw64\\include\\SDL2 -fno-stack-protector -Wl,-subsystem,windows -ldl -lmingw32 -lSDL2main -lSDL2 -lSDL2_net -lopengl32 -lssp
build_type = debug
16 changes: 8 additions & 8 deletions ini/samd51.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
# 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
build_unflags = -std=gnu++11
src_filter = ${common.default_src_filter} +<src/HAL/SAMD51>
lib_deps = ${common.lib_deps}
platform = atmelsam
board = adafruit_grandcentral_m4
build_flags = ${common.build_flags} -std=gnu++17
build_unflags = -std=gnu++11
build_src_filter = ${common.default_src_filter} +<src/HAL/SAMD51>
lib_deps = ${common.lib_deps}
SoftwareSerialM
extra_scripts = ${common.extra_scripts}
extra_scripts = ${common.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py
custom_marlin.SDSUPPORT = SdFat - Adafruit Fork, Adafruit SPIFlash
debug_tool = jlink
debug_tool = jlink
2 changes: 1 addition & 1 deletion ini/stm32-common.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ build_flags = ${common.build_flags}
-DTIM_IRQ_PRIO=13
-DADC_RESOLUTION=12
build_unflags = -std=gnu++11
src_filter = ${common.default_src_filter} +<src/HAL/STM32> +<src/HAL/shared/backtrace>
build_src_filter = ${common.default_src_filter} +<src/HAL/STM32> +<src/HAL/shared/backtrace>
extra_scripts = ${common.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py

Expand Down
2 changes: 1 addition & 1 deletion ini/stm32f0.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ board = malyanm300_f070cb
build_flags = ${common_stm32.build_flags}
-DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB
-DHAL_UART_MODULE_ENABLED
src_filter = ${common.default_src_filter} +<src/HAL/STM32>
build_src_filter = ${common.default_src_filter} +<src/HAL/STM32>
2 changes: 1 addition & 1 deletion ini/stm32f1-maple.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ board_build.core = maple
build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py
${common.build_flags} -DARDUINO_ARCH_STM32 -DMAPLE_STM32F1
build_unflags = -std=gnu11 -std=gnu++11
src_filter = ${common.default_src_filter} +<src/HAL/STM32F1>
build_src_filter = ${common.default_src_filter} +<src/HAL/STM32F1>
lib_ignore = SPI, FreeRTOS701, FreeRTOS821
lib_deps = ${common.lib_deps}
SoftwareSerialM
Expand Down
2 changes: 1 addition & 1 deletion ini/stm32f1.ini
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ board = malyanm200_f103cb
build_flags = ${common_stm32.build_flags}
-DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB
-DHAL_UART_MODULE_ENABLED
src_filter = ${common.default_src_filter} +<src/HAL/STM32>
build_src_filter = ${common.default_src_filter} +<src/HAL/STM32>

#
# FLYmaker FLY Mini (STM32F103RCT6)
Expand Down
32 changes: 16 additions & 16 deletions ini/teensy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,36 +45,36 @@ board = teensy2pp
# Teensy 3.x - 4.x
#
[teensy_arm]
platform = teensy@~4.12.0
src_filter = ${common.default_src_filter}
lib_ignore = NativeEthernet
platform = teensy@~4.12.0
build_src_filter = ${common.default_src_filter}
lib_ignore = NativeEthernet

#
# Teensy 3.1 / 3.2 (ARM Cortex-M4)
#
[env:teensy31]
extends = teensy_arm
board = teensy31
src_filter = ${teensy_arm.src_filter} +<src/HAL/TEENSY31_32>
extends = teensy_arm
board = teensy31
build_src_filter = ${teensy_arm.build_src_filter} +<src/HAL/TEENSY31_32>

#
# Teensy 3.5 / 3.6 (ARM Cortex-M4)
#
[env:teensy35]
extends = teensy_arm
board = teensy35
src_filter = ${teensy_arm.src_filter} +<src/HAL/TEENSY35_36>
extends = teensy_arm
board = teensy35
build_src_filter = ${teensy_arm.build_src_filter} +<src/HAL/TEENSY35_36>

[env:teensy36]
extends = teensy_arm
board = teensy36
src_filter = ${teensy_arm.src_filter} +<src/HAL/TEENSY35_36>
extends = teensy_arm
board = teensy36
build_src_filter = ${teensy_arm.build_src_filter} +<src/HAL/TEENSY35_36>

#
# Teensy 4.0 / 4.1 (ARM Cortex-M7)
#
[env:teensy41]
extends = teensy_arm
board = teensy41
src_filter = ${teensy_arm.src_filter} +<src/HAL/TEENSY40_41>
lib_ignore =
extends = teensy_arm
board = teensy41
build_src_filter = ${teensy_arm.build_src_filter} +<src/HAL/TEENSY40_41>
lib_ignore =
8 changes: 4 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ monitor_flags =
# Just print the dependency tree
#
[env:include_tree]
platform = atmelavr
board = megaatmega2560
build_flags = -c -H -std=gnu++11 -Wall -Os -D__MARLIN_FIRMWARE__
src_filter = +<src/MarlinCore.cpp>
platform = atmelavr
board = megaatmega2560
build_flags = -c -H -std=gnu++11 -Wall -Os -D__MARLIN_FIRMWARE__
build_src_filter = +<src/MarlinCore.cpp>

0 comments on commit d47a4e9

Please sign in to comment.