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

allow Thermocouple on bed only #27504

Merged

Conversation

ellensp
Copy link
Contributor

@ellensp ellensp commented Oct 30, 2024

Description

User wanted just 1 Thermocouple on the bed
ie #define TEMP_SENSOR_BED -3

This results in a error

Marlin/src/module/temperature.cpp: In static member function 'static raw_adc_t Temperature::read_max_tc()':
Marlin/src/module/temperature.cpp:3531:7: error: 'TEMP_SENSOR_0_MAX_TC_TMAX' was not declared in this scope
       TEMP_SENSOR_0_MAX_TC_TMAX,

several small issue where found.

The tests to set HAS_MAX_TC, HAS_MAX6675, HAS_MAX31855 and HAS_MAX31865 where called to soon, before TEMP_SENSOR_BED_IS_MAX6675, TEMP_SENSOR_BED_IS_MAX31855 and TEMP_SENSOR_BED_IS_MAX31865 where set,
So this code was moved down a little so they get set correctly

A block of code for Thermocouple on hotends was not correctly guarded.
Used #if HAS_MAX_TC , but that includes beds with a thermocouple

updated to use #if TEMP_SENSOR_IS_MAX_TC(0) || TEMP_SENSOR_IS_MAX_TC(1) || TEMP_SENSOR_IS_MAX_TC(2)

Also removed a compiler warning due to TEMP_SENSOR_BED_MAX_TC_TMAX being presumed to be a int vs a max_tc_temp_t

Requirements

#define TEMP_SENSOR_BED -3

Benefits

Builds as expected

@thinkyhead thinkyhead merged commit d2fab91 into MarlinFirmware:bugfix-2.1.x Nov 3, 2024
64 checks passed
@ellensp ellensp deleted the Thermocouple-for-bed-only branch November 3, 2024 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants