Ver código fonte

Fix BLTOUCH and FAN PWM conflicts on SKR E3 boards (#15547)

Jason Smith 4 anos atrás
pai
commit
53abfdc2c3

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/HAL.cpp Ver arquivo

27
 
27
 
28
 #ifdef __STM32F1__
28
 #ifdef __STM32F1__
29
 
29
 
30
-#include "HAL.h"
31
 #include "../../inc/MarlinConfig.h"
30
 #include "../../inc/MarlinConfig.h"
31
+#include "HAL.h"
32
 
32
 
33
 #include <STM32ADC.h>
33
 #include <STM32ADC.h>
34
 
34
 

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/timers.cpp Ver arquivo

26
 
26
 
27
 #ifdef __STM32F1__
27
 #ifdef __STM32F1__
28
 
28
 
29
+#include "../../inc/MarlinConfig.h"
29
 #include "HAL.h"
30
 #include "HAL.h"
30
-
31
 #include "timers.h"
31
 #include "timers.h"
32
 
32
 
33
 // ------------------------
33
 // ------------------------

+ 8
- 1
Marlin/src/HAL/HAL_STM32F1/timers.h Ver arquivo

27
 
27
 
28
 #include <stdint.h>
28
 #include <stdint.h>
29
 #include <libmaple/timer.h>
29
 #include <libmaple/timer.h>
30
+#include "../../core/boards.h"
30
 
31
 
31
 // ------------------------
32
 // ------------------------
32
 // Defines
33
 // Defines
54
 #define TEMP_TIMER_NUM 2    // index of timer to use for temperature
55
 #define TEMP_TIMER_NUM 2    // index of timer to use for temperature
55
 //#define TEMP_TIMER_NUM 4  // 2->4, Timer 2 for Stepper Current PWM
56
 //#define TEMP_TIMER_NUM 4  // 2->4, Timer 2 for Stepper Current PWM
56
 #define PULSE_TIMER_NUM STEP_TIMER_NUM
57
 #define PULSE_TIMER_NUM STEP_TIMER_NUM
57
-#define SERVO0_TIMER_NUM 1  // SERVO0 or BLTOUCH
58
+
59
+#if MB(BIGTREE_SKR_MINI_E3, BIGTREE_SKR_E3_DIP, BTT_SKR_MINI_E3_V1_2, MKS_ROBIN_LITE)
60
+  // SKR Mini E3 boards use PA8 as FAN_PIN, so TIMER 1 is used for Fan PWM.
61
+  #define SERVO0_TIMER_NUM 8
62
+#else
63
+  #define SERVO0_TIMER_NUM 1  // SERVO0 or BLTOUCH
64
+#endif
58
 
65
 
59
 #define STEP_TIMER_IRQ_PRIO 1
66
 #define STEP_TIMER_IRQ_PRIO 1
60
 #define TEMP_TIMER_IRQ_PRIO 2
67
 #define TEMP_TIMER_IRQ_PRIO 2

+ 6
- 1
Marlin/src/core/boards.h Ver arquivo

21
  */
21
  */
22
 #pragma once
22
 #pragma once
23
 
23
 
24
+#include "macros.h"
25
+
24
 #define BOARD_UNKNOWN -1
26
 #define BOARD_UNKNOWN -1
25
 
27
 
26
 //
28
 //
316
 
318
 
317
 #define BOARD_LINUX_RAMPS             9999
319
 #define BOARD_LINUX_RAMPS             9999
318
 
320
 
319
-#define MB(board) (defined(BOARD_##board) && MOTHERBOARD==BOARD_##board)
321
+#define _MB_1(B)  (defined(BOARD_##B) && MOTHERBOARD==BOARD_##B)
322
+#define MB(V...)  DO(MB,||,V)
323
+
324
+#define IS_MELZI MB(MELZI, MELZI_CREALITY, MELZI_MAKR3D, MELZI_MALYAN, MELZI_TRONXY)

+ 1
- 1
Marlin/src/feature/digipot/digipot_mcp4451.cpp Ver arquivo

35
 #if MB(5DPRINT)
35
 #if MB(5DPRINT)
36
   #define DIGIPOT_I2C_FACTOR 117.96
36
   #define DIGIPOT_I2C_FACTOR 117.96
37
   #define DIGIPOT_I2C_MAX_CURRENT 1.736
37
   #define DIGIPOT_I2C_MAX_CURRENT 1.736
38
-#elif MB(AZTEEG_X5_MINI) || MB(AZTEEG_X5_MINI_WIFI)
38
+#elif MB(AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI)
39
   #define DIGIPOT_I2C_FACTOR 113.5
39
   #define DIGIPOT_I2C_FACTOR 113.5
40
   #define DIGIPOT_I2C_MAX_CURRENT 2.0
40
   #define DIGIPOT_I2C_MAX_CURRENT 2.0
41
 #else
41
 #else

+ 1
- 1
Marlin/src/inc/Conditionals_LCD.h Ver arquivo

562
   #define BOOT_MARLIN_LOGO_SMALL
562
   #define BOOT_MARLIN_LOGO_SMALL
563
 #endif
563
 #endif
564
 
564
 
565
-#define IS_RE_ARM_BOARD (MB(RAMPS_14_RE_ARM_EFB) || MB(RAMPS_14_RE_ARM_EEB) || MB(RAMPS_14_RE_ARM_EFF) || MB(RAMPS_14_RE_ARM_EEF) || MB(RAMPS_14_RE_ARM_SF))
565
+#define IS_RE_ARM_BOARD MB(RAMPS_14_RE_ARM_EFB, RAMPS_14_RE_ARM_EEB, RAMPS_14_RE_ARM_EFF, RAMPS_14_RE_ARM_EEF, RAMPS_14_RE_ARM_SF)
566
 
566
 
567
 #define HAS_SDCARD_CONNECTION EITHER(TARGET_LPC1768, ADAFRUIT_GRAND_CENTRAL_M4)
567
 #define HAS_SDCARD_CONNECTION EITHER(TARGET_LPC1768, ADAFRUIT_GRAND_CENTRAL_M4)
568
 
568
 

+ 1
- 1
Marlin/src/lcd/dogm/ultralcd_DOGM.h Ver arquivo

82
 
82
 
83
   // MaKrPanel, Mini Viki, Viki 2.0, AZSMZ 12864 ST7565 controller
83
   // MaKrPanel, Mini Viki, Viki 2.0, AZSMZ 12864 ST7565 controller
84
 
84
 
85
-  #define SMART_RAMPS (MB(RAMPS_SMART_EFB) || MB(RAMPS_SMART_EEB) || MB(RAMPS_SMART_EFF) || MB(RAMPS_SMART_EEF) || MB(RAMPS_SMART_SF))
85
+  #define SMART_RAMPS MB(RAMPS_SMART_EFB, RAMPS_SMART_EEB, RAMPS_SMART_EFF, RAMPS_SMART_EEF, RAMPS_SMART_SF)
86
   #define U8G_CLASS U8GLIB_64128N_2X_HAL                        // 4 stripes (HW-SPI)
86
   #define U8G_CLASS U8GLIB_64128N_2X_HAL                        // 4 stripes (HW-SPI)
87
   #if SMART_RAMPS || DOGLCD_SCK != SCK_PIN || DOGLCD_MOSI != MOSI_PIN
87
   #if SMART_RAMPS || DOGLCD_SCK != SCK_PIN || DOGLCD_MOSI != MOSI_PIN
88
     #define FORCE_SOFT_SPI                                      // SW-SPI
88
     #define FORCE_SOFT_SPI                                      // SW-SPI

+ 2
- 2
Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h Ver arquivo

49
   #define CPU_ST7920_DELAY_1 DELAY_NS(0)
49
   #define CPU_ST7920_DELAY_1 DELAY_NS(0)
50
   #define CPU_ST7920_DELAY_2 DELAY_NS(0)
50
   #define CPU_ST7920_DELAY_2 DELAY_NS(0)
51
   #define CPU_ST7920_DELAY_3 DELAY_NS(50)
51
   #define CPU_ST7920_DELAY_3 DELAY_NS(50)
52
-#elif MB(3DRAG) || MB(K8200) || MB(K8400) || MB(SILVER_GATE)
52
+#elif MB(3DRAG, K8200, K8400, SILVER_GATE)
53
   #define CPU_ST7920_DELAY_1 DELAY_NS(0)
53
   #define CPU_ST7920_DELAY_1 DELAY_NS(0)
54
   #define CPU_ST7920_DELAY_2 DELAY_NS(188)
54
   #define CPU_ST7920_DELAY_2 DELAY_NS(188)
55
   #define CPU_ST7920_DELAY_3 DELAY_NS(0)
55
   #define CPU_ST7920_DELAY_3 DELAY_NS(0)
56
-#elif MB(MINIRAMBO) || MB(EINSY_RAMBO) || MB(EINSY_RETRO)
56
+#elif MB(MINIRAMBO, EINSY_RAMBO, EINSY_RETRO)
57
   #define CPU_ST7920_DELAY_1 DELAY_NS(0)
57
   #define CPU_ST7920_DELAY_1 DELAY_NS(0)
58
   #define CPU_ST7920_DELAY_2 DELAY_NS(250)
58
   #define CPU_ST7920_DELAY_2 DELAY_NS(250)
59
   #define CPU_ST7920_DELAY_3 DELAY_NS(0)
59
   #define CPU_ST7920_DELAY_3 DELAY_NS(0)

+ 1
- 1
Marlin/src/pins/mega/pins_MEGATRONICS_3.h Ver arquivo

164
   #define SHIFT_OUT        34
164
   #define SHIFT_OUT        34
165
   #define SHIFT_EN         44
165
   #define SHIFT_EN         44
166
 
166
 
167
-  #if MB(MEGATRONICS_31) || MB(MEGATRONICS_32)
167
+  #if MB(MEGATRONICS_31, MEGATRONICS_32)
168
     #define SD_DETECT_PIN  56
168
     #define SD_DETECT_PIN  56
169
   #endif
169
   #endif
170
 
170
 

+ 7
- 7
Marlin/src/pins/pins.h Ver arquivo

35
 
35
 
36
 #define MAX_EXTRUDERS 6
36
 #define MAX_EXTRUDERS 6
37
 
37
 
38
-#if MB(RAMPS_13_EFB) || MB(RAMPS_14_EFB) || MB(RAMPS_PLUS_EFB) || MB(RAMPS_14_RE_ARM_EFB) || MB(RAMPS_SMART_EFB) || MB(RAMPS_DUO_EFB) || MB(RAMPS4DUE_EFB)
38
+#if   MB(RAMPS_13_EFB, RAMPS_14_EFB, RAMPS_PLUS_EFB, RAMPS_14_RE_ARM_EFB, RAMPS_SMART_EFB, RAMPS_DUO_EFB, RAMPS4DUE_EFB)
39
   #define IS_RAMPS_EFB
39
   #define IS_RAMPS_EFB
40
-#elif MB(RAMPS_13_EEB) || MB(RAMPS_14_EEB) || MB(RAMPS_PLUS_EEB) || MB(RAMPS_14_RE_ARM_EEB) || MB(RAMPS_SMART_EEB) || MB(RAMPS_DUO_EEB) || MB(RAMPS4DUE_EEB)
40
+#elif MB(RAMPS_13_EEB, RAMPS_14_EEB, RAMPS_PLUS_EEB, RAMPS_14_RE_ARM_EEB, RAMPS_SMART_EEB, RAMPS_DUO_EEB, RAMPS4DUE_EEB)
41
   #define IS_RAMPS_EEB
41
   #define IS_RAMPS_EEB
42
-#elif MB(RAMPS_13_EFF) || MB(RAMPS_14_EFF) || MB(RAMPS_PLUS_EFF) || MB(RAMPS_14_RE_ARM_EFF) || MB(RAMPS_SMART_EFF) || MB(RAMPS_DUO_EFF) || MB(RAMPS4DUE_EFF)
42
+#elif MB(RAMPS_13_EFF, RAMPS_14_EFF, RAMPS_PLUS_EFF, RAMPS_14_RE_ARM_EFF, RAMPS_SMART_EFF, RAMPS_DUO_EFF, RAMPS4DUE_EFF)
43
   #define IS_RAMPS_EFF
43
   #define IS_RAMPS_EFF
44
-#elif MB(RAMPS_13_EEF) || MB(RAMPS_14_EEF) || MB(RAMPS_PLUS_EEF) || MB(RAMPS_14_RE_ARM_EEF) || MB(RAMPS_SMART_EEF) || MB(RAMPS_DUO_EEF) || MB(RAMPS4DUE_EEF)
44
+#elif MB(RAMPS_13_EEF, RAMPS_14_EEF, RAMPS_PLUS_EEF, RAMPS_14_RE_ARM_EEF, RAMPS_SMART_EEF, RAMPS_DUO_EEF, RAMPS4DUE_EEF)
45
   #define IS_RAMPS_EEF
45
   #define IS_RAMPS_EEF
46
-#elif MB(RAMPS_13_SF)  || MB(RAMPS_14_SF)  || MB(RAMPS_PLUS_SF)  || MB(RAMPS_14_RE_ARM_SF)  || MB(RAMPS_SMART_SF)  || MB(RAMPS_DUO_SF)  || MB(RAMPS4DUE_SF)
46
+#elif MB(RAMPS_13_SF,  RAMPS_14_SF,  RAMPS_PLUS_SF,  RAMPS_14_RE_ARM_SF,  RAMPS_SMART_SF,  RAMPS_DUO_SF,  RAMPS4DUE_SF)
47
   #define IS_RAMPS_SF
47
   #define IS_RAMPS_SF
48
 #endif
48
 #endif
49
 
49
 
185
 
185
 
186
 #elif MB(RAMBO)
186
 #elif MB(RAMBO)
187
   #include "rambo/pins_RAMBO.h"                 // ATmega2560                             env:rambo
187
   #include "rambo/pins_RAMBO.h"                 // ATmega2560                             env:rambo
188
-#elif MB(MINIRAMBO) || MB(MINIRAMBO_10A)
188
+#elif MB(MINIRAMBO, MINIRAMBO_10A)
189
   #include "rambo/pins_MINIRAMBO.h"             // ATmega2560                             env:rambo
189
   #include "rambo/pins_MINIRAMBO.h"             // ATmega2560                             env:rambo
190
 #elif MB(EINSY_RAMBO)
190
 #elif MB(EINSY_RAMBO)
191
   #include "rambo/pins_EINSY_RAMBO.h"           // ATmega2560                             env:rambo
191
   #include "rambo/pins_EINSY_RAMBO.h"           // ATmega2560                             env:rambo
214
   #include "mega/pins_MEGATRONICS.h"            // ATmega2560                             env:megaatmega2560
214
   #include "mega/pins_MEGATRONICS.h"            // ATmega2560                             env:megaatmega2560
215
 #elif MB(MEGATRONICS_2)
215
 #elif MB(MEGATRONICS_2)
216
   #include "mega/pins_MEGATRONICS_2.h"          // ATmega2560                             env:megaatmega2560
216
   #include "mega/pins_MEGATRONICS_2.h"          // ATmega2560                             env:megaatmega2560
217
-#elif MB(MEGATRONICS_3) || MB(MEGATRONICS_31) || MB(MEGATRONICS_32)
217
+#elif MB(MEGATRONICS_3, MEGATRONICS_31, MEGATRONICS_32)
218
   #include "mega/pins_MEGATRONICS_3.h"          // ATmega2560                             env:megaatmega2560
218
   #include "mega/pins_MEGATRONICS_3.h"          // ATmega2560                             env:megaatmega2560
219
 #elif MB(ELEFU_3)
219
 #elif MB(ELEFU_3)
220
   #include "mega/pins_ELEFU_3.h"                // ATmega2560                             env:megaatmega2560
220
   #include "mega/pins_ELEFU_3.h"                // ATmega2560                             env:megaatmega2560

+ 0
- 1
Marlin/src/pins/sanguino/pins_MELZI.h Ver arquivo

29
   #define BOARD_INFO_NAME "Melzi"
29
   #define BOARD_INFO_NAME "Melzi"
30
 #endif
30
 #endif
31
 
31
 
32
-#define IS_MELZI
33
 #include "pins_SANGUINOLOLU_12.h"
32
 #include "pins_SANGUINOLOLU_12.h"

+ 5
- 5
Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h Ver arquivo

115
 
115
 
116
 #endif
116
 #endif
117
 
117
 
118
-#if !defined(FAN_PIN) && (MB(AZTEEG_X1) || MB(STB_11) || ENABLED(IS_MELZI))
118
+#if !defined(FAN_PIN) && (MB(AZTEEG_X1, STB_11) || IS_MELZI)
119
   #define FAN_PIN           4   // Works for Panelolu2 too
119
   #define FAN_PIN           4   // Works for Panelolu2 too
120
 #endif
120
 #endif
121
 
121
 
132
 //#define SDSS               24
132
 //#define SDSS               24
133
 #define SDSS               31
133
 #define SDSS               31
134
 
134
 
135
-#if ENABLED(IS_MELZI)
135
+#if IS_MELZI
136
   #define LED_PIN          27
136
   #define LED_PIN          27
137
 #elif MB(STB_11)
137
 #elif MB(STB_11)
138
   #define LCD_BACKLIGHT_PIN 17   // LCD backlight LED
138
   #define LCD_BACKLIGHT_PIN 17   // LCD backlight LED
160
 
160
 
161
     #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
161
     #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
162
 
162
 
163
-      #if ENABLED(IS_MELZI)
163
+      #if IS_MELZI
164
         #define LCD_PINS_RS     30   // CS chip select /SS chip slave select
164
         #define LCD_PINS_RS     30   // CS chip select /SS chip slave select
165
         #define LCD_PINS_ENABLE 29   // SID (MOSI)
165
         #define LCD_PINS_ENABLE 29   // SID (MOSI)
166
         #define LCD_PINS_D4     17   // SCK (CLK) clock
166
         #define LCD_PINS_D4     17   // SCK (CLK) clock
187
         #define DOGLCD_CS       17
187
         #define DOGLCD_CS       17
188
         #define LCD_BACKLIGHT_PIN 28   // PA3
188
         #define LCD_BACKLIGHT_PIN 28   // PA3
189
 
189
 
190
-      #elif ENABLED(IS_MELZI)
190
+      #elif IS_MELZI
191
 
191
 
192
         #define BEEPER_PIN      27
192
         #define BEEPER_PIN      27
193
         #define DOGLCD_CS       28
193
         #define DOGLCD_CS       28
219
 
219
 
220
   #if ENABLED(LCD_I2C_PANELOLU2)
220
   #if ENABLED(LCD_I2C_PANELOLU2)
221
 
221
 
222
-    #if ENABLED(IS_MELZI)
222
+    #if IS_MELZI
223
       #define BTN_ENC           29
223
       #define BTN_ENC           29
224
       #define LCD_SDSS          30   // Panelolu2 SD card reader rather than the Melzi
224
       #define LCD_SDSS          30   // Panelolu2 SD card reader rather than the Melzi
225
     #else
225
     #else

+ 3
- 3
buildroot/share/tests/STM32F103RC_bigtree_USB-tests Ver arquivo

1
 #!/usr/bin/env bash
1
 #!/usr/bin/env bash
2
 #
2
 #
3
-# Build tests for STM32F103RC Bigtreetech (SKR Mini v1.1)
3
+# Build tests for STM32F103RC Bigtreetech (SKR Mini E3)
4
 #
4
 #
5
 
5
 
6
 # exit on first failure
6
 # exit on first failure
10
 # Build with the default configurations
10
 # Build with the default configurations
11
 #
11
 #
12
 restore_configs
12
 restore_configs
13
-opt_set MOTHERBOARD BOARD_BIGTREE_SKR_MINI_V1_1
13
+opt_set MOTHERBOARD BOARD_BIGTREE_SKR_MINI_E3
14
 opt_set SERIAL_PORT 1
14
 opt_set SERIAL_PORT 1
15
 opt_set SERIAL_PORT_2 -1
15
 opt_set SERIAL_PORT_2 -1
16
-exec_test $1 $2 "Bigtreetech SKR Mini v1.1 - Basic Configuration"
16
+exec_test $1 $2 "Bigtreetech SKR Mini E3 - Basic Configuration"
17
 
17
 
18
 # clean up
18
 # clean up
19
 restore_configs
19
 restore_configs

Carregando…
Cancelar
Salvar