🎨 Apply F() to UTF-8/MMU2 string put

This commit is contained in:
Scott Lahteine
2021-09-25 23:52:41 -05:00
parent 12b5d997a2
commit eeffac697c
20 changed files with 129 additions and 115 deletions

View File

@@ -152,17 +152,20 @@ void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row);
/**
* @brief Draw a ROM UTF-8 string
*
* @param utf8_str_P : the ROM UTF-8 string
* @param utf8_pstr : the ROM UTF-8 string
* @param max_length : the pixel length of the string allowed (or number of slots in HD44780)
*
* @return the pixel width
*
* Draw a ROM UTF-8 string
*/
int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length);
inline int lcd_put_u8str_max_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P utf8_str_P, pixel_len_t max_length) {
int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length);
inline int lcd_put_u8str_max_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P utf8_pstr, pixel_len_t max_length) {
lcd_moveto(col, row);
return lcd_put_u8str_max_P(utf8_str_P, max_length);
return lcd_put_u8str_max_P(utf8_pstr, max_length);
}
inline int lcd_put_u8str_max(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const utf8_fstr, pixel_len_t max_length) {
return lcd_put_u8str_max_P(col, row, FTOP(utf8_fstr), max_length);
}
void lcd_put_int(const int i);
@@ -177,14 +180,22 @@ inline int lcd_put_u8str_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P con
return lcd_put_u8str_P(pstr);
}
inline int lcd_put_u8str(FSTR_P const fstr) { return lcd_put_u8str_P(FTOP(fstr)); }
inline int lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const fstr) {
return lcd_put_u8str_P(col, row, FTOP(fstr));
}
lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const inStr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH);
inline lcd_uint_t lcd_put_u8str_ind_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P const pstr, const int8_t ind, PGM_P const inStr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) {
lcd_moveto(col, row);
return lcd_put_u8str_ind_P(pstr, ind, inStr, maxlen);
}
inline lcd_uint_t lcd_put_u8str_ind(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const fstr, const int8_t ind, FSTR_P const inFstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) {
return lcd_put_u8str_ind_P(col, row, FTOP(fstr), ind, FTOP(inFstr), maxlen);
}
inline int lcd_put_u8str(const char *str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); }
inline int lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, PGM_P const str) {
inline int lcd_put_u8str(const char * const str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); }
inline int lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, const char * const str) {
lcd_moveto(col, row);
return lcd_put_u8str(str);
}