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
3fd74b12
Commit
3fd74b12
authored
8 years ago
by
Roxy-3D
Browse files
Options
Downloads
Patches
Plain Diff
Get G29's Interactive Mesh Editor running
G29 P4 R O should work now.
parent
1d58558b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/ultralcd.cpp
+18
-16
18 additions, 16 deletions
Marlin/ultralcd.cpp
with
18 additions
and
16 deletions
Marlin/ultralcd.cpp
+
18
−
16
View file @
3fd74b12
...
...
@@ -819,7 +819,7 @@ void kill_screen(const char* lcd_msg) {
float
Mesh_Edit_Value
,
Mesh_Edit_Accumulator
;
// We round Mesh_Edit_Value to 2.5 decimal places. So we keep a
// seperate value that doesn't lose precision.
static
int
loop_cnt
=
0
,
last_seen_bits
;
static
int
loop_cnt
=
0
,
last_seen_bits
,
UBL_encoderPosition
=
0
;
static
void
_lcd_mesh_fine_tune
(
const
char
*
msg
)
{
static
unsigned
long
last_click
=
0
;
...
...
@@ -827,18 +827,21 @@ void kill_screen(const char* lcd_msg) {
long
int
rounded
;
defer_return_to_status
=
true
;
if
(
encoderPosition
)
{
// If moving the Encoder wheel very slowly, we just go
if
(
(
millis
()
-
last_click
)
>
500L
)
{
// up or down by 1 position
if
(
(
(
int32_t
)
encoderPosition
)
>
0
)
{
encoderPosition
=
1
;
}
if
(
G29_encoderDiff
)
{
// If moving the Encoder wheel very slowly, we just go
if
(
(
millis
()
-
last_click
)
>
200L
)
{
// up or down by 1 position
if
(
G29_encoderDiff
>
0
)
UBL_encoderPosition
=
1
;
else
{
encoderPosition
=
(
uint32_t
)
-
1
;
}
UBL_encoderPosition
=
-
1
;
}
}
else
UBL_encoderPosition
=
G29_encoderDiff
*
2
;
G29_encoderDiff
=
0
;
last_click
=
millis
();
Mesh_Edit_Accumulator
+=
(
(
float
)
(
(
int32_t
)
encoderPosition
))
*
.005
/
2.0
;
Mesh_Edit_Accumulator
+=
(
(
float
)
(
UBL_
encoderPosition
))
*
.005
/
2.0
;
Mesh_Edit_Value
=
Mesh_Edit_Accumulator
;
encoderPosition
=
0
;
lcdDrawUpdate
=
LCDVIEW_REDRAW_NOW
;
...
...
@@ -853,21 +856,17 @@ void kill_screen(const char* lcd_msg) {
if
(
lcdDrawUpdate
)
{
lcd_implementation_drawedit
(
msg
,
ftostr43sign
(
(
float
)
Mesh_Edit_Value
));
}
if
(
!
UBL_has_control_of_LCD_Panel
&&
LCD_CLICKED
)
{
UBL_has_control_of_LCD_Panel
=
1
;
// We need to lock the normal LCD Panel System outbecause G29 (and G26) are looking for
lcd_return_to_status
();
// long presses of the Encoder Wheel and the LCD System goes spastic when that happens.
// We will give back control from those routines when the switch is debounced.
}
}
void
_lcd_mesh_edit
()
{
_lcd_mesh_fine_tune
(
PSTR
(
"Mesh Editor: "
));
defer_return_to_status
=
true
;
}
float
lcd_mesh_edit
()
{
lcd_goto_screen
(
_lcd_mesh_edit
);
defer_return_to_status
=
true
;
return
Mesh_Edit_Value
;
}
...
...
@@ -875,6 +874,7 @@ void kill_screen(const char* lcd_msg) {
Mesh_Edit_Value
=
inital
;
Mesh_Edit_Accumulator
=
inital
;
lcd_goto_screen
(
_lcd_mesh_edit
);
defer_return_to_status
=
true
;
return
;
}
...
...
@@ -884,6 +884,7 @@ void kill_screen(const char* lcd_msg) {
float
lcd_z_offset_edit
()
{
lcd_goto_screen
(
_lcd_z_offset_edit
);
defer_return_to_status
=
true
;
return
Mesh_Edit_Value
;
}
...
...
@@ -891,6 +892,7 @@ void kill_screen(const char* lcd_msg) {
Mesh_Edit_Value
=
inital
;
Mesh_Edit_Accumulator
=
inital
;
lcd_goto_screen
(
_lcd_z_offset_edit
);
defer_return_to_status
=
true
;
return
;
}
...
...
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