Skip to content

Commit 18b0dbb

Browse files
ellenspthinkyhead
andauthored
🐛 Creality Free Runs fixups (MarlinFirmware#26562)
Followup to MarlinFirmware#25636, MarlinFirmware#26533 Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
1 parent fa8d2bd commit 18b0dbb

10 files changed

+55
-76
lines changed

Marlin/src/inc/Changes.h

+2
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,8 @@
669669
#error "Z_PROBE_OFFSET_RANGE_(MIN|MAX) is now PROBE_OFFSET_Z(MIN|MAX)."
670670
#elif defined(LARGE_MOVE_ITEMS)
671671
#error "LARGE_MOVE_ITEMS is obsolete. Instead define MANUAL_MOVE_DISTANCE_MM and MANUAL_MOVE_DISTANCE_IN."
672+
#elif defined(SDIO_SUPPORT)
673+
#error "SDIO_SUPPORT is now ONBOARD_SDIO."
672674
#endif
673675

674676
// L64xx stepper drivers have been removed

Marlin/src/inc/Warnings.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -811,3 +811,10 @@
811811
#if HAL_ADC_VREF_MV < 5000 && ANY_THERMISTOR_IS(-1) && DISABLED(ALLOW_AD595_3V3_VREF)
812812
#warning "The (-1) AD595 Thermocouple Amplifier requires 5V input supply! Use AD8495 for 3.3V ADC."
813813
#endif
814+
815+
/**
816+
* No PWM on the Piezo Beeper?
817+
*/
818+
#if PIN_EXISTS(BEEPER) && ALL(SPEAKER, NO_SPEAKER)
819+
#warning "The BEEPER cannot produce tones so you can disable SPEAKER."
820+
#endif

Marlin/src/pins/mega/pins_GT2560_V3_A20.h

-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@
3333
#define LCD_PINS_D7 6
3434
#endif
3535

36-
#ifndef SPEAKER
37-
#define SPEAKER // The speaker can produce tones
38-
#endif
39-
4036
#if IS_NEWPANEL
4137
#define BTN_EN1 16
4238
#define BTN_EN2 17

Marlin/src/pins/mega/pins_GT2560_V4_A20.h

-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
#define LCD_PINS_D7 6
3636
#endif
3737

38-
#ifndef SPEAKER
39-
#define SPEAKER // The speaker can produce tones
40-
#endif
41-
4238
#if IS_NEWPANEL
4339
#define BTN_EN1 16
4440
#define BTN_EN2 17

Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228

229229
#ifndef BEEPER_PIN
230230
#define BEEPER_PIN EXP1_01_PIN
231-
#undef SPEAKER
231+
#define NO_SPEAKER
232232
#endif
233233

234234
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)

Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281

282282
#ifndef BEEPER_PIN
283283
#define BEEPER_PIN EXP1_01_PIN
284-
#undef SPEAKER
284+
#define NO_SPEAKER
285285
#endif
286286

287287
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)

Marlin/src/pins/stm32f4/pins_BLACKPILL_CUSTOM.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114

115115
#define SD_DETECT_PIN -1
116116
#define SDCARD_CONNECTION ONBOARD
117-
//#define SDIO_SUPPORT
117+
//#define ONBOARD_SDIO
118118
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer
119119

120120
#if SD_CONNECTION_IS(ONBOARD)

Marlin/src/pins/stm32f4/pins_CREALITY_CR4NTXXC10.h

+40-59
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@
100100
#define X_STEP_PIN PC2
101101
#define X_DIR_PIN PB9
102102

103-
#define Y_ENABLE_PIN X_ENABLE_PIN
103+
#define Y_ENABLE_PIN X_ENABLE_PIN
104104
#define Y_STEP_PIN PB8
105105
#define Y_DIR_PIN PB7
106106

107-
#define Z_ENABLE_PIN X_ENABLE_PIN
107+
#define Z_ENABLE_PIN X_ENABLE_PIN
108108
#define Z_STEP_PIN PB6
109109
#define Z_DIR_PIN PB5
110110

111-
#define E0_ENABLE_PIN X_ENABLE_PIN
111+
#define E0_ENABLE_PIN X_ENABLE_PIN
112112
#define E0_STEP_PIN PB4
113113
#define E0_DIR_PIN PB3
114114

@@ -188,74 +188,55 @@
188188
//
189189
#define SD_DETECT_PIN PC1
190190
#define SDCARD_CONNECTION ONBOARD
191-
#define ONBOARD_SPI_DEVICE 1
192-
//#define ONBOARD_SD_CS_PIN PA4 // SDSS
193-
#define SDIO_SUPPORT
191+
#define ONBOARD_SDIO
192+
#define SDIO_CLOCK 4500000
193+
#define SDIO_READ_RETRIES 16
194194
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer
195195

196-
#if ENABLED(CR10_STOCKDISPLAY)
197-
198-
#if ENABLED(RET6_12864_LCD)
199-
// RET6 12864 LCD
200-
#define LCD_PINS_RS PB12
201-
#define LCD_PINS_EN PB15
202-
#define LCD_PINS_D4 PB13
203-
204-
#define BTN_ENC PB2
205-
#define BTN_EN1 PA2
206-
#define BTN_EN2 PB14
196+
/**
197+
* ------
198+
* PC0 | 1 2 | PB2
199+
* TX2 PA2 | 3 4 | PA3 RX2
200+
* SPI2_MISO PB14 | 5 6 | PB13 SPI2_SCK
201+
* SPI2_NSS PB12 | 7 8 | PB15 SPI2_MOSI
202+
* GND | 9 10 | 5V
203+
* ------
204+
* EXP1
205+
*/
206+
#define EXP1_01_PIN PC0
207+
#define EXP1_02_PIN PB2
208+
#define EXP1_03_PIN PA2
209+
#define EXP1_04_PIN PA3
210+
#define EXP1_05_PIN PB14
211+
#define EXP1_06_PIN PB13
212+
#define EXP1_07_PIN PB12
213+
#define EXP1_08_PIN PB15
207214

208-
#ifndef HAS_PIN_27_BOARD
209-
#define BEEPER_PIN PC0
210-
#endif
215+
#if ENABLED(CR10_STOCKDISPLAY)
211216

212-
#elif ENABLED(VET6_12864_LCD)
213-
// VET6 12864 LCD
214-
#define LCD_PINS_RS PA4
215-
//#define LCD_PINS_EN PA7
216-
#define LCD_PINS_D4 PA5
217+
#define LCD_PINS_RS EXP1_07_PIN
218+
#define LCD_PINS_EN EXP1_08_PIN
219+
#define LCD_PINS_D4 EXP1_06_PIN
217220

218-
#define BTN_ENC PC5
219-
#define BTN_EN1 PB10
220-
#define BTN_EN2 PA6
221+
#define BTN_ENC EXP1_02_PIN
222+
#define BTN_EN1 EXP1_03_PIN
223+
#define BTN_EN2 EXP1_05_PIN
221224

222-
#else
223-
#error "Define RET6_12864_LCD or VET6_12864_LCD to select pins for CR10_STOCKDISPLAY with the CREALITY_CR4NTXXC10 controller."
225+
#ifndef HAS_PIN_27_BOARD
226+
#define BEEPER_PIN EXP1_01_PIN
224227
#endif
225228

226229
#elif ENABLED(DWIN_CREALITY_LCD)
227230

228-
// RET6 DWIN ENCODER LCD
229-
#define BTN_ENC PB14
230-
#define BTN_EN1 PB15
231-
#define BTN_EN2 PB12
231+
// DWIN ENCODER LCD
232+
#define BTN_ENC EXP1_05_PIN
233+
#define BTN_EN1 EXP1_08_PIN
234+
#define BTN_EN2 EXP1_07_PIN
232235

233-
//#define LCD_LED_PIN PB2
236+
//#define LCD_LED_PIN EXP1_02_PIN
234237
#ifndef BEEPER_PIN
235-
#define BEEPER_PIN PB13
236-
#undef SPEAKER
238+
#define BEEPER_PIN EXP1_06_PIN
239+
#define NO_SPEAKER
237240
#endif
238241

239-
#elif ENABLED(DWIN_VET6_CREALITY_LCD)
240-
241-
// VET6 DWIN ENCODER LCD
242-
#define BTN_ENC PA6
243-
//#define BTN_EN1 PA7
244-
#define BTN_EN2 PA4
245-
246-
#define BEEPER_PIN PA5
247-
248-
#endif
249-
250-
//
251-
// M3/M4/M5 - Spindle/Laser Control
252-
//
253-
#if HAS_CUTTER
254-
//#undef HEATER_0_PIN
255-
//#undef HEATER_BED_PIN
256-
//#undef FAN0_PIN
257-
#define SPINDLE_LASER_ENA_PIN PC0 // FET 1
258-
#define SPINDLE_LASER_PWM_PIN PC0 // Bed FET
259-
#define SPINDLE_DIR_PIN PC0 // FET 4
260-
//#define LASER_SOFT_PWM_PIN PC0
261242
#endif

Marlin/src/pins/stm32f4/pins_CREALITY_F401.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
#define SDCARD_CONNECTION ONBOARD
126126
#define ONBOARD_SPI_DEVICE 1
127127
#define ONBOARD_SD_CS_PIN PC12 // SDSS
128-
#define SDIO_SUPPORT
128+
#define ONBOARD_SDIO
129129
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer
130130

131131
// SPI 2

ini/stm32f4.ini

+2-5
Original file line numberDiff line numberDiff line change
@@ -742,17 +742,14 @@ upload_protocol = stlink
742742
#
743743
[env:STM32F401RE_freeruns]
744744
extends = stm32_variant
745-
board = genericSTM32F401RE
746-
board_build.variant = marlin_STM32F401RE_freeruns
745+
board = marlin_STM32F401RE_freeruns
747746
board_build.offset = 0x10000
748747
board_upload.offset_address = 0x08010000
749748
board_build.rename = firmware-{date}-{time}.bin
750-
build_flags = ${stm32_variant.build_flags} -DMCU_STM32F401RE -DSTM32F4
749+
build_flags = ${stm32_variant.build_flags} -DSTM32F401xE
751750
-DSS_TIMER=4 -DTIMER_SERVO=TIM5
752751
-DTRANSFER_CLOCK_DIV=8
753752
build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC
754-
extra_scripts = ${stm32_variant.extra_scripts}
755-
pre:buildroot/share/PlatformIO/scripts/random-bin.py
756753
monitor_speed = 115200
757754

758755
[env:STM32F401RE_freeruns_jlink]

0 commit comments

Comments
 (0)