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
088e09e0
Commit
088e09e0
authored
9 years ago
by
AnHardt
Committed by
Richard Wackerbarth
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add forgotten Marlin_main.cpp
parent
8b876241
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/Marlin_main.cpp
+13
-15
13 additions, 15 deletions
Marlin/Marlin_main.cpp
with
13 additions
and
15 deletions
Marlin/Marlin_main.cpp
+
13
−
15
View file @
088e09e0
...
...
@@ -555,22 +555,26 @@ void suicide() {
void
servo_init
()
{
#if NUM_SERVOS >= 1 && HAS_SERVO_0
servo
[
0
].
attach
(
SERVO0_PIN
);
servo
[
0
].
detach
();
// Just set up the pin. We don't have a position yet. Don't move to a random position.
#endif
#if NUM_SERVOS >= 2 && HAS_SERVO_1
servo
[
1
].
attach
(
SERVO1_PIN
);
servo
[
1
].
detach
();
#endif
#if NUM_SERVOS >= 3 && HAS_SERVO_2
servo
[
2
].
attach
(
SERVO2_PIN
);
servo
[
2
].
detach
();
#endif
#if NUM_SERVOS >= 4 && HAS_SERVO_3
servo
[
3
].
attach
(
SERVO3_PIN
);
servo
[
3
].
detach
();
#endif
// Set position of Servo Endstops that are defined
#ifdef SERVO_ENDSTOPS
for
(
int
i
=
0
;
i
<
3
;
i
++
)
if
(
servo_endstops
[
i
]
>=
0
)
servo
[
servo_endstops
[
i
]].
move
(
0
,
servo_endstop_angles
[
i
*
2
+
1
]);
servo
[
servo_endstops
[
i
]].
move
(
servo_endstop_angles
[
i
*
2
+
1
]);
#endif
}
...
...
@@ -1310,10 +1314,7 @@ static void setup_for_endstop_move() {
#ifdef SERVO_ENDSTOPS
// Engage Z Servo endstop if enabled
if
(
servo_endstops
[
Z_AXIS
]
>=
0
)
{
Servo
*
srv
=
&
servo
[
servo_endstops
[
Z_AXIS
]];
srv
->
move
(
0
,
servo_endstop_angles
[
Z_AXIS
*
2
]);
}
if
(
servo_endstops
[
Z_AXIS
]
>=
0
)
servo
[
servo_endstops
[
Z_AXIS
]].
move
(
servo_endstop_angles
[
Z_AXIS
*
2
]);
#elif defined(Z_PROBE_ALLEN_KEY)
feedrate
=
Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE
;
...
...
@@ -1413,8 +1414,7 @@ static void setup_for_endstop_move() {
#endif
// Change the Z servo angle
Servo
*
srv
=
&
servo
[
servo_endstops
[
Z_AXIS
]];
srv
->
move
(
0
,
servo_endstop_angles
[
Z_AXIS
*
2
+
1
]);
servo
[
servo_endstops
[
Z_AXIS
]].
move
(
servo_endstop_angles
[
Z_AXIS
*
2
+
1
]);
}
#elif defined(Z_PROBE_ALLEN_KEY)
...
...
@@ -1665,8 +1665,8 @@ static void homeaxis(AxisEnum axis) {
#ifdef SERVO_ENDSTOPS
if
(
axis
!=
Z_AXIS
)
{
// Engage Servo endstop if enabled
if
(
servo_endstops
[
axis
]
>
-
1
)
servo
[
servo_endstops
[
axis
]].
move
(
0
,
servo_endstop_angles
[
axis
*
2
]);
if
(
servo_endstops
[
axis
]
>
=
0
)
servo
[
servo_endstops
[
axis
]].
move
(
servo_endstop_angles
[
axis
*
2
]);
}
#endif
...
...
@@ -1768,8 +1768,8 @@ static void homeaxis(AxisEnum axis) {
{
#ifdef SERVO_ENDSTOPS
// Retract Servo endstop if enabled
if
(
servo_endstops
[
axis
]
>
-
1
)
servo
[
servo_endstops
[
axis
]].
move
(
0
,
servo_endstop_angles
[
axis
*
2
+
1
]);
if
(
servo_endstops
[
axis
]
>
=
0
)
servo
[
servo_endstops
[
axis
]].
move
(
servo_endstop_angles
[
axis
*
2
+
1
]);
#endif
}
...
...
@@ -4233,10 +4233,8 @@ inline void gcode_M226() {
int
servo_position
=
0
;
if
(
code_seen
(
'S'
))
{
servo_position
=
code_value_short
();
if
(
servo_index
>=
0
&&
servo_index
<
NUM_SERVOS
)
{
Servo
*
srv
=
&
servo
[
servo_index
];
srv
->
move
(
0
,
servo_position
);
}
if
(
servo_index
>=
0
&&
servo_index
<
NUM_SERVOS
)
servo
[
servo_index
].
move
(
servo_position
);
else
{
SERIAL_ECHO_START
;
SERIAL_ECHO
(
"Servo "
);
...
...
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