1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 05:48:43 +00:00

Fix M107 when dual-nozzles share fan (#12819) (#12909)

This commit is contained in:
Marcio Teixeira 2019-01-15 17:45:18 -07:00 committed by Scott Lahteine
parent 64a4649290
commit f11c6d5d02

View File

@ -63,7 +63,8 @@ void GcodeSuite::M106() {
* M107: Fan Off
*/
void GcodeSuite::M107() {
thermalManager.set_fan_speed(parser.byteval('P', active_extruder), 0);
const uint8_t p = parser.byteval('P', MIN(active_extruder, FAN_COUNT - 1));
thermalManager.set_fan_speed(p, 0);
}
#endif // FAN_COUNT > 0