Skip to content
This repository was archived by the owner on Jul 9, 2020. It is now read-only.

Commit 4d49f85

Browse files
committed
Fixes for M3/M5 in laser mode (2.05RC2)
1 parent 49e50cf commit 4d49f85

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

src/GCodes/GCodeQueue.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,19 @@ GCodeQueue::GCodeQueue() : freeItems(nullptr), queuedItems(nullptr)
4141
case 'G':
4242
{
4343
const int code = gb.GetCommandNumber();
44-
return code == 10 && gb.Seen('P'); // Set active/standby temperatures
44+
return code == 10 && gb.Seen('P') && !gb.Seen('L') && (gb.Seen('R') || gb.Seen('S')); // set active/standby temperatures
4545
}
4646

4747
case 'M':
4848
{
4949
switch (gb.GetCommandNumber())
5050
{
51-
case 3: // spindle control
51+
case 3: // spindle or laser control
52+
case 5: // spindle or laser control
53+
// On laser devices we use these codes to set the default laser power for the next G1 command
54+
return reprap.GetGCodes().GetMachineType() != MachineType::laser;
55+
5256
case 4: // spindle control
53-
case 5: // spindle control
5457
case 42: // set IO pin
5558
case 106: // fan control
5659
case 107: // fan off

src/GCodes/GCodes2.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -430,15 +430,11 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply)
430430
}
431431
break;
432432

433-
case MachineType::laser:
434-
{
435-
const Pwm_t laserPwm = ConvertLaserPwm(gb.GetFValue());
436-
platform.SetLaserPwm(laserPwm);
437433
#if SUPPORT_LASER
438-
moveBuffer.laserPwmOrIoBits.laserPwm = laserPwm;
439-
#endif
440-
}
434+
case MachineType::laser:
435+
moveBuffer.laserPwmOrIoBits.laserPwm = ConvertLaserPwm(gb.GetFValue());
441436
break;
437+
#endif
442438

443439
default:
444440
#if SUPPORT_ROLAND
@@ -508,12 +504,11 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply)
508504
}
509505
break;
510506

511-
case MachineType::laser:
512-
platform.SetLaserPwm(0);
513507
#if SUPPORT_LASER
508+
case MachineType::laser:
514509
moveBuffer.laserPwmOrIoBits.Clear();
515-
#endif
516510
break;
511+
#endif
517512

518513
default:
519514
#if SUPPORT_ROLAND

src/Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#endif
2121

2222
#ifndef DATE
23-
# define DATE "2019-12-05b1"
23+
# define DATE "2019-12-08b1"
2424
#endif
2525

2626
#define AUTHORS "reprappro, dc42, chrishamm, t3p3, dnewman, printm3d"

0 commit comments

Comments
 (0)