Browse Source

Let libmaple accept RX/TX_BUFFER_SIZE (#21177)

X-Ryl669 4 years ago
parent
commit
0cc03f912c
No account linked to committer's email address
2 changed files with 18 additions and 6 deletions
  1. 12
    0
      buildroot/share/PlatformIO/scripts/fix_framework_weakness.py
  2. 6
    6
      platformio.ini

+ 12
- 0
buildroot/share/PlatformIO/scripts/fix_framework_weakness.py View File

27
         print("Done patching exception handler")
27
         print("Done patching exception handler")
28
 
28
 
29
     print("Libmaple modified and ready for post mortem debugging")
29
     print("Libmaple modified and ready for post mortem debugging")
30
+
31
+rxBuf = env["MARLIN_FEATURES"]["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in env["MARLIN_FEATURES"] else "0"
32
+txBuf = env["MARLIN_FEATURES"]["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in env["MARLIN_FEATURES"] else "0"
33
+if int(rxBuf) < 64:
34
+	rxBuf = "64"
35
+
36
+if int(txBuf) < 64:
37
+	txBuf = "64"
38
+
39
+build_flags = env.get('BUILD_FLAGS')
40
+build_flags.append("-DUSART_RX_BUF_SIZE=" + rxBuf + " -DUSART_TX_BUF_SIZE=" + txBuf)
41
+env.Replace(BUILD_FLAGS=build_flags)

+ 6
- 6
platformio.ini View File

753
   SoftwareSerialM
753
   SoftwareSerialM
754
 platform_packages = tool-stm32duino
754
 platform_packages = tool-stm32duino
755
 extra_scripts     = ${common.extra_scripts}
755
 extra_scripts     = ${common.extra_scripts}
756
-  buildroot/share/PlatformIO/scripts/fix_framework_weakness.py
756
+  pre:buildroot/share/PlatformIO/scripts/fix_framework_weakness.py
757
 
757
 
758
 #
758
 #
759
 # STM32F103RC
759
 # STM32F103RC
795
 [env:STM32F103RC_fysetc]
795
 [env:STM32F103RC_fysetc]
796
 platform          = ${common_stm32f1.platform}
796
 platform          = ${common_stm32f1.platform}
797
 extends           = env:STM32F103RC
797
 extends           = env:STM32F103RC
798
-extra_scripts     = ${common.extra_scripts}
798
+extra_scripts     = ${common_stm32f1.extra_scripts}
799
   buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
799
   buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
800
 build_flags       = ${common_stm32f1.build_flags} -DDEBUG_LEVEL=0
800
 build_flags       = ${common_stm32f1.build_flags} -DDEBUG_LEVEL=0
801
 lib_ldf_mode      = chain
801
 lib_ldf_mode      = chain
819
 [env:STM32F103RC_btt]
819
 [env:STM32F103RC_btt]
820
 platform          = ${common_stm32f1.platform}
820
 platform          = ${common_stm32f1.platform}
821
 extends           = env:STM32F103RC
821
 extends           = env:STM32F103RC
822
-extra_scripts     = ${common.extra_scripts}
822
+extra_scripts     = ${common_stm32f1.extra_scripts}
823
   buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
823
   buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
824
 build_flags       = ${common_stm32f1.build_flags}
824
 build_flags       = ${common_stm32f1.build_flags}
825
   -DDEBUG_LEVEL=0 -DSS_TIMER=4
825
   -DDEBUG_LEVEL=0 -DSS_TIMER=4
861
 [env:STM32F103RE_btt]
861
 [env:STM32F103RE_btt]
862
 platform          = ${common_stm32f1.platform}
862
 platform          = ${common_stm32f1.platform}
863
 extends           = env:STM32F103RE
863
 extends           = env:STM32F103RE
864
-extra_scripts     = ${common.extra_scripts}
864
+extra_scripts     = ${common_stm32f1.extra_scripts}
865
   buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py
865
   buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py
866
 build_flags       = ${common_stm32f1.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4
866
 build_flags       = ${common_stm32f1.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4
867
 debug_tool        = stlink
867
 debug_tool        = stlink
951
 platform        = ${common_stm32f1.platform}
951
 platform        = ${common_stm32f1.platform}
952
 extends         = common_stm32f1
952
 extends         = common_stm32f1
953
 board           = genericSTM32F103VE
953
 board           = genericSTM32F103VE
954
-extra_scripts   = ${common.extra_scripts}
954
+extra_scripts   = ${common_stm32f1.extra_scripts}
955
   buildroot/share/PlatformIO/scripts/mks_robin_nano35.py
955
   buildroot/share/PlatformIO/scripts/mks_robin_nano35.py
956
 build_flags     = ${common_stm32f1.build_flags}
956
 build_flags     = ${common_stm32f1.build_flags}
957
   -DMCU_STM32F103VE -DSS_TIMER=4
957
   -DMCU_STM32F103VE -DSS_TIMER=4
1019
 extends       = common_stm32f1
1019
 extends       = common_stm32f1
1020
 board         = genericSTM32F103RC
1020
 board         = genericSTM32F103RC
1021
 platform_packages = tool-stm32duino
1021
 platform_packages = tool-stm32duino
1022
-extra_scripts = ${common.extra_scripts}
1022
+extra_scripts = ${common_stm32f1.extra_scripts}
1023
   buildroot/share/PlatformIO/scripts/mks_robin_e3.py
1023
   buildroot/share/PlatformIO/scripts/mks_robin_e3.py
1024
 build_flags   = ${common_stm32f1.build_flags}
1024
 build_flags   = ${common_stm32f1.build_flags}
1025
   -DDEBUG_LEVEL=0 -DSS_TIMER=4
1025
   -DDEBUG_LEVEL=0 -DSS_TIMER=4

Loading…
Cancel
Save