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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
1af98519
Commit
1af98519
authored
May 22, 2018
by
Scott Lahteine
Browse files
Options
Downloads
Patches
Plain Diff
Group and adjust LCD buttons code
parent
0c3773d7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Marlin/src/lcd/ultralcd.h
+35
-29
35 additions, 29 deletions
Marlin/src/lcd/ultralcd.h
Marlin/src/lcd/ultralcd_common_HD44780.h
+8
-8
8 additions, 8 deletions
Marlin/src/lcd/ultralcd_common_HD44780.h
with
43 additions
and
37 deletions
Marlin/src/lcd/ultralcd.h
+
35
−
29
View file @
1af98519
...
@@ -45,7 +45,6 @@
...
@@ -45,7 +45,6 @@
#include
"../feature/pause.h"
#include
"../feature/pause.h"
#endif
#endif
bool
lcd_hasstatus
();
bool
lcd_hasstatus
();
void
lcd_setstatus
(
const
char
*
message
,
const
bool
persist
=
false
);
void
lcd_setstatus
(
const
char
*
message
,
const
bool
persist
=
false
);
void
lcd_setstatusPGM
(
const
char
*
message
,
const
int8_t
level
=
0
);
void
lcd_setstatusPGM
(
const
char
*
message
,
const
int8_t
level
=
0
);
...
@@ -90,7 +89,7 @@
...
@@ -90,7 +89,7 @@
#define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0)
#define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0)
#define BUTTON_PRESSED(BN) !READ(BTN_## BN)
#define BUTTON_PRESSED(BN) !READ(BTN_## BN)
#if ENABLED(ULTIPANEL)
#if ENABLED(ULTIPANEL)
// LCD with a click-wheel input
extern
bool
defer_return_to_status
;
extern
bool
defer_return_to_status
;
...
@@ -114,27 +113,6 @@
...
@@ -114,27 +113,6 @@
void
lcd_goto_screen
(
screenFunc_t
screen
,
const
uint32_t
encoder
=
0
);
void
lcd_goto_screen
(
screenFunc_t
screen
,
const
uint32_t
encoder
=
0
);
// Encoder click is directly connected
#define BLEN_A 0
#define BLEN_B 1
#define EN_A (_BV(BLEN_A))
#define EN_B (_BV(BLEN_B))
#if BUTTON_EXISTS(ENC)
#define BLEN_C 2
#define EN_C (_BV(BLEN_C))
#endif
#if BUTTON_EXISTS(BACK)
#define BLEN_D 3
#define EN_D _BV(BLEN_D)
#define LCD_BACK_CLICKED (buttons & EN_D)
#endif
extern
volatile
uint8_t
buttons
;
// The last-checked buttons in a bit array.
void
lcd_buttons_update
();
void
lcd_completion_feedback
(
const
bool
good
=
true
);
void
lcd_completion_feedback
(
const
bool
good
=
true
);
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ENABLED(ADVANCED_PAUSE_FEATURE)
...
@@ -142,7 +120,7 @@
...
@@ -142,7 +120,7 @@
void
lcd_advanced_pause_show_message
(
const
AdvancedPauseMessage
message
,
void
lcd_advanced_pause_show_message
(
const
AdvancedPauseMessage
message
,
const
AdvancedPauseMode
mode
=
ADVANCED_PAUSE_MODE_PAUSE_PRINT
,
const
AdvancedPauseMode
mode
=
ADVANCED_PAUSE_MODE_PAUSE_PRINT
,
const
uint8_t
extruder
=
active_extruder
);
const
uint8_t
extruder
=
active_extruder
);
#endif
// ADVANCED_PAUSE_FEATURE
#endif
#if ENABLED(G26_MESH_VALIDATION)
#if ENABLED(G26_MESH_VALIDATION)
void
lcd_chirp
();
void
lcd_chirp
();
...
@@ -155,10 +133,6 @@
...
@@ -155,10 +133,6 @@
float
lcd_z_offset_edit
();
float
lcd_z_offset_edit
();
#endif
#endif
#else
inline
void
lcd_buttons_update
()
{}
#endif
#endif
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
...
@@ -243,7 +217,6 @@
...
@@ -243,7 +217,6 @@
constexpr
bool
lcd_wait_for_move
=
false
;
constexpr
bool
lcd_wait_for_move
=
false
;
inline
void
lcd_refresh
()
{}
inline
void
lcd_refresh
()
{}
inline
void
lcd_buttons_update
()
{}
inline
bool
lcd_hasstatus
()
{
return
false
;
}
inline
bool
lcd_hasstatus
()
{
return
false
;
}
inline
void
lcd_setstatus
(
const
char
*
const
message
,
const
bool
persist
=
false
)
{
UNUSED
(
message
);
UNUSED
(
persist
);
}
inline
void
lcd_setstatus
(
const
char
*
const
message
,
const
bool
persist
=
false
)
{
UNUSED
(
message
);
UNUSED
(
persist
);
}
inline
void
lcd_setstatusPGM
(
const
char
*
const
message
,
const
int8_t
level
=
0
)
{
UNUSED
(
message
);
UNUSED
(
level
);
}
inline
void
lcd_setstatusPGM
(
const
char
*
const
message
,
const
int8_t
level
=
0
)
{
UNUSED
(
message
);
UNUSED
(
level
);
}
...
@@ -253,6 +226,39 @@
...
@@ -253,6 +226,39 @@
#endif // ULTRA_LCD
#endif // ULTRA_LCD
#if ENABLED(ULTIPANEL)
#if ENABLED(NEWPANEL) // Uses digital switches, not a shift register
// Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes)
#define BLEN_A 0
#define BLEN_B 1
#define EN_A _BV(BLEN_A)
#define EN_B _BV(BLEN_B)
#if BUTTON_EXISTS(ENC)
#define BLEN_C 2
#define EN_C _BV(BLEN_C)
#endif
#if BUTTON_EXISTS(BACK)
#define BLEN_D 3
#define EN_D _BV(BLEN_D)
#define LCD_BACK_CLICKED (buttons & EN_D)
#endif
#endif // NEWPANEL
extern
volatile
uint8_t
buttons
;
// The last-checked buttons in a bit array.
void
lcd_buttons_update
();
#else
inline
void
lcd_buttons_update
()
{}
#endif
#define LCD_MESSAGEPGM(x) lcd_setstatusPGM(PSTR(x))
#define LCD_MESSAGEPGM(x) lcd_setstatusPGM(PSTR(x))
#define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatusPGM(PSTR(x))
#define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatusPGM(PSTR(x))
...
...
...
...
This diff is collapsed.
Click to expand it.
Marlin/src/lcd/ultralcd_common_HD44780.h
+
8
−
8
View file @
1af98519
File changed. Contains only whitespace changes.
Show whitespace changes.
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