@ -32,12 +32,39 @@
|
||||
*
|
||||
* S<int> Speed between 0-255
|
||||
* P<index> Fan index, if more than one fan
|
||||
*
|
||||
* With EXTRA_FAN_SPEED enabled:
|
||||
*
|
||||
* T<int> Restore/Use/Set Temporary Speed:
|
||||
* 1 = Restore previous speed after T2
|
||||
* 2 = Use temporary speed set with T3-255
|
||||
* 3-255 = Set the speed for use with T2
|
||||
*/
|
||||
void GcodeSuite::M106() {
|
||||
uint16_t s = parser.ushortval('S', 255);
|
||||
NOMORE(s, 255);
|
||||
const uint8_t p = parser.byteval('P', 0);
|
||||
if (p < FAN_COUNT) fanSpeeds[p] = s;
|
||||
const uint8_t p = parser.byteval('P');
|
||||
if (p < FAN_COUNT) {
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
const int16_t t = parser.intval('T');
|
||||
NOMORE(t, 255);
|
||||
if (t > 0) {
|
||||
switch (t) {
|
||||
case 1:
|
||||
fanSpeeds[p] = old_fanSpeeds[p];
|
||||
break;
|
||||
case 2:
|
||||
old_fanSpeeds[p] = fanSpeeds[p];
|
||||
fanSpeeds[p] = new_fanSpeeds[p];
|
||||
break;
|
||||
default:
|
||||
new_fanSpeeds[p] = t;
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif // EXTRA_FAN_SPEED
|
||||
const uint16_t s = parser.ushortval('S', 255);
|
||||
fanSpeeds[p] = min(s, 255);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user