🎨 General cleanup of extui/dgus

In relation to #22121
This commit is contained in:
Scott Lahteine
2021-06-13 20:19:43 -05:00
parent 82ac7da0a7
commit d5510ea519
11 changed files with 405 additions and 457 deletions

View File

@@ -56,3 +56,21 @@ inline uint16_t swap16(const uint16_t value) { return (value & 0xFFU) << 8U | (v
#endif
extern DGUSScreenHandler ScreenHandler;
// Helper to define a DGUS_VP_Variable for common use-cases.
#define VPHELPER(VPADR, VPADRVAR, RXFPTR, TXFPTR) { \
.VP = VPADR, \
.memadr = VPADRVAR, \
.size = sizeof(VPADRVAR), \
.set_by_display_handler = RXFPTR, \
.send_to_display_handler = TXFPTR \
}
// Helper to define a DGUS_VP_Variable when the size of the var cannot be determined automatically (e.g., a string)
#define VPHELPER_STR(VPADR, VPADRVAR, STRLEN, RXFPTR, TXFPTR) { \
.VP = VPADR, \
.memadr = VPADRVAR, \
.size = STRLEN, \
.set_by_display_handler = RXFPTR, \
.send_to_display_handler = TXFPTR \
}