|
|
|
@ -64,10 +64,10 @@ int Temperature::current_temperature_raw[HOTENDS] = { 0 },
|
|
|
|
|
float Temperature::redundant_temperature = 0.0;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
unsigned char Temperature::soft_pwm_bed;
|
|
|
|
|
uint8_t Temperature::soft_pwm_bed;
|
|
|
|
|
|
|
|
|
|
#if ENABLED(FAN_SOFT_PWM)
|
|
|
|
|
unsigned char Temperature::fanSpeedSoftPwm[FAN_COUNT];
|
|
|
|
|
uint8_t Temperature::fanSpeedSoftPwm[FAN_COUNT];
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if ENABLED(PIDTEMP)
|
|
|
|
@ -188,10 +188,10 @@ int Temperature::minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_LO_TEMP ,
|
|
|
|
|
millis_t Temperature::next_auto_fan_check_ms = 0;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
unsigned char Temperature::soft_pwm[HOTENDS];
|
|
|
|
|
uint8_t Temperature::soft_pwm[HOTENDS];
|
|
|
|
|
|
|
|
|
|
#if ENABLED(FAN_SOFT_PWM)
|
|
|
|
|
unsigned char Temperature::soft_pwm_fan[FAN_COUNT];
|
|
|
|
|
uint8_t Temperature::soft_pwm_fan[FAN_COUNT];
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if ENABLED(FILAMENT_WIDTH_SENSOR)
|
|
|
|
@ -482,7 +482,7 @@ int Temperature::getHeaterPower(int heater) {
|
|
|
|
|
for (uint8_t f = 0; f < COUNT(fanPin); f++) {
|
|
|
|
|
int8_t pin = fanPin[f];
|
|
|
|
|
if (pin >= 0 && !TEST(fanDone, fanBit[f])) {
|
|
|
|
|
unsigned char newFanSpeed = TEST(fanState, fanBit[f]) ? EXTRUDER_AUTO_FAN_SPEED : 0;
|
|
|
|
|
uint8_t newFanSpeed = TEST(fanState, fanBit[f]) ? EXTRUDER_AUTO_FAN_SPEED : 0;
|
|
|
|
|
// this idiom allows both digital and PWM fan outputs (see M42 handling).
|
|
|
|
|
digitalWrite(pin, newFanSpeed);
|
|
|
|
|
analogWrite(pin, newFanSpeed);
|
|
|
|
@ -1414,19 +1414,19 @@ ISR(TIMER0_COMPB_vect) { Temperature::isr(); }
|
|
|
|
|
|
|
|
|
|
void Temperature::isr() {
|
|
|
|
|
|
|
|
|
|
static unsigned char temp_count = 0;
|
|
|
|
|
static uint8_t temp_count = 0;
|
|
|
|
|
static TempState temp_state = StartupDelay;
|
|
|
|
|
static unsigned char pwm_count = _BV(SOFT_PWM_SCALE);
|
|
|
|
|
static uint8_t pwm_count = _BV(SOFT_PWM_SCALE);
|
|
|
|
|
|
|
|
|
|
// Static members for each heater
|
|
|
|
|
#if ENABLED(SLOW_PWM_HEATERS)
|
|
|
|
|
static unsigned char slow_pwm_count = 0;
|
|
|
|
|
static uint8_t slow_pwm_count = 0;
|
|
|
|
|
#define ISR_STATICS(n) \
|
|
|
|
|
static unsigned char soft_pwm_ ## n; \
|
|
|
|
|
static unsigned char state_heater_ ## n = 0; \
|
|
|
|
|
static unsigned char state_timer_heater_ ## n = 0
|
|
|
|
|
static uint8_t soft_pwm_ ## n; \
|
|
|
|
|
static uint8_t state_heater_ ## n = 0; \
|
|
|
|
|
static uint8_t state_timer_heater_ ## n = 0
|
|
|
|
|
#else
|
|
|
|
|
#define ISR_STATICS(n) static unsigned char soft_pwm_ ## n
|
|
|
|
|
#define ISR_STATICS(n) static uint8_t soft_pwm_ ## n
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// Statics per heater
|
|
|
|
|