Selaa lähdekoodia

SoftwareSerialM for SKR STM32F1 boards (#15875)

Jason Smith 4 vuotta sitten
vanhempi
commit
9fd35c84ce

+ 1
- 1
Marlin/src/HAL/HAL_AVR/HAL.h Näytä tiedosto

@@ -25,7 +25,7 @@
25 25
 #include "math.h"
26 26
 
27 27
 #ifdef USBCON
28
-  #include "HardwareSerial.h"
28
+  #include <HardwareSerial.h>
29 29
 #else
30 30
   #define HardwareSerial_h // Hack to prevent HardwareSerial.h header inclusion
31 31
   #include "MarlinSerial.h"

+ 1
- 1
Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h Näytä tiedosto

@@ -23,7 +23,7 @@
23 23
 
24 24
 #include "../../inc/MarlinConfig.h"
25 25
 
26
-#include "Stream.h"
26
+#include <Stream.h>
27 27
 
28 28
 #ifndef RX_BUFFER_SIZE
29 29
   #define RX_BUFFER_SIZE 128

+ 4
- 4
Marlin/src/HAL/HAL_ESP32/i2s.cpp Näytä tiedosto

@@ -26,10 +26,10 @@
26 26
 #include "i2s.h"
27 27
 
28 28
 #include "../shared/Marduino.h"
29
-#include "driver/periph_ctrl.h"
30
-#include "rom/lldesc.h"
31
-#include "soc/i2s_struct.h"
32
-#include "freertos/queue.h"
29
+#include <driver/periph_ctrl.h>
30
+#include <rom/lldesc.h>
31
+#include <soc/i2s_struct.h>
32
+#include <freertos/queue.h>
33 33
 #include "../../module/stepper.h"
34 34
 
35 35
 #define DMA_BUF_COUNT 8                                // number of DMA buffers to store data

+ 1
- 1
Marlin/src/HAL/HAL_ESP32/ota.cpp Näytä tiedosto

@@ -27,7 +27,7 @@
27 27
 #include <ESPmDNS.h>
28 28
 #include <WiFiUdp.h>
29 29
 #include <ArduinoOTA.h>
30
-#include "driver/timer.h"
30
+#include <driver/timer.h>
31 31
 
32 32
 void OTA_init() {
33 33
   ArduinoOTA

+ 4
- 4
Marlin/src/HAL/HAL_ESP32/timers.cpp Näytä tiedosto

@@ -23,10 +23,10 @@
23 23
 #ifdef ARDUINO_ARCH_ESP32
24 24
 
25 25
 #include <stdio.h>
26
-#include "esp_types.h"
27
-#include "soc/timer_group_struct.h"
28
-#include "driver/periph_ctrl.h"
29
-#include "driver/timer.h"
26
+#include <esp_types.h>
27
+#include <soc/timer_group_struct.h>
28
+#include <driver/periph_ctrl.h>
29
+#include <driver/timer.h>
30 30
 
31 31
 #include "HAL.h"
32 32
 

+ 1
- 1
Marlin/src/HAL/HAL_ESP32/timers.h Näytä tiedosto

@@ -22,7 +22,7 @@
22 22
 #pragma once
23 23
 
24 24
 #include <stdint.h>
25
-#include "driver/timer.h"
25
+#include <driver/timer.h>
26 26
 
27 27
 // Includes needed to get I2S_STEPPER_STREAM. Note that pins.h
28 28
 // is included in case this header is being included early.

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/HAL_SPI.cpp Näytä tiedosto

@@ -56,7 +56,7 @@
56 56
 // ------------------------
57 57
 #if ENABLED(LPC_SOFTWARE_SPI)
58 58
 
59
-  #include "SoftwareSPI.h"
59
+  #include <SoftwareSPI.h>
60 60
 
61 61
   // Software SPI
62 62
 

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp Näytä tiedosto

@@ -46,7 +46,7 @@
46 46
 #if ENABLED(FLASH_EEPROM_EMULATION)
47 47
 
48 48
 extern "C" {
49
-  #include "lpc17xx_iap.h"
49
+  #include <lpc17xx_iap.h>
50 50
 }
51 51
 
52 52
 #define SECTOR_START(sector)  ((sector < 16) ? (sector * 0x1000) : ((sector - 14) * 0x8000))

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp Näytä tiedosto

@@ -60,7 +60,7 @@
60 60
 #if ENABLED(U8GLIB_ST7920)
61 61
 
62 62
 #include <U8glib.h>
63
-#include "SoftwareSPI.h"
63
+#include <SoftwareSPI.h>
64 64
 #include "../../shared/Delay.h"
65 65
 
66 66
 #undef SPI_SPEED

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp Näytä tiedosto

@@ -59,7 +59,7 @@
59 59
 
60 60
 #if HAS_GRAPHICAL_LCD && DISABLED(U8GLIB_ST7920)
61 61
 
62
-#include "SoftwareSPI.h"
62
+#include <SoftwareSPI.h>
63 63
 
64 64
 #undef SPI_SPEED
65 65
 #define SPI_SPEED 2  // About 2 MHz

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/watchdog.cpp Näytä tiedosto

@@ -26,7 +26,7 @@
26 26
 
27 27
 #if ENABLED(USE_WATCHDOG)
28 28
 
29
-#include "lpc17xx_wdt.h"
29
+#include <lpc17xx_wdt.h>
30 30
 #include "watchdog.h"
31 31
 
32 32
 void watchdog_init() {

+ 2
- 2
Marlin/src/HAL/HAL_SAMD51/HAL.cpp Näytä tiedosto

@@ -22,8 +22,8 @@
22 22
 #ifdef __SAMD51__
23 23
 
24 24
 #include "../../inc/MarlinConfig.h"
25
-#include "Adafruit_ZeroDMA.h"
26
-#include "wiring_private.h"
25
+#include <Adafruit_ZeroDMA.h>
26
+#include <wiring_private.h>
27 27
 
28 28
 // ------------------------
29 29
 // Local defines

+ 3
- 3
Marlin/src/HAL/HAL_STM32/HAL.cpp Näytä tiedosto

@@ -36,13 +36,13 @@
36 36
 
37 37
 #if HAS_SWSERIAL
38 38
   #include "SoftwareSerial.h"
39
-#endif  
39
+#endif
40 40
 
41 41
 #if ENABLED(SRAM_EEPROM_EMULATION)
42 42
   #if STM32F7xx
43
-    #include "stm32f7xx_ll_pwr.h"
43
+    #include <stm32f7xx_ll_pwr.h>
44 44
   #elif STM32F4xx
45
-    #include "stm32f4xx_ll_pwr.h"
45
+    #include <stm32f4xx_ll_pwr.h>
46 46
   #else
47 47
     #error "SRAM_EEPROM_EMULATION is currently only supported for STM32F4xx and STM32F7xx"
48 48
   #endif

+ 1
- 1
Marlin/src/HAL/HAL_STM32/timers.cpp Näytä tiedosto

@@ -91,7 +91,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
91 91
     // This is fixed in Arduino_Core_STM32 1.8.
92 92
     // These calls can be removed and replaced with
93 93
     // timer_instance[timer_num]->setInterruptPriority
94
-    switch (timer_num) {                 
94
+    switch (timer_num) {
95 95
       case STEP_TIMER_NUM:
96 96
         HAL_NVIC_SetPriority(STEP_TIMER_IRQ_NAME, STEP_TIMER_IRQ_PRIO, 0);
97 97
         break;

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/HAL.cpp Näytä tiedosto

@@ -272,7 +272,7 @@ extern "C" {
272 272
 // return free memory between end of heap (or end bss) and whatever is current
273 273
 
274 274
 /*
275
-#include "wirish/syscalls.c"
275
+#include <wirish/syscalls.c>
276 276
 //extern caddr_t _sbrk(int incr);
277 277
 #ifndef CONFIG_HEAP_END
278 278
 extern char _lm_heap_end;

+ 3
- 1
Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.h Näytä tiedosto

@@ -20,7 +20,9 @@
20 20
 
21 21
 #include <stdint.h>
22 22
 
23
-#define SW_SERIAL_PLACEHOLDER 1
23
+#ifndef HAVE_SW_SERIAL
24
+   #define SW_SERIAL_PLACEHOLDER 1
25
+#endif
24 26
 
25 27
 class SoftwareSerial {
26 28
 public:

+ 5
- 0
Marlin/src/HAL/HAL_STM32F1/inc/SanityCheck.h Näytä tiedosto

@@ -36,3 +36,8 @@
36 36
 #if ENABLED(FAST_PWM_FAN)
37 37
   #error "FAST_PWM_FAN is not yet implemented for this platform."
38 38
 #endif
39
+
40
+#if !defined(HAVE_SW_SERIAL) && HAS_TMC220x
41
+  #warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER."
42
+  #error "Missing SoftwareSerial implementation."
43
+#endif

+ 1
- 1
Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp Näytä tiedosto

@@ -64,7 +64,7 @@ extern "C" {
64 64
 // return free memory between end of heap (or end bss) and whatever is current
65 65
 
66 66
 /*
67
-#include "wirish/syscalls.c"
67
+#include <wirish/syscalls.c>
68 68
 //extern caddr_t _sbrk(int incr);
69 69
 #ifndef CONFIG_HEAP_END
70 70
 extern char _lm_heap_end;

+ 1
- 1
Marlin/src/core/drivers.h Näytä tiedosto

@@ -133,7 +133,7 @@
133 133
                                        || HAS_E_DRIVER(TMC2660_STANDALONE) \
134 134
                                        || HAS_E_DRIVER(TMC2209_STANDALONE) \
135 135
                                        || HAS_E_DRIVER(TMC5130_STANDALONE) \
136
-                                       || HAS_E_DRIVER(TMC5160_STANDALONE) )                   
136
+                                       || HAS_E_DRIVER(TMC5160_STANDALONE) )
137 137
 //
138 138
 // Stretching 'drivers.h' to include LPC/SAMD51 SD options
139 139
 //

+ 1
- 1
buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c Näytä tiedosto

@@ -122,7 +122,7 @@ const PinMap PinMap_PWM[] = {
122 122
   {PE_5,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1    FAN1
123 123
   {PE_6,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2    FAN2
124 124
   {PC_9,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4    EXTENSION1-4
125
-  
125
+
126 126
   //probably unused on SKR-Pro. confirmation needed, please.
127 127
   //{PA_0,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
128 128
   //{PA_0,  TIM5,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1

+ 4
- 2
platformio.ini Näytä tiedosto

@@ -301,9 +301,10 @@ board             = genericSTM32F103RC
301 301
 platform_packages = tool-stm32duino
302 302
 extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
303 303
 build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
304
-  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14
304
+  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4
305 305
 build_unflags     = -std=gnu++11
306 306
 lib_deps          = ${common.lib_deps}
307
+  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
307 308
 lib_ignore        = Adafruit NeoPixel, SPI
308 309
 src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
309 310
 monitor_speed     = 115200
@@ -315,9 +316,10 @@ board             = genericSTM32F103RC
315 316
 platform_packages = tool-stm32duino
316 317
 extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
317 318
 build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
318
-  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DUSE_USB_COMPOSITE
319
+  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DUSE_USB_COMPOSITE -DHAVE_SW_SERIAL -DSS_TIMER=4
319 320
 build_unflags     = -std=gnu++11
320 321
 lib_deps          = ${common.lib_deps}
322
+  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
321 323
 lib_ignore        = Adafruit NeoPixel, SPI
322 324
 src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
323 325
 monitor_speed     = 115200

Loading…
Peruuta
Tallenna