Let libmaple accept RX/TX_BUFFER_SIZE (#21177)

This commit is contained in:
X-Ryl669
2021-02-25 08:26:56 +01:00
committed by GitHub
parent f003e52009
commit 0cc03f912c
2 changed files with 18 additions and 6 deletions

View File

@ -27,3 +27,15 @@ if env.MarlinFeatureIsEnabled("POSTMORTEM_DEBUGGING"):
print("Done patching exception handler")
print("Libmaple modified and ready for post mortem debugging")
rxBuf = env["MARLIN_FEATURES"]["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in env["MARLIN_FEATURES"] else "0"
txBuf = env["MARLIN_FEATURES"]["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in env["MARLIN_FEATURES"] else "0"
if int(rxBuf) < 64:
rxBuf = "64"
if int(txBuf) < 64:
txBuf = "64"
build_flags = env.get('BUILD_FLAGS')
build_flags.append("-DUSART_RX_BUF_SIZE=" + rxBuf + " -DUSART_TX_BUF_SIZE=" + txBuf)
env.Replace(BUILD_FLAGS=build_flags)