Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
80359c99
Commit
80359c99
authored
6 years ago
by
Scott Lahteine
Browse files
Options
Downloads
Patches
Plain Diff
Add more parameters to M240
Co-Authored-By:
shitcreek
<
45380455+shitcreek@users.noreply.github.com
>
parent
a43e892f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/src/gcode/feature/camera/M240.cpp
+13
-3
13 additions, 3 deletions
Marlin/src/gcode/feature/camera/M240.cpp
with
13 additions
and
3 deletions
Marlin/src/gcode/feature/camera/M240.cpp
+
13
−
3
View file @
80359c99
...
...
@@ -76,6 +76,9 @@
* configured position, delay, and retract length.
*
* PHOTO_POSITION parameters:
* A - X offset to the return position
* B - Y offset to the return position
* F - Override the XY movement feedrate
* R - Retract/recover length (current units)
* S - Retract/recover feedrate (mm/m)
* X - Move to X before triggering the shutter
...
...
@@ -94,7 +97,11 @@ void GcodeSuite::M240() {
if
(
axis_unhomed_error
())
return
;
const
float
old_pos
[
XYZ
]
=
{
current_position
[
X_AXIS
],
current_position
[
Y_AXIS
],
current_position
[
Z_AXIS
]
};
const
float
old_pos
[
XYZ
]
=
{
current_position
[
X_AXIS
]
+
parser
.
linearval
(
'A'
),
current_position
[
Y_AXIS
]
+
parser
.
linearval
(
'B'
),
current_position
[
Z_AXIS
]
};
#ifdef PHOTO_RETRACT_MM
constexpr
float
rfr
=
(
MMS_TO_MMM
(
...
...
@@ -111,6 +118,9 @@ void GcodeSuite::M240() {
e_move_m240
(
-
rval
,
sval
);
#endif
float
fr_mm_s
=
MMM_TO_MMS
(
parser
.
linearval
(
'F'
));
if
(
fr_mm_s
)
NOLESS
(
fr_mm_s
,
10.0
f
);
constexpr
float
photo_position
[
XYZ
]
=
PHOTO_POSITION
;
float
raw
[
XYZ
]
=
{
parser
.
seenval
(
'X'
)
?
RAW_X_POSITION
(
parser
.
value_linear_units
())
:
photo_position
[
X_AXIS
],
...
...
@@ -118,7 +128,7 @@ void GcodeSuite::M240() {
(
parser
.
seenval
(
'Z'
)
?
parser
.
value_linear_units
()
:
photo_position
[
Z_AXIS
])
+
current_position
[
Z_AXIS
]
};
clamp_to_software_endstops
(
raw
);
do_blocking_move_to
(
raw
);
do_blocking_move_to
(
raw
,
fr_mm_s
);
#ifdef PHOTO_SWITCH_POSITION
constexpr
float
photo_switch_position
[
2
]
=
PHOTO_SWITCH_POSITION
;
...
...
@@ -152,7 +162,7 @@ void GcodeSuite::M240() {
#if PHOTO_DELAY_MS > 0
safe_delay
(
parser
.
intval
(
'P'
,
PHOTO_DELAY_MS
));
#endif
do_blocking_move_to
(
old_pos
);
do_blocking_move_to
(
old_pos
,
fr_mm_s
);
#ifdef PHOTO_RETRACT_MM
e_move_m240
(
rval
,
sval
);
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment