lvgl_tft/epdiy_epaper.c
/* Required by LVGL. Sends the color_map to the screen with a partial update  */
Required by LVGL. Sends the color_map to the screen with a partial update
Required by LVGL . Sends the color_map to the screen with a partial update
void epdiy_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_map)
{
    ++flushcalls;
    uint16_t w = lv_area_get_width(area);
    uint16_t h = lv_area_get_height(area);
    EpdRect update_area = {
        .x = (uint16_t)area->x1,
        .y = (uint16_t)area->y1,
        .width = w,
        .height = h
    };
    uint8_t* buf = (uint8_t *) color_map;
    buf_copy_to_framebuffer(update_area, buf);
    epd_hl_update_area(&hl, updateMode, temperature, update_area); 
    printf("epdiy_flush %d x:%d y:%d w:%d h:%d\n", flushcalls,(uint16_t)area->x1,(uint16_t)area->y1,w,h);
    lv_disp_flush_ready(drv);
}
void epdiy_flush ( lv_disp_drv_t * drv , const lv_area_t * area , lv_color_t * color_map ) { ++ flushcalls ; uint16_t w = lv_area_get_width ( area ) ; uint16_t h = lv_area_get_height ( area ) ; EpdRect update_area = { . x = ( uint16_t ) area -> x1 , . y = ( uint16_t ) area -> y1 , . width = w , . height = h } ; uint8_t * buf = ( uint8_t * ) color_map ; buf_copy_to_framebuffer ( update_area , buf ) ; epd_hl_update_area ( & hl , updateMode , temperature , update_area ) ; printf ( " \n " , flushcalls , ( uint16_t ) area -> x1 , ( uint16_t ) area -> y1 , w , h ) ; lv_disp_flush_ready ( drv ) ; }
Required by LVGL.
Required by LVGL .
// Buffer debug /* 
    for (int index=0; index<400; index++) {
        printf("%x ", buf[index]);
    } */ // UNCOMMENT only one of this options // SAFE Option with EPDiy copy of epd_copy_to_framebuffer //Faster mode suggested in LVGL forum (Leaves ghosting&prints bad sections / experimental) NOTE: Do NOT use in production //buf_area_to_framebuffer(area, buf); //update_area /* Inform the graphics library that you are ready with the flushing */