Browse Source

STM32F1 cleanup, incl. SoftwareSerial removal (#20046)

Jason Smith 4 years ago
parent
commit
bd872d5dcf
No account linked to committer's email address

+ 0
- 60
Marlin/src/HAL/STM32F1/SoftwareSerial.cpp View File

@@ -1,60 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
- *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
- *
18
- */
19
-#if defined(__STM32F1__) && !defined(HAVE_SW_SERIAL)
20
-
21
-/**
22
- * Empty class for Software Serial implementation (Custom RX/TX pins)
23
- *
24
- * TODO: Optionally use https://github.com/FYSETC/SoftwareSerialM if TMC UART is wanted
25
- */
26
-
27
-#include "SoftwareSerial.h"
28
-
29
-// Constructor
30
-
31
-SoftwareSerial::SoftwareSerial(int8_t RX_pin, int8_t TX_pin) {}
32
-
33
-// Public
34
-
35
-void SoftwareSerial::begin(const uint32_t baudrate) {
36
-}
37
-
38
-bool SoftwareSerial::available() {
39
-  return false;
40
-}
41
-
42
-uint8_t SoftwareSerial::read() {
43
-  return 0;
44
-}
45
-
46
-uint16_t SoftwareSerial::write(uint8_t byte) {
47
-  return 0;
48
-}
49
-
50
-void SoftwareSerial::flush() {}
51
-
52
-void SoftwareSerial::listen() {
53
-  listening = true;
54
-}
55
-
56
-void SoftwareSerial::stopListening() {
57
-  listening = false;
58
-}
59
-
60
-#endif // __STM32F1__

+ 0
- 44
Marlin/src/HAL/STM32F1/SoftwareSerial.h View File

@@ -1,44 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
- *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
- *
18
- */
19
-#pragma once
20
-
21
-#include <stdint.h>
22
-
23
-#ifndef HAVE_SW_SERIAL
24
-   #define SW_SERIAL_PLACEHOLDER 1
25
-#endif
26
-
27
-class SoftwareSerial {
28
-public:
29
-  SoftwareSerial(int8_t RX_pin, int8_t TX_pin);
30
-
31
-  void begin(const uint32_t baudrate);
32
-
33
-  bool available();
34
-
35
-  uint8_t read();
36
-  uint16_t write(uint8_t byte);
37
-  void flush();
38
-
39
-  void listen();
40
-  void stopListening();
41
-
42
-protected:
43
-  bool listening;
44
-};

+ 1
- 1
Marlin/src/HAL/STM32F1/build_flags.py View File

@@ -3,7 +3,7 @@ import sys
3 3
 
4 4
 #dynamic build flags for generic compile options
5 5
 if __name__ == "__main__":
6
-  args = " ".join([ "-std=gnu11",
6
+  args = " ".join([ "-std=gnu++14",
7 7
                     "-Os",
8 8
                     "-mcpu=cortex-m3",
9 9
                     "-mthumb",

+ 0
- 5
Marlin/src/HAL/STM32F1/inc/SanityCheck.h View File

@@ -25,11 +25,6 @@
25 25
  * Test STM32F1-specific configuration values for errors at compile-time.
26 26
  */
27 27
 
28
-#if !defined(HAVE_SW_SERIAL) && HAS_TMC_SW_SERIAL
29
-  #warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER."
30
-  #error "Missing SoftwareSerial implementation."
31
-#endif
32
-
33 28
 #if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)
34 29
   #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
35 30
   #if USE_FALLBACK_EEPROM

+ 5
- 9
platformio.ini View File

@@ -711,7 +711,7 @@ src_filter    = ${common.default_src_filter} +<src/HAL/STM32> +<src/HAL/shared/b
711 711
 [common_stm32f1]
712 712
 platform      = ststm32@~6.1
713 713
 build_flags   = !python Marlin/src/HAL/STM32F1/build_flags.py
714
-  ${common.build_flags} -std=gnu++14 -DHAVE_SW_SERIAL
714
+  ${common.build_flags}
715 715
 build_unflags = -std=gnu11 -std=gnu++11
716 716
 src_filter    = ${common.default_src_filter} +<src/HAL/STM32F1>
717 717
 lib_ignore    = SPI
@@ -1121,18 +1121,14 @@ build_flags   = ${env:chitu_f103.build_flags} -DCHITU_V5_Z_MIN_BUGFIX
1121 1121
 # Creality (STM32F103RET6)
1122 1122
 #
1123 1123
 [env:STM32F103RET6_creality]
1124
-platform        = ${common_stm32f1.platform}
1125
-extends         = common_stm32f1
1126
-board           = genericSTM32F103RE
1127
-build_flags     = !python Marlin/src/HAL/STM32F1/build_flags.py
1128
-  ${common.build_flags} -std=gnu++14 -DSTM32_XL_DENSITY -DTEMP_TIMER_CHAN=4
1129
-extra_scripts   = ${common.extra_scripts}
1124
+platform        = ${env:STM32F103RE.platform}
1125
+extends         = env:STM32F103RE
1126
+build_flags     = ${env:STM32F103RE.build_flags} -DTEMP_TIMER_CHAN=4
1127
+extra_scripts   = ${env:STM32F103RE.extra_scripts}
1130 1128
   pre:buildroot/share/PlatformIO/scripts/random-bin.py
1131 1129
   buildroot/share/PlatformIO/scripts/creality.py
1132
-lib_ignore      = ${common_stm32f1.lib_ignore}
1133 1130
 debug_tool      = jlink
1134 1131
 upload_protocol = jlink
1135
-monitor_speed   = 115200
1136 1132
 
1137 1133
 #
1138 1134
 # FLSUN QQ (STM32F103VET6)

Loading…
Cancel
Save