E0 auto fan fixes

This commit is contained in:
Bob-the-Kuhn 2017-11-16 18:10:54 -06:00
parent a7ff4f5799
commit 7eea000f4b

View File

@ -515,7 +515,7 @@ int Temperature::getHeaterPower(int heater) {
#if HAS_AUTO_FAN
void Temperature::checkExtruderAutoFans() {
static const int8_t fanPin[] PROGMEM = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN, E4_AUTO_FAN_PIN };
static const pin_t fanPin[] PROGMEM = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN, E4_AUTO_FAN_PIN };
static const uint8_t fanBit[] PROGMEM = {
0,
AUTO_1_IS_0 ? 0 : 1,
@ -531,7 +531,11 @@ int Temperature::getHeaterPower(int heater) {
uint8_t fanDone = 0;
for (uint8_t f = 0; f < COUNT(fanPin); f++) {
int8_t pin = pgm_read_byte(&fanPin[f]);
#ifdef ARDUINO
pin_t pin = pgm_read_byte(&fanPin[f]);
#else
pin_t pin = fanPin[f];
#endif
const uint8_t bit = pgm_read_byte(&fanBit[f]);
if (pin >= 0 && !TEST(fanDone, bit)) {
uint8_t newFanSpeed = TEST(fanState, bit) ? EXTRUDER_AUTO_FAN_SPEED : 0;