Skip to content

Commit

Permalink
🐛 Creality Free Runs fixups (MarlinFirmware#26562)
Browse files Browse the repository at this point in the history
Followup to MarlinFirmware#25636, MarlinFirmware#26533

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
  • Loading branch information
2 people authored and classicrocker883 committed Dec 26, 2023
1 parent 0606521 commit 7503d4f
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 76 deletions.
2 changes: 2 additions & 0 deletions Marlin/src/inc/Changes.h
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,8 @@
#error "Z_PROBE_OFFSET_RANGE_(MIN|MAX) is now PROBE_OFFSET_Z(MIN|MAX)."
#elif defined(LARGE_MOVE_ITEMS)
#error "LARGE_MOVE_ITEMS is obsolete. Instead define MANUAL_MOVE_DISTANCE_MM and MANUAL_MOVE_DISTANCE_IN."
#elif defined(SDIO_SUPPORT)
#error "SDIO_SUPPORT is now ONBOARD_SDIO."
#endif

// L64xx stepper drivers have been removed
Expand Down
7 changes: 7 additions & 0 deletions Marlin/src/inc/Warnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,3 +811,10 @@
#if HAL_ADC_VREF_MV < 5000 && ANY_THERMISTOR_IS(-1) && DISABLED(ALLOW_AD595_3V3_VREF)
#warning "The (-1) AD595 Thermocouple Amplifier requires 5V input supply! Use AD8495 for 3.3V ADC."
#endif

/**
* No PWM on the Piezo Beeper?
*/
#if PIN_EXISTS(BEEPER) && ALL(SPEAKER, NO_SPEAKER)
#warning "The BEEPER cannot produce tones so you can disable SPEAKER."
#endif
4 changes: 0 additions & 4 deletions Marlin/src/pins/mega/pins_GT2560_V3_A20.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
#define LCD_PINS_D7 6
#endif

#ifndef SPEAKER
#define SPEAKER // The speaker can produce tones
#endif

#if IS_NEWPANEL
#define BTN_EN1 16
#define BTN_EN2 17
Expand Down
4 changes: 0 additions & 4 deletions Marlin/src/pins/mega/pins_GT2560_V4_A20.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
#define LCD_PINS_D7 6
#endif

#ifndef SPEAKER
#define SPEAKER // The speaker can produce tones
#endif

#if IS_NEWPANEL
#define BTN_EN1 16
#define BTN_EN2 17
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@

#ifndef BEEPER_PIN
#define BEEPER_PIN EXP1_01_PIN
#undef SPEAKER
#define NO_SPEAKER
#endif

#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@

#ifndef BEEPER_PIN
#define BEEPER_PIN EXP1_01_PIN
#undef SPEAKER
#define NO_SPEAKER
#endif

#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f4/pins_BLACKPILL_CUSTOM.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

#define SD_DETECT_PIN -1
#define SDCARD_CONNECTION ONBOARD
//#define SDIO_SUPPORT
//#define ONBOARD_SDIO
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer

#if SD_CONNECTION_IS(ONBOARD)
Expand Down
99 changes: 40 additions & 59 deletions Marlin/src/pins/stm32f4/pins_CREALITY_CR4NTXXC10.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@
#define X_STEP_PIN PC2
#define X_DIR_PIN PB9

#define Y_ENABLE_PIN X_ENABLE_PIN
#define Y_ENABLE_PIN X_ENABLE_PIN
#define Y_STEP_PIN PB8
#define Y_DIR_PIN PB7

#define Z_ENABLE_PIN X_ENABLE_PIN
#define Z_ENABLE_PIN X_ENABLE_PIN
#define Z_STEP_PIN PB6
#define Z_DIR_PIN PB5

#define E0_ENABLE_PIN X_ENABLE_PIN
#define E0_ENABLE_PIN X_ENABLE_PIN
#define E0_STEP_PIN PB4
#define E0_DIR_PIN PB3

Expand Down Expand Up @@ -188,74 +188,55 @@
//
#define SD_DETECT_PIN PC1
#define SDCARD_CONNECTION ONBOARD
#define ONBOARD_SPI_DEVICE 1
//#define ONBOARD_SD_CS_PIN PA4 // SDSS
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define SDIO_CLOCK 4500000
#define SDIO_READ_RETRIES 16
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer

#if ENABLED(CR10_STOCKDISPLAY)

#if ENABLED(RET6_12864_LCD)
// RET6 12864 LCD
#define LCD_PINS_RS PB12
#define LCD_PINS_EN PB15
#define LCD_PINS_D4 PB13

#define BTN_ENC PB2
#define BTN_EN1 PA2
#define BTN_EN2 PB14
/**
* ------
* PC0 | 1 2 | PB2
* TX2 PA2 | 3 4 | PA3 RX2
* SPI2_MISO PB14 | 5 6 | PB13 SPI2_SCK
* SPI2_NSS PB12 | 7 8 | PB15 SPI2_MOSI
* GND | 9 10 | 5V
* ------
* EXP1
*/
#define EXP1_01_PIN PC0
#define EXP1_02_PIN PB2
#define EXP1_03_PIN PA2
#define EXP1_04_PIN PA3
#define EXP1_05_PIN PB14
#define EXP1_06_PIN PB13
#define EXP1_07_PIN PB12
#define EXP1_08_PIN PB15

#ifndef HAS_PIN_27_BOARD
#define BEEPER_PIN PC0
#endif
#if ENABLED(CR10_STOCKDISPLAY)

#elif ENABLED(VET6_12864_LCD)
// VET6 12864 LCD
#define LCD_PINS_RS PA4
//#define LCD_PINS_EN PA7
#define LCD_PINS_D4 PA5
#define LCD_PINS_RS EXP1_07_PIN
#define LCD_PINS_EN EXP1_08_PIN
#define LCD_PINS_D4 EXP1_06_PIN

#define BTN_ENC PC5
#define BTN_EN1 PB10
#define BTN_EN2 PA6
#define BTN_ENC EXP1_02_PIN
#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_05_PIN

#else
#error "Define RET6_12864_LCD or VET6_12864_LCD to select pins for CR10_STOCKDISPLAY with the CREALITY_CR4NTXXC10 controller."
#ifndef HAS_PIN_27_BOARD
#define BEEPER_PIN EXP1_01_PIN
#endif

#elif ENABLED(DWIN_CREALITY_LCD)

// RET6 DWIN ENCODER LCD
#define BTN_ENC PB14
#define BTN_EN1 PB15
#define BTN_EN2 PB12
// DWIN ENCODER LCD
#define BTN_ENC EXP1_05_PIN
#define BTN_EN1 EXP1_08_PIN
#define BTN_EN2 EXP1_07_PIN

//#define LCD_LED_PIN PB2
//#define LCD_LED_PIN EXP1_02_PIN
#ifndef BEEPER_PIN
#define BEEPER_PIN PB13
#undef SPEAKER
#define BEEPER_PIN EXP1_06_PIN
#define NO_SPEAKER
#endif

#elif ENABLED(DWIN_VET6_CREALITY_LCD)

// VET6 DWIN ENCODER LCD
#define BTN_ENC PA6
//#define BTN_EN1 PA7
#define BTN_EN2 PA4

#define BEEPER_PIN PA5

#endif

//
// M3/M4/M5 - Spindle/Laser Control
//
#if HAS_CUTTER
//#undef HEATER_0_PIN
//#undef HEATER_BED_PIN
//#undef FAN0_PIN
#define SPINDLE_LASER_ENA_PIN PC0 // FET 1
#define SPINDLE_LASER_PWM_PIN PC0 // Bed FET
#define SPINDLE_DIR_PIN PC0 // FET 4
//#define LASER_SOFT_PWM_PIN PC0
#endif
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f4/pins_CREALITY_F401.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
#define SDCARD_CONNECTION ONBOARD
#define ONBOARD_SPI_DEVICE 1
#define ONBOARD_SD_CS_PIN PC12 // SDSS
#define SDIO_SUPPORT
#define ONBOARD_SDIO
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer

// SPI 2
Expand Down
7 changes: 2 additions & 5 deletions ini/stm32f4.ini
Original file line number Diff line number Diff line change
Expand Up @@ -742,17 +742,14 @@ upload_protocol = stlink
#
[env:STM32F401RE_freeruns]
extends = stm32_variant
board = genericSTM32F401RE
board_build.variant = marlin_STM32F401RE_freeruns
board = marlin_STM32F401RE_freeruns
board_build.offset = 0x10000
board_upload.offset_address = 0x08010000
board_build.rename = firmware-{date}-{time}.bin
build_flags = ${stm32_variant.build_flags} -DMCU_STM32F401RE -DSTM32F4
build_flags = ${stm32_variant.build_flags} -DSTM32F401xE
-DSS_TIMER=4 -DTIMER_SERVO=TIM5
-DTRANSFER_CLOCK_DIV=8
build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC
extra_scripts = ${stm32_variant.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/random-bin.py
monitor_speed = 115200

[env:STM32F401RE_freeruns_jlink]
Expand Down

0 comments on commit 7503d4f

Please sign in to comment.