Skip to content

Commit

Permalink
🚸 Set hybrid edit range to 999 (MarlinFirmware#27473)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <[email protected]>
  • Loading branch information
2 people authored and bsdnomad committed Nov 24, 2024
1 parent 7e2c645 commit dc1174c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions Marlin/src/core/drivers.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,16 @@
|| HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE)
#define HAS_DIAG_PINS 1
#endif

// Hybrid Threshold ranges
#define THRS_TMC2100 65535
#define THRS_TMC2130 65535
#define THRS_TMC2160 255
#define THRS_TMC2208 255
#define THRS_TMC2209 255
#define THRS_TMC2660 65535
#define THRS_TMC5130 65535
#define THRS_TMC5160 65535

#define _DRIVER_THRS(V) CAT(THRS_, V)
#define STEPPER_MAX_THRS(S) _DRIVER_THRS(S##_DRIVER_TYPE)
4 changes: 2 additions & 2 deletions Marlin/src/feature/tmc_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class TMCStorage {

struct {
OPTCODE(HAS_STEALTHCHOP, bool stealthChop_enabled = false)
OPTCODE(HYBRID_THRESHOLD, uint8_t hybrid_thrs = 0)
OPTCODE(USE_SENSORLESS, int16_t homing_thrs = 0)
OPTCODE(HYBRID_THRESHOLD, uint16_t hybrid_thrs = 0)
OPTCODE(USE_SENSORLESS, int16_t homing_thrs = 0)
} stored;
};

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_tmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void menu_tmc_current() {

#if ENABLED(HYBRID_THRESHOLD)

#define TMC_EDIT_STORED_HYBRID_THRS(ST, STR) EDIT_ITEM_F(uint8, F(STR), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); });
#define TMC_EDIT_STORED_HYBRID_THRS(ST, STR) EDIT_ITEM_F(uint16_3, F(STR), &stepper##ST.stored.hybrid_thrs, 0, STEPPER_MAX_THRS(ST), []{ stepper##ST.refresh_hybrid_thrs(); });

void menu_tmc_hybrid_thrs() {
START_MENU();
Expand Down

0 comments on commit dc1174c

Please sign in to comment.