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

Fix M106 extruder & fan count (#12820)

This commit is contained in:
Luu Lac 2019-01-05 14:01:35 -06:00 committed by Scott Lahteine
parent ba7e35cbab
commit bcf347403b

View File

@ -47,7 +47,7 @@
* 3-255 = Set the speed for use with T2
*/
void GcodeSuite::M106() {
const uint8_t p = parser.byteval('P', active_extruder);
const uint8_t p = parser.byteval('P', MIN(active_extruder, FAN_COUNT - 1));
if (p < MIN(EXTRUDERS, FAN_COUNT)) {
uint16_t s = parser.ushortval('S', 255);