From 7eea000f4bf770b94614cc333478f1f1a97faa2e Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Thu, 16 Nov 2017 18:10:54 -0600 Subject: [PATCH] E0 auto fan fixes --- Marlin/src/module/temperature.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 0f3e4114d4..80e3a4447f 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -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;