🧑💻 Remove extraneous 'inline' hints
This commit is contained in:
committed by
Scott Lahteine
parent
ccc66a8528
commit
5b9f3bd4b1
@ -39,7 +39,7 @@ public:
|
||||
static void init();
|
||||
static void onEncoder(EncoderState encoder_diffState);
|
||||
static void draw();
|
||||
static inline bool isUnlocked() { return unlocked; }
|
||||
static bool isUnlocked() { return unlocked; }
|
||||
};
|
||||
|
||||
extern LockScreenClass lockScreen;
|
||||
|
@ -55,7 +55,7 @@ class DWIN_String {
|
||||
//static font_t *font() { return font_header; };
|
||||
//static uint16_t font_height() { return font_header->FontAscent - font_header->FontDescent; }
|
||||
//static glyph_t *glyph(uint8_t character) { return glyphs[character] ?: glyphs[0x3F]; } /* Use '?' for unknown glyphs */
|
||||
//static inline glyph_t *glyph(uint8_t *character) { return glyph(*character); }
|
||||
//static glyph_t *glyph(uint8_t *character) { return glyph(*character); }
|
||||
|
||||
static void set();
|
||||
//static void add(uint8_t character) { add_character(character); eol(); }
|
||||
@ -65,10 +65,10 @@ class DWIN_String {
|
||||
static void set(uint8_t *string) { set(); add(string); }
|
||||
static void set(wchar_t character) { set(); add(character); }
|
||||
static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); }
|
||||
static inline void set(FSTR_P fstring) { set((uint8_t *)fstring); }
|
||||
static inline void set(const char *string) { set((uint8_t *)string); }
|
||||
static inline void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); }
|
||||
static inline void add(const char *string) { add((uint8_t *)string); }
|
||||
static void set(FSTR_P fstring) { set((uint8_t *)fstring); }
|
||||
static void set(const char *string) { set((uint8_t *)string); }
|
||||
static void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); }
|
||||
static void add(const char *string) { add((uint8_t *)string); }
|
||||
|
||||
static void trim(const uint8_t character=0x20);
|
||||
static void rtrim(const uint8_t character=0x20);
|
||||
@ -76,9 +76,9 @@ class DWIN_String {
|
||||
|
||||
static void truncate(uint8_t maxlen) { if (len > maxlen) { len = maxlen; eol(); } }
|
||||
|
||||
static inline uint8_t length() { return len; }
|
||||
static inline uint16_t width() { return span; }
|
||||
static inline uint8_t *string() { return data; }
|
||||
static uint8_t length() { return len; }
|
||||
static uint16_t width() { return span; }
|
||||
static uint8_t *string() { return data; }
|
||||
static uint16_t center(uint16_t width) { return span > width ? 0 : (width - span) / 2; }
|
||||
};
|
||||
|
||||
|
@ -95,14 +95,14 @@ public:
|
||||
|
||||
// Checks two things: Can we confirm the presence of the display and has we initialized it.
|
||||
// (both boils down that the display answered to our chatting)
|
||||
static inline bool isInitialized() { return Initialized; }
|
||||
static bool isInitialized() { return Initialized; }
|
||||
|
||||
private:
|
||||
static void WriteHeader(uint16_t adr, uint8_t cmd, uint8_t payloadlen);
|
||||
static void WritePGM(const char str[], uint8_t len);
|
||||
static void ProcessRx();
|
||||
|
||||
static inline uint16_t swap16(const uint16_t value) { return (value & 0xFFU) << 8U | (value >> 8U); }
|
||||
static uint16_t swap16(const uint16_t value) { return (value & 0xFFU) << 8U | (value >> 8U); }
|
||||
static rx_datagram_state_t rx_datagram_state;
|
||||
static uint8_t rx_datagram_len;
|
||||
static bool Initialized, no_reentrance;
|
||||
|
@ -38,10 +38,10 @@ public:
|
||||
// Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
|
||||
// The bools specifying whether the strings are in RAM or FLASH.
|
||||
static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
|
||||
static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
|
||||
}
|
||||
static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
|
||||
}
|
||||
|
||||
@ -213,13 +213,13 @@ public:
|
||||
}
|
||||
|
||||
// Force an update of all VP on the current screen.
|
||||
static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; }
|
||||
static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; }
|
||||
// Has all VPs sent to the screen
|
||||
static inline bool IsScreenComplete() { return ScreenComplete; }
|
||||
static bool IsScreenComplete() { return ScreenComplete; }
|
||||
|
||||
static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; }
|
||||
static DGUSLCD_Screens getCurrentScreen() { return current_screen; }
|
||||
|
||||
static inline void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; }
|
||||
static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; }
|
||||
|
||||
private:
|
||||
static DGUSLCD_Screens current_screen; //< currently on screen
|
||||
|
@ -38,10 +38,10 @@ public:
|
||||
// Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
|
||||
// The bools specifying whether the strings are in RAM or FLASH.
|
||||
static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
|
||||
static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
|
||||
}
|
||||
static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
|
||||
}
|
||||
|
||||
@ -213,13 +213,13 @@ public:
|
||||
}
|
||||
|
||||
// Force an update of all VP on the current screen.
|
||||
static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; }
|
||||
static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; }
|
||||
// Has all VPs sent to the screen
|
||||
static inline bool IsScreenComplete() { return ScreenComplete; }
|
||||
static bool IsScreenComplete() { return ScreenComplete; }
|
||||
|
||||
static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; }
|
||||
static DGUSLCD_Screens getCurrentScreen() { return current_screen; }
|
||||
|
||||
static inline void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; }
|
||||
static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; }
|
||||
|
||||
private:
|
||||
static DGUSLCD_Screens current_screen; //< currently on screen
|
||||
|
@ -38,10 +38,10 @@ public:
|
||||
// Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
|
||||
// The bools specifying whether the strings are in RAM or FLASH.
|
||||
static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
|
||||
static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
|
||||
}
|
||||
static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
|
||||
}
|
||||
|
||||
@ -280,13 +280,13 @@ public:
|
||||
}
|
||||
|
||||
// Force an update of all VP on the current screen.
|
||||
static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; }
|
||||
static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; }
|
||||
// Has all VPs sent to the screen
|
||||
static inline bool IsScreenComplete() { return ScreenComplete; }
|
||||
static bool IsScreenComplete() { return ScreenComplete; }
|
||||
|
||||
static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; }
|
||||
static DGUSLCD_Screens getCurrentScreen() { return current_screen; }
|
||||
|
||||
static inline void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; }
|
||||
static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; }
|
||||
|
||||
private:
|
||||
static DGUSLCD_Screens current_screen; //< currently on screen
|
||||
|
@ -38,10 +38,10 @@ public:
|
||||
// Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
|
||||
// The bools specifying whether the strings are in RAM or FLASH.
|
||||
static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
|
||||
static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
|
||||
}
|
||||
static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
|
||||
sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
|
||||
}
|
||||
|
||||
@ -213,13 +213,13 @@ public:
|
||||
}
|
||||
|
||||
// Force an update of all VP on the current screen.
|
||||
static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; }
|
||||
static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; }
|
||||
// Has all VPs sent to the screen
|
||||
static inline bool IsScreenComplete() { return ScreenComplete; }
|
||||
static bool IsScreenComplete() { return ScreenComplete; }
|
||||
|
||||
static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; }
|
||||
static DGUSLCD_Screens getCurrentScreen() { return current_screen; }
|
||||
|
||||
static inline void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; }
|
||||
static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; }
|
||||
|
||||
private:
|
||||
static DGUSLCD_Screens current_screen; //< currently on screen
|
||||
|
@ -98,7 +98,7 @@ public:
|
||||
|
||||
// Checks two things: Can we confirm the presence of the display and has we initialized it.
|
||||
// (both boils down that the display answered to our chatting)
|
||||
static inline bool IsInitialized() {
|
||||
static bool IsInitialized() {
|
||||
return initialized;
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,8 @@
|
||||
#define min(a,b) ((a)<(b)?(a):(b))
|
||||
#else
|
||||
namespace UI {
|
||||
static inline uint32_t safe_millis() { return millis(); }
|
||||
static inline void yield() {}
|
||||
static uint32_t safe_millis() { return millis(); }
|
||||
static void yield() {}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -40,13 +40,13 @@
|
||||
template<typename port_t,uint8_t bits>
|
||||
struct port_pin {
|
||||
typedef port_t port;
|
||||
static inline void set_high() {port::port() = (port::port() | bits);}
|
||||
static inline void set_low() {port::port() = (port::port() & (~bits));}
|
||||
static inline void set_input() {port::ddr() = (port::ddr() & (~bits));}
|
||||
static inline void set_input_pullup() {set_input(); set_high();}
|
||||
static inline void set_output() {port::ddr() = (port::ddr() | bits);}
|
||||
static inline uint8_t read() {return port::pin() & bits;}
|
||||
static inline void write(bool v) {if (v) set_high(); else set_low();}
|
||||
static void set_high() {port::port() = (port::port() | bits);}
|
||||
static void set_low() {port::port() = (port::port() & (~bits));}
|
||||
static void set_input() {port::ddr() = (port::ddr() & (~bits));}
|
||||
static void set_input_pullup() {set_input(); set_high();}
|
||||
static void set_output() {port::ddr() = (port::ddr() | bits);}
|
||||
static uint8_t read() {return port::pin() & bits;}
|
||||
static void write(bool v) {if (v) set_high(); else set_low();}
|
||||
};
|
||||
|
||||
#define MAKE_AVR_PORT_PINS(ID) \
|
||||
@ -109,13 +109,13 @@
|
||||
template<uint8_t p>
|
||||
struct arduino_digital_pin {
|
||||
static constexpr uint8_t pin = p;
|
||||
static inline void set_high() {digitalWrite(p, HIGH);}
|
||||
static inline void set_low() {digitalWrite(p, LOW);}
|
||||
static inline void set_input() {pinMode(p, INPUT);}
|
||||
static inline void set_input_pullup() {pinMode(p, INPUT_PULLUP);}
|
||||
static inline void set_output() {pinMode(p, OUTPUT);}
|
||||
static inline uint8_t read() {return digitalRead(p);}
|
||||
static inline void write(bool v) {digitalWrite(p, v ? HIGH : LOW);}
|
||||
static void set_high() {digitalWrite(p, HIGH);}
|
||||
static void set_low() {digitalWrite(p, LOW);}
|
||||
static void set_input() {pinMode(p, INPUT);}
|
||||
static void set_input_pullup() {pinMode(p, INPUT_PULLUP);}
|
||||
static void set_output() {pinMode(p, OUTPUT);}
|
||||
static uint8_t read() {return digitalRead(p);}
|
||||
static void write(bool v) {digitalWrite(p, v ? HIGH : LOW);}
|
||||
};
|
||||
|
||||
#define MAKE_ARDUINO_PINS(ID) typedef arduino_digital_pin<ID> ARDUINO_DIGITAL_##ID;
|
||||
|
@ -29,10 +29,10 @@ class SoundList {
|
||||
} list[];
|
||||
public:
|
||||
static const uint8_t n;
|
||||
static inline const char* name(uint8_t val) {
|
||||
static const char* name(uint8_t val) {
|
||||
return (const char* ) pgm_read_ptr_far(&list[val].name);
|
||||
}
|
||||
static inline FTDI::SoundPlayer::sound_t* data(uint8_t val) {
|
||||
static FTDI::SoundPlayer::sound_t* data(uint8_t val) {
|
||||
return (FTDI::SoundPlayer::sound_t*) pgm_read_ptr_far(&list[val].data);
|
||||
}
|
||||
};
|
||||
|
@ -96,12 +96,12 @@ private:
|
||||
static uint8_t m_pageData[SPI_FLASH_PageSize];
|
||||
static uint32_t m_currentPage;
|
||||
static uint16_t m_pageDataUsed;
|
||||
static inline uint16_t pageDataFree() { return SPI_FLASH_PageSize - m_pageDataUsed; }
|
||||
static uint16_t pageDataFree() { return SPI_FLASH_PageSize - m_pageDataUsed; }
|
||||
static uint32_t m_startAddress;
|
||||
#if HAS_SPI_FLASH_COMPRESSION
|
||||
static uint8_t m_compressedData[SPI_FLASH_PageSize];
|
||||
static uint16_t m_compressedDataUsed;
|
||||
static inline uint16_t compressedDataFree() { return SPI_FLASH_PageSize - m_compressedDataUsed; }
|
||||
static uint16_t compressedDataFree() { return SPI_FLASH_PageSize - m_compressedDataUsed; }
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -274,8 +274,8 @@ public:
|
||||
static bool detected();
|
||||
static void init_lcd();
|
||||
#else
|
||||
static inline bool detected() { return true; }
|
||||
static inline void init_lcd() {}
|
||||
static bool detected() { return true; }
|
||||
static void init_lcd() {}
|
||||
#endif
|
||||
|
||||
#if HAS_PRINT_PROGRESS
|
||||
@ -294,7 +294,7 @@ public:
|
||||
static void set_progress_done() { progress_override = (PROGRESS_MASK + 1U) + 100U * (PROGRESS_SCALE); }
|
||||
static void progress_reset() { if (progress_override & (PROGRESS_MASK + 1U)) set_progress(0); }
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
static inline uint32_t _calculated_remaining_time() {
|
||||
static uint32_t _calculated_remaining_time() {
|
||||
const duration_t elapsed = print_job_timer.duration();
|
||||
const progress_t progress = _get_progress();
|
||||
return progress ? elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress : 0;
|
||||
@ -342,12 +342,12 @@ public:
|
||||
static bool has_status();
|
||||
static void reset_status(const bool no_welcome=false);
|
||||
static void set_alert_status(FSTR_P const fstr);
|
||||
static inline void reset_alert_level() { alert_level = 0; }
|
||||
static void reset_alert_level() { alert_level = 0; }
|
||||
#else
|
||||
static constexpr bool has_status() { return false; }
|
||||
static inline void reset_status(const bool=false) {}
|
||||
static inline void set_alert_status(FSTR_P const) {}
|
||||
static inline void reset_alert_level() {}
|
||||
static void reset_status(const bool=false) {}
|
||||
static void set_alert_status(FSTR_P const) {}
|
||||
static void reset_alert_level() {}
|
||||
#endif
|
||||
|
||||
static void set_status(const char * const cstr, const bool persist=false);
|
||||
@ -360,7 +360,7 @@ public:
|
||||
static void draw_status_message(const bool blink);
|
||||
#endif
|
||||
#else
|
||||
static inline void kill_screen(FSTR_P const, FSTR_P const) {}
|
||||
static void kill_screen(FSTR_P const, FSTR_P const) {}
|
||||
#endif
|
||||
|
||||
#if HAS_DISPLAY
|
||||
@ -444,7 +444,7 @@ public:
|
||||
#if HAS_BUZZER
|
||||
static void completion_feedback(const bool good=true);
|
||||
#else
|
||||
static inline void completion_feedback(const bool=true) { TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); }
|
||||
static void completion_feedback(const bool=true) { TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); }
|
||||
#endif
|
||||
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
@ -479,9 +479,9 @@ public:
|
||||
|
||||
#else // No LCD
|
||||
|
||||
static inline void init() {}
|
||||
static inline void update() {}
|
||||
static inline void return_to_status() {}
|
||||
static void init() {}
|
||||
static void update() {}
|
||||
static void return_to_status() {}
|
||||
|
||||
#endif
|
||||
|
||||
@ -500,17 +500,17 @@ public:
|
||||
static preheat_t material_preset[PREHEAT_COUNT];
|
||||
static PGM_P get_preheat_label(const uint8_t m);
|
||||
static void apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e=active_extruder);
|
||||
static inline void preheat_set_fan(const uint8_t m) { TERN_(HAS_FAN, apply_preheat(m, PM_FAN)); }
|
||||
static inline void preheat_hotend(const uint8_t m, const uint8_t e=active_extruder) { TERN_(HAS_HOTEND, apply_preheat(m, PM_HOTEND)); }
|
||||
static inline void preheat_hotend_and_fan(const uint8_t m, const uint8_t e=active_extruder) { preheat_hotend(m, e); preheat_set_fan(m); }
|
||||
static inline void preheat_bed(const uint8_t m) { TERN_(HAS_HEATED_BED, apply_preheat(m, PM_BED)); }
|
||||
static inline void preheat_all(const uint8_t m) { apply_preheat(m, 0xFF); }
|
||||
static void preheat_set_fan(const uint8_t m) { TERN_(HAS_FAN, apply_preheat(m, PM_FAN)); }
|
||||
static void preheat_hotend(const uint8_t m, const uint8_t e=active_extruder) { TERN_(HAS_HOTEND, apply_preheat(m, PM_HOTEND)); }
|
||||
static void preheat_hotend_and_fan(const uint8_t m, const uint8_t e=active_extruder) { preheat_hotend(m, e); preheat_set_fan(m); }
|
||||
static void preheat_bed(const uint8_t m) { TERN_(HAS_HEATED_BED, apply_preheat(m, PM_BED)); }
|
||||
static void preheat_all(const uint8_t m) { apply_preheat(m, 0xFF); }
|
||||
#endif
|
||||
|
||||
#if SCREENS_CAN_TIME_OUT
|
||||
static inline void reset_status_timeout(const millis_t ms) { return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; }
|
||||
static void reset_status_timeout(const millis_t ms) { return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; }
|
||||
#else
|
||||
static inline void reset_status_timeout(const millis_t) {}
|
||||
static void reset_status_timeout(const millis_t) {}
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
@ -548,11 +548,11 @@ public:
|
||||
|
||||
// goto_previous_screen and go_back may also be used as menu item callbacks
|
||||
static void _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, const bool is_back));
|
||||
static inline void goto_previous_screen() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, false)); }
|
||||
static inline void go_back() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, true)); }
|
||||
static void goto_previous_screen() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, false)); }
|
||||
static void go_back() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, true)); }
|
||||
|
||||
static void return_to_status();
|
||||
static inline bool on_status_screen() { return currentScreen == status_screen; }
|
||||
static bool on_status_screen() { return currentScreen == status_screen; }
|
||||
FORCE_INLINE static void run_current_screen() { (*currentScreen)(); }
|
||||
|
||||
#if ENABLED(LIGHTWEIGHT_UI)
|
||||
@ -567,7 +567,7 @@ public:
|
||||
TERN(SCREENS_CAN_TIME_OUT, defer_return_to_status = defer, UNUSED(defer));
|
||||
}
|
||||
|
||||
static inline void goto_previous_screen_no_defer() {
|
||||
static void goto_previous_screen_no_defer() {
|
||||
defer_status_screen(false);
|
||||
goto_previous_screen();
|
||||
}
|
||||
@ -599,20 +599,20 @@ public:
|
||||
|
||||
#if EITHER(HAS_LCD_MENU, EXTENSIBLE_UI)
|
||||
static bool lcd_clicked;
|
||||
static inline bool use_click() {
|
||||
static bool use_click() {
|
||||
const bool click = lcd_clicked;
|
||||
lcd_clicked = false;
|
||||
return click;
|
||||
}
|
||||
#else
|
||||
static constexpr bool lcd_clicked = false;
|
||||
static inline bool use_click() { return false; }
|
||||
static bool use_click() { return false; }
|
||||
#endif
|
||||
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_LCD_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI)
|
||||
static void pause_show_message(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder);
|
||||
#else
|
||||
static inline void _pause_show_message() {}
|
||||
static void _pause_show_message() {}
|
||||
#define pause_show_message(...) _pause_show_message()
|
||||
#endif
|
||||
|
||||
@ -631,9 +631,9 @@ public:
|
||||
#endif
|
||||
#if DISABLED(EEPROM_AUTO_INIT)
|
||||
static void eeprom_alert(const uint8_t msgid);
|
||||
static inline void eeprom_alert_crc() { eeprom_alert(0); }
|
||||
static inline void eeprom_alert_index() { eeprom_alert(1); }
|
||||
static inline void eeprom_alert_version() { eeprom_alert(2); }
|
||||
static void eeprom_alert_crc() { eeprom_alert(0); }
|
||||
static void eeprom_alert_index() { eeprom_alert(1); }
|
||||
static void eeprom_alert_version() { eeprom_alert(2); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -674,7 +674,7 @@ public:
|
||||
#endif
|
||||
|
||||
static void update_buttons();
|
||||
static inline bool button_pressed() { return BUTTON_CLICK() || TERN(TOUCH_SCREEN, touch_pressed(), false); }
|
||||
static bool button_pressed() { return BUTTON_CLICK() || TERN(TOUCH_SCREEN, touch_pressed(), false); }
|
||||
#if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
|
||||
static void wait_for_release();
|
||||
#endif
|
||||
@ -705,7 +705,7 @@ public:
|
||||
|
||||
#else
|
||||
|
||||
static inline void update_buttons() {}
|
||||
static void update_buttons() {}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -109,7 +109,7 @@ class MenuItem_confirm : public MenuItemBase {
|
||||
selectFunc_t yesFunc, selectFunc_t noFunc,
|
||||
PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr
|
||||
);
|
||||
static inline void select_screen(
|
||||
static void select_screen(
|
||||
PGM_P const yes, PGM_P const no,
|
||||
selectFunc_t yesFunc, selectFunc_t noFunc,
|
||||
PGM_P const pref, FSTR_P const string, PGM_P const suff=nullptr
|
||||
@ -178,7 +178,7 @@ class MenuEditItemBase : public MenuItemBase {
|
||||
static void draw_edit_screen(PGM_P const pstr, const char * const value);
|
||||
|
||||
// This method is for the current menu item
|
||||
static inline void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); }
|
||||
static void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); }
|
||||
};
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
@ -39,14 +39,14 @@ class MenuItem_submenu : public MenuItemBase {
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) {
|
||||
_draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]);
|
||||
}
|
||||
static inline void action(PGM_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); }
|
||||
static void action(PGM_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); }
|
||||
};
|
||||
|
||||
// Any menu item that invokes an immediate action
|
||||
class MenuItem_button : public MenuItemBase {
|
||||
public:
|
||||
// Button-y Items are selectable lines with no other indicator
|
||||
static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) {
|
||||
static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) {
|
||||
_draw(sel, row, pstr, '>', ' ');
|
||||
}
|
||||
};
|
||||
@ -54,8 +54,8 @@ class MenuItem_button : public MenuItemBase {
|
||||
// ACTION_ITEM(LABEL, FUNC)
|
||||
class MenuItem_function : public MenuItem_button {
|
||||
public:
|
||||
//static inline void action(PGM_P const, const uint8_t, const menuAction_t func) { (*func)(); };
|
||||
static inline void action(PGM_P const, const menuAction_t func) { if (func) (*func)(); };
|
||||
//static void action(PGM_P const, const uint8_t, const menuAction_t func) { (*func)(); };
|
||||
static void action(PGM_P const, const menuAction_t func) { if (func) (*func)(); };
|
||||
};
|
||||
|
||||
// GCODES_ITEM(LABEL, GCODES)
|
||||
@ -65,7 +65,7 @@ class MenuItem_gcode : public MenuItem_button {
|
||||
_draw(sel, row, pstr, '>', ' ');
|
||||
}
|
||||
static void action(PGM_P const, PGM_P const pgcode) { queue.inject(FPSTR(pgcode)); }
|
||||
static inline void action(PGM_P const pstr, const uint8_t, PGM_P const pgcode) { action(pstr, pgcode); }
|
||||
static void action(PGM_P const pstr, const uint8_t, PGM_P const pgcode) { action(pstr, pgcode); }
|
||||
};
|
||||
|
||||
////////////////////////////////////////////
|
||||
@ -77,8 +77,8 @@ template<typename NAME>
|
||||
class TMenuEditItem : MenuEditItemBase {
|
||||
private:
|
||||
typedef typename NAME::type_t type_t;
|
||||
static inline float scale(const_float_t value) { return NAME::scale(value); }
|
||||
static inline float unscale(const_float_t value) { return NAME::unscale(value); }
|
||||
static float scale(const_float_t value) { return NAME::scale(value); }
|
||||
static float unscale(const_float_t value) { return NAME::unscale(value); }
|
||||
static const char* to_string(const int32_t value) { return NAME::strfunc(unscale(value)); }
|
||||
static void load(void *ptr, const int32_t value) { *((type_t*)ptr) = unscale(value); }
|
||||
public:
|
||||
@ -117,9 +117,9 @@ class TMenuEditItem : MenuEditItemBase {
|
||||
*
|
||||
* struct MenuEditItemInfo_percent {
|
||||
* typedef uint8_t type_t;
|
||||
* static inline float scale(const_float_t value) { return value * (100.f/255.f) +0.5f; }
|
||||
* static inline float unscale(const_float_t value) { return value / (100.f/255.f) +0.5f; }
|
||||
* static inline const char* strfunc(const_float_t value) { return ui8tostr4pctrj(_DOFIX(uint8_t,value)); }
|
||||
* static float scale(const_float_t value) { return value * (100.f/255.f) +0.5f; }
|
||||
* static float unscale(const_float_t value) { return value / (100.f/255.f) +0.5f; }
|
||||
* static const char* strfunc(const_float_t value) { return ui8tostr4pctrj(_DOFIX(uint8_t,value)); }
|
||||
* };
|
||||
* typedef TMenuEditItem<MenuEditItemInfo_percent> MenuItem_percent
|
||||
*/
|
||||
@ -128,9 +128,9 @@ class TMenuEditItem : MenuEditItemBase {
|
||||
#define DEFINE_MENU_EDIT_ITEM_TYPE(NAME, TYPE, STRFUNC, SCALE, ETC...) \
|
||||
struct MenuEditItemInfo_##NAME { \
|
||||
typedef TYPE type_t; \
|
||||
static inline float scale(const_float_t value) { return value * (SCALE) ETC; } \
|
||||
static inline float unscale(const_float_t value) { return value / (SCALE) ETC; } \
|
||||
static inline const char* strfunc(const_float_t value) { return STRFUNC(_DOFIX(TYPE,value)); } \
|
||||
static float scale(const_float_t value) { return value * (SCALE) ETC; } \
|
||||
static float unscale(const_float_t value) { return value / (SCALE) ETC; } \
|
||||
static const char* strfunc(const_float_t value) { return STRFUNC(_DOFIX(TYPE,value)); } \
|
||||
}; \
|
||||
typedef TMenuEditItem<MenuEditItemInfo_##NAME> MenuItem_##NAME
|
||||
|
||||
|
@ -81,24 +81,24 @@ class TFT {
|
||||
static uint16_t buffer[TFT_BUFFER_SIZE];
|
||||
|
||||
static void init();
|
||||
static inline void set_font(const uint8_t *Font) { string.set_font(Font); }
|
||||
static inline void add_glyphs(const uint8_t *Font) { string.add_glyphs(Font); }
|
||||
static void set_font(const uint8_t *Font) { string.set_font(Font); }
|
||||
static void add_glyphs(const uint8_t *Font) { string.add_glyphs(Font); }
|
||||
|
||||
static inline bool is_busy() { return io.isBusy(); }
|
||||
static inline void abort() { io.Abort(); }
|
||||
static inline void write_multiple(uint16_t Data, uint16_t Count) { io.WriteMultiple(Data, Count); }
|
||||
static inline void write_sequence(uint16_t *Data, uint16_t Count) { io.WriteSequence(Data, Count); }
|
||||
static inline void set_window(uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) { io.set_window(Xmin, Ymin, Xmax, Ymax); }
|
||||
static bool is_busy() { return io.isBusy(); }
|
||||
static void abort() { io.Abort(); }
|
||||
static void write_multiple(uint16_t Data, uint16_t Count) { io.WriteMultiple(Data, Count); }
|
||||
static void write_sequence(uint16_t *Data, uint16_t Count) { io.WriteSequence(Data, Count); }
|
||||
static void set_window(uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) { io.set_window(Xmin, Ymin, Xmax, Ymax); }
|
||||
|
||||
static inline void fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.fill(x, y, width, height, color); }
|
||||
static inline void canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) { queue.canvas(x, y, width, height); }
|
||||
static inline void set_background(uint16_t color) { queue.set_background(color); }
|
||||
static inline void add_text(uint16_t x, uint16_t y, uint16_t color, TFT_String tft_string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, tft_string.string(), maxWidth); }
|
||||
static inline void add_text(uint16_t x, uint16_t y, uint16_t color, const char *string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, (uint8_t *)string, maxWidth); }
|
||||
static inline void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) { queue.add_image(x, y, image, colors); }
|
||||
static inline void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t color_main = COLOR_WHITE, uint16_t color_background = COLOR_BACKGROUND, uint16_t color_shadow = COLOR_BLACK) { queue.add_image(x, y, image, color_main, color_background, color_shadow); }
|
||||
static inline void add_bar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_bar(x, y, width, height, color); }
|
||||
static inline void add_rectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_rectangle(x, y, width, height, color); }
|
||||
static void fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.fill(x, y, width, height, color); }
|
||||
static void canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) { queue.canvas(x, y, width, height); }
|
||||
static void set_background(uint16_t color) { queue.set_background(color); }
|
||||
static void add_text(uint16_t x, uint16_t y, uint16_t color, TFT_String tft_string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, tft_string.string(), maxWidth); }
|
||||
static void add_text(uint16_t x, uint16_t y, uint16_t color, const char *string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, (uint8_t *)string, maxWidth); }
|
||||
static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) { queue.add_image(x, y, image, colors); }
|
||||
static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t color_main = COLOR_WHITE, uint16_t color_background = COLOR_BACKGROUND, uint16_t color_shadow = COLOR_BLACK) { queue.add_image(x, y, image, color_main, color_background, color_shadow); }
|
||||
static void add_bar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_bar(x, y, width, height, color); }
|
||||
static void add_rectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_rectangle(x, y, width, height, color); }
|
||||
static void draw_edit_screen_buttons();
|
||||
};
|
||||
|
||||
|
@ -81,7 +81,7 @@ class TFT_String {
|
||||
static font_t *font() { return font_header; };
|
||||
static uint16_t font_height() { return font_header->FontAscent - font_header->FontDescent; }
|
||||
static glyph_t *glyph(uint8_t character) { return glyphs[character] ?: glyphs[0x3F]; } /* Use '?' for unknown glyphs */
|
||||
static inline glyph_t *glyph(uint8_t *character) { return glyph(*character); }
|
||||
static glyph_t *glyph(uint8_t *character) { return glyph(*character); }
|
||||
|
||||
static void set();
|
||||
static void add(uint8_t character) { add_character(character); eol(); }
|
||||
@ -89,9 +89,9 @@ class TFT_String {
|
||||
static void add(uint8_t *string, int8_t index, uint8_t *itemString=nullptr);
|
||||
static void set(uint8_t *string) { set(); add(string); };
|
||||
static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); };
|
||||
static inline void set(const char *string) { set((uint8_t *)string); }
|
||||
static inline void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); }
|
||||
static inline void add(const char *string) { add((uint8_t *)string); }
|
||||
static void set(const char *string) { set((uint8_t *)string); }
|
||||
static void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); }
|
||||
static void add(const char *string) { add((uint8_t *)string); }
|
||||
|
||||
static void trim(uint8_t character=0x20);
|
||||
static void rtrim(uint8_t character=0x20);
|
||||
|
@ -106,7 +106,7 @@ class Touch {
|
||||
static millis_t last_touch_ms, time_to_hold, repeat_delay, touch_time;
|
||||
static TouchControlType touch_control_type;
|
||||
|
||||
static inline bool get_point(int16_t *x, int16_t *y);
|
||||
static bool get_point(int16_t *x, int16_t *y);
|
||||
static void touch(touch_control_t *control);
|
||||
static void hold(touch_control_t *control, millis_t delay = 0);
|
||||
|
||||
@ -126,7 +126,7 @@ class Touch {
|
||||
static void enable() { enabled = true; }
|
||||
#if HAS_TOUCH_SLEEP
|
||||
static millis_t next_sleep_ms;
|
||||
static inline bool isSleeping() { return next_sleep_ms == TSLP_SLEEPING; }
|
||||
static bool isSleeping() { return next_sleep_ms == TSLP_SLEEPING; }
|
||||
static void sleepTimeout();
|
||||
static void wakeUp();
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user