Clean up and use simplified conditionals

This commit is contained in:
Scott Lahteine 2020-11-09 00:27:45 -06:00
parent 2a0300097d
commit c47ca8db10
2 changed files with 6 additions and 7 deletions

View file

@ -1814,11 +1814,10 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
#endif
#if MAX6675_IS_MAX31865 && (!defined(MAX31865_SENSOR_OHMS_0) || !defined(MAX31865_CALIBRATION_OHMS_0))
#if MAX6675_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_0) && defined(MAX31865_CALIBRATION_OHMS_0))
#error "MAX31865_SENSOR_OHMS_0 and MAX31865_CALIBRATION_OHMS_0 must be set in Configuration.h when using a MAX31865 temperature sensor on TEMP_SENSOR_0."
#endif
#if MAX6675_IS_MAX31865 && (!defined(MAX31865_SENSOR_OHMS_1) || !defined(MAX31865_CALIBRATION_OHMS_1)) && TEMP_SENSOR_1 == -5
#if MAX6675_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_1) && defined(MAX31865_CALIBRATION_OHMS_1)) && TEMP_SENSOR_1 == -5
#error "MAX31865_SENSOR_OHMS_1 and MAX31865_CALIBRATION_OHMS_1 must be set in Configuration.h when using a MAX31865 temperature sensor on TEMP_SENSOR_1."
#endif

View file

@ -2247,7 +2247,7 @@ void Temperature::disable_all_heaters() {
#define MAX6675_ERROR_MASK 7
#define MAX6675_DISCARD_BITS 18
#define MAX6675_SPEED_BITS 3 // (_BV(SPR1)) // clock ÷ 64
#elif ENABLED(MAX6675_IS_MAX31865)
#elif MAX6675_IS_MAX31865
static uint16_t max6675_temp = 2000; //from datasheet 16 bits D15-D0
#define MAX6675_ERROR_MASK 1 //D0 Bit not used
#define MAX6675_DISCARD_BITS 1 //data is in D15-D1
@ -2325,9 +2325,9 @@ void Temperature::disable_all_heaters() {
WRITE_MAX6675(HIGH); // disable TT_MAX6675
uint8_t fault = 1;
#if (COUNT_6675 == 1 && ENABLED(MAX6675_IS_MAX31865))
#if COUNT_6675 == 1 && MAX6675_IS_MAX31865
fault = max31865_0.readFault();
#elif ENABLED(MAX6675_IS_MAX31865)
#elif MAX6675_IS_MAX31865
#if hindex == 0
fault = max31865_0.readFault();
#elif hindex == 1
@ -2335,7 +2335,7 @@ void Temperature::disable_all_heaters() {
#endif
#endif
if (DISABLED(IGNORE_THERMOCOUPLE_ERRORS) && (max6675_temp & MAX6675_ERROR_MASK) && fault) {
if (DISABLED(IGNORE_THERMOCOUPLE_ERRORS) && (max6675_temp & MAX6675_ERROR_MASK) && fault) {
max6675_errors[hindex] += 1;
if (max6675_errors[hindex] > THERMOCOUPLE_MAX_ERRORS) {
SERIAL_ERROR_START();