Fix dummy thermistors for Bed, Chamber, Probe (#20247)

This commit is contained in:
Jason Smith 2020-11-22 16:47:52 -08:00 committed by GitHub
parent 6f272e13c5
commit 58eaad703a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 16 deletions

View File

@ -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)

View File

@ -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)
@ -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());
@ -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

View File

@ -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