Fix non-PWM spindle/laser compile (#18311)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Co-authored-by: Luu Lac <45380455+shitcreek@users.noreply.github.com>
This commit is contained in:
InsanityAutomation
2020-06-16 16:49:32 -04:00
committed by GitHub
parent 0b30de1b8e
commit 23806aeb3c
4 changed files with 21 additions and 11 deletions

View File

@@ -179,8 +179,10 @@ void GcodeSuite::get_destination_from_command() {
#if ENABLED(LASER_MOVE_POWER)
// Set the laser power in the planner to configure this move
if (parser.seen('S'))
cutter.inline_power(cutter.power_to_range(cutter_power_t(round(parser.value_float()))));
if (parser.seen('S')) {
const float spwr = parser.value_float();
cutter.inline_power(TERN(SPINDLE_LASER_PWM, cutter.power_to_range(cutter_power_t(round(spwr))), spwr > 0 ? 255 : 0));
}
else if (ENABLED(LASER_MOVE_G0_OFF) && parser.codenum == 0) // G0
cutter.set_inline_enabled(false);
#endif