2021-02-27 22:41:16 -06:00
|
|
|
#
|
|
|
|
# SAMD51_grandcentral_m4.py
|
|
|
|
# Customizations for env:SAMD51_grandcentral_m4
|
|
|
|
#
|
2021-11-04 05:28:42 -05:00
|
|
|
import pioutil
|
|
|
|
if pioutil.is_pio_build():
|
2022-08-19 11:00:52 -05:00
|
|
|
from os.path import join, isfile
|
|
|
|
import shutil
|
2021-02-27 22:41:16 -06:00
|
|
|
|
2022-08-19 11:00:52 -05:00
|
|
|
Import("env")
|
2021-02-27 22:41:16 -06:00
|
|
|
|
2022-08-19 11:00:52 -05:00
|
|
|
mf = env["MARLIN_FEATURES"]
|
|
|
|
rxBuf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
|
|
|
|
txBuf = mf["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in mf else "0"
|
2021-02-27 22:41:16 -06:00
|
|
|
|
2022-08-19 11:00:52 -05:00
|
|
|
serialBuf = str(max(int(rxBuf), int(txBuf), 350))
|
2021-02-27 22:41:16 -06:00
|
|
|
|
2022-08-19 11:00:52 -05:00
|
|
|
build_flags = env.get('BUILD_FLAGS')
|
|
|
|
build_flags.append("-DSERIAL_BUFFER_SIZE=" + serialBuf)
|
|
|
|
env.Replace(BUILD_FLAGS=build_flags)
|