lcd bug, also removed cc
This commit is contained in:
@@ -31,7 +31,4 @@ void lcd_flush_buf(struct lcd_t* lcd);
|
||||
char lcd_bar(struct lcd_t* lcd, uint8_t char_id, double value);
|
||||
int lcd_init(struct lcd_t* lcd);
|
||||
|
||||
inline char cc(const uint8_t c) { return (char)(c % 8); }
|
||||
|
||||
|
||||
#endif
|
||||
@@ -60,7 +60,7 @@ void lcd_set_cursor(struct lcd_t* lcd, const uint8_t row, const uint8_t col) {
|
||||
/* reconsider so im not writing every time. prepend custom chars to the write buffer? */
|
||||
void lcd_set_custom_char(struct lcd_t* lcd, const uint8_t index, const lcd_glyph_t* glyph) {
|
||||
uint8_t cmdbuf[] = {254, 78, index, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
memcpy(&cmdbuf[3], &glyph, sizeof(lcd_glyph_t));
|
||||
memcpy(&cmdbuf[3], glyph, sizeof(lcd_glyph_t));
|
||||
lcd_write(lcd, cmdbuf, sizeof(cmdbuf));
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ inline char lcd_bar(struct lcd_t* lcd, const uint8_t char_id, const double value
|
||||
for (uint8_t i = 0; i < (1.0 - value) * 8; i++)
|
||||
b[i] = 0;
|
||||
lcd_set_custom_char(lcd, char_id, &b);
|
||||
return cc(char_id);
|
||||
return (char)char_id;
|
||||
}
|
||||
|
||||
int lcd_init(struct lcd_t* lcd) {
|
||||
|
||||
Reference in New Issue
Block a user