UltraLCD enhancements (lower fan resolution, backlash menu) (#13519)

This commit is contained in:
Marcio Teixeira
2019-03-29 13:07:43 -06:00
committed by Scott Lahteine
parent de0f35f2d9
commit 5679fae11e
13 changed files with 123 additions and 24 deletions

View File

@@ -55,6 +55,9 @@ inline void serial_delay(const millis_t ms) {
#if ANY(ULTRA_LCD, DEBUG_LEVELING_FEATURE, EXTENSIBLE_UI)
// Convert a full-range unsigned 8bit int to a percentage
char* ui8tostr_percent(const uint8_t i);
// Convert uint8_t to string with 123 format
char* ui8tostr3(const uint8_t x);
@@ -135,3 +138,8 @@ public:
#define REMEMBER(N,X, ...) restorer<typeof(X)> restorer_##N(X, ##__VA_ARGS__)
#define RESTORE(N) restorer_##N.restore()
// Converts from an uint8_t in the range of 0-255 to an uint8_t
// in the range 0-100 while avoiding rounding artifacts
constexpr uint8_t ui8_to_percent(const uint8_t i) { return (int(i) * 100 + 127) / 255; }
constexpr uint8_t all_on = 0xFF, all_off = 0x00;