oled shows temp correctly
This commit is contained in:
@@ -53,12 +53,8 @@ static void example_lvgl_flush_cb(lv_display_t *disp, const lv_area_t *area, uin
|
||||
}
|
||||
}
|
||||
// pass the draw buffer to the driver
|
||||
ESP_LOGI("FLUSH",
|
||||
"area: (%d,%d)-(%d,%d), display: %dx%d",
|
||||
x1, y1, x2, y2,
|
||||
lv_display_get_horizontal_resolution(disp),
|
||||
lv_display_get_vertical_resolution(disp));
|
||||
esp_lcd_panel_draw_bitmap(panel_handle, x1, y1, x2 + 1, y2 + 1, oled_buffer);
|
||||
lv_display_flush_ready(disp);
|
||||
}
|
||||
|
||||
lv_display_t* ygg_sh1106_init() {
|
||||
@@ -139,9 +135,10 @@ lv_display_t* ygg_sh1106_init() {
|
||||
return display;
|
||||
}
|
||||
|
||||
void ygg_set_display_label(lv_display_t *display, lv_obj_t *label, char *str) {
|
||||
void ygg_set_display_label(lv_display_t *display, lv_obj_t *label, const char *str) {
|
||||
lv_label_set_text(label, str);
|
||||
/* Size of the screen (if you use rotation 90 or 270, please use lv_display_get_vertical_resolution) */
|
||||
lv_obj_set_width(label, lv_display_get_horizontal_resolution(display));
|
||||
lv_obj_set_style_text_align(label, LV_TEXT_ALIGN_CENTER, 0);
|
||||
lv_obj_align(label, LV_ALIGN_TOP_MID, 0, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user