Browse Source

[SAMD51] Respect serial buffer size (#21194)

Giuliano Zaro 3 years ago
parent
commit
254b25296b
No account linked to committer's email address
2 changed files with 20 additions and 0 deletions
  1. 18
    0
      buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py
  2. 2
    0
      platformio.ini

+ 18
- 0
buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py View File

@@ -0,0 +1,18 @@
1
+#
2
+# SAMD51_grandcentral_m4.py
3
+# Customizations for env:SAMD51_grandcentral_m4
4
+#
5
+from os.path import join, isfile
6
+import shutil
7
+from pprint import pprint
8
+
9
+Import("env")
10
+
11
+rxBuf = env["MARLIN_FEATURES"]["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in env["MARLIN_FEATURES"] else "0"
12
+txBuf = env["MARLIN_FEATURES"]["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in env["MARLIN_FEATURES"] else "0"
13
+
14
+serialBuf = str(max(int(rxBuf), int(txBuf), 350))
15
+
16
+build_flags = env.get('BUILD_FLAGS')
17
+build_flags.append("-DSERIAL_BUFFER_SIZE=" + serialBuf)
18
+env.Replace(BUILD_FLAGS=build_flags)

+ 2
- 0
platformio.ini View File

@@ -681,6 +681,8 @@ src_filter     = ${common.default_src_filter} +<src/HAL/SAMD51>
681 681
 lib_deps       = ${common.lib_deps}
682 682
   SoftwareSerialM
683 683
   Adafruit SPIFlash
684
+extra_scripts  = ${common.extra_scripts}
685
+  pre:buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py
684 686
 custom_marlin.SDSUPPORT = SdFat - Adafruit Fork
685 687
 debug_tool     = jlink
686 688
 

Loading…
Cancel
Save