Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dummy thermistors for Bed, Chamber, and Probe #20247

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -1774,12 +1774,19 @@
#define HAS_TEMP_ADC_CHAMBER 1
#endif

#if HAS_HOTEND && ANY(HAS_TEMP_ADC_0, HEATER_0_USES_MAX6675, HEATER_0_DUMMY_THERMISTOR)
#define HAS_TEMP(N) ANY(HAS_TEMP_ADC_##N, HEATER_##N##_USES_MAX6675, HEATER_##N##_DUMMY_THERMISTOR)
#if HAS_HOTEND && HAS_TEMP(0)
#define HAS_TEMP_HOTEND 1
#endif
#define HAS_TEMP_BED HAS_TEMP_ADC_BED
#define HAS_TEMP_PROBE HAS_TEMP_ADC_PROBE
#define HAS_TEMP_CHAMBER HAS_TEMP_ADC_CHAMBER
#if HAS_TEMP(BED)
#define HAS_TEMP_BED 1
#endif
#if HAS_TEMP(PROBE)
#define HAS_TEMP_PROBE 1
#endif
#if HAS_TEMP(CHAMBER)
#define HAS_TEMP_CHAMBER 1
#endif

#if ENABLED(JOYSTICK)
#if PIN_EXISTS(JOY_X)
Expand Down
18 changes: 9 additions & 9 deletions Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1839,13 +1839,13 @@ void Temperature::init() {
#if HAS_JOY_ADC_EN
SET_INPUT_PULLUP(JOY_EN_PIN);
#endif
#if HAS_HEATED_BED
#if HAS_TEMP_ADC_BED
HAL_ANALOG_SELECT(TEMP_BED_PIN);
#endif
#if HAS_TEMP_CHAMBER
#if HAS_TEMP_ADC_CHAMBER
HAL_ANALOG_SELECT(TEMP_CHAMBER_PIN);
#endif
#if HAS_TEMP_PROBE
#if HAS_TEMP_ADC_PROBE
HAL_ANALOG_SELECT(TEMP_PROBE_PIN);
#endif
#if ENABLED(FILAMENT_WIDTH_SENSOR)
Expand Down Expand Up @@ -2355,9 +2355,9 @@ void Temperature::update_raw_temperatures() {
TERN_(HAS_TEMP_ADC_5, temp_hotend[5].update());
TERN_(HAS_TEMP_ADC_6, temp_hotend[6].update());
TERN_(HAS_TEMP_ADC_7, temp_hotend[7].update());
TERN_(HAS_HEATED_BED, temp_bed.update());
TERN_(HAS_TEMP_CHAMBER, temp_chamber.update());
TERN_(HAS_TEMP_PROBE, temp_probe.update());
TERN_(HAS_TEMP_ADC_BED, temp_bed.update());
TERN_(HAS_TEMP_ADC_CHAMBER, temp_chamber.update());
TERN_(HAS_TEMP_ADC_PROBE, temp_probe.update());

TERN_(HAS_JOY_ADC_X, joystick.x.update());
TERN_(HAS_JOY_ADC_Y, joystick.y.update());
Expand Down Expand Up @@ -2822,17 +2822,17 @@ void Temperature::tick() {
case MeasureTemp_0: ACCUMULATE_ADC(temp_hotend[0]); break;
#endif

#if HAS_HEATED_BED
#if HAS_TEMP_ADC_BED
case PrepareTemp_BED: HAL_START_ADC(TEMP_BED_PIN); break;
case MeasureTemp_BED: ACCUMULATE_ADC(temp_bed); break;
#endif

#if HAS_TEMP_CHAMBER
#if HAS_TEMP_ADC_CHAMBER
case PrepareTemp_CHAMBER: HAL_START_ADC(TEMP_CHAMBER_PIN); break;
case MeasureTemp_CHAMBER: ACCUMULATE_ADC(temp_chamber); break;
#endif

#if HAS_TEMP_PROBE
#if HAS_TEMP_ADC_PROBE
case PrepareTemp_PROBE: HAL_START_ADC(TEMP_PROBE_PIN); break;
case MeasureTemp_PROBE: ACCUMULATE_ADC(temp_probe); break;
#endif
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/module/temperature.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ enum ADCSensorState : char {
#if HAS_TEMP_ADC_0
PrepareTemp_0, MeasureTemp_0,
#endif
#if HAS_HEATED_BED
#if HAS_TEMP_ADC_BED
PrepareTemp_BED, MeasureTemp_BED,
#endif
#if HAS_TEMP_CHAMBER
#if HAS_TEMP_ADC_CHAMBER
PrepareTemp_CHAMBER, MeasureTemp_CHAMBER,
#endif
#if HAS_TEMP_PROBE
#if HAS_TEMP_ADC_PROBE
PrepareTemp_PROBE, MeasureTemp_PROBE,
#endif
#if HAS_TEMP_ADC_1
Expand Down