Browse Source

Fix M106 extruder & fan count (#12820)

Luu Lac 6 years ago
parent
commit
bcf347403b
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      Marlin/src/gcode/temperature/M106_M107.cpp

+ 1
- 1
Marlin/src/gcode/temperature/M106_M107.cpp View File

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

Loading…
Cancel
Save