Smarter MIN, MAX, ABS macros
Use macros that explicitly avoid double-evaluation and can be used for any datatype, replacing `min`, `max`, `abs`, `fabs`, `labs`, and `FABS`. Co-Authored-By: ejtagle <ejtagle@hotmail.com>
This commit is contained in:
@@ -55,14 +55,14 @@ void GcodeSuite::M106() {
|
||||
fanSpeeds[p] = new_fanSpeeds[p];
|
||||
break;
|
||||
default:
|
||||
new_fanSpeeds[p] = min(t, 255);
|
||||
new_fanSpeeds[p] = MIN(t, 255);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif // EXTRA_FAN_SPEED
|
||||
const uint16_t s = parser.ushortval('S', 255);
|
||||
fanSpeeds[p] = min(s, 255);
|
||||
fanSpeeds[p] = MIN(s, 255U);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user