Description
What MCU/Processor/Board and compiler are you using?
STM32F407 Discovery kit gcc-arm-none-eabi
What do you want to achieve?
To display anything on the screen
What have you tried so far?
Followed both the STM32 and the porting guide.I am using the ST7735 160x80 screen and its library works.But the flush_cb()
will not get called.The lv_port_disp_init()
initializes the ST7735, so i guess there is a bug in my code, because the example in the introduction
page works perfectly fine(I am referring to the last given code snippet in this post) .I am filling the screen with a color, but the LVGL will not do anything afterwards
Code to reproduce
lv_log_register_print_cb(my_print);
lv_init();
lv_port_disp_init();
ST7735_FillScreen(ST7735_BLUE);
lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0x003a57), LV_PART_MAIN);
lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0xffffff), LV_PART_MAIN);
lv_obj_t * spinner = lv_spinner_create(lv_screen_active());
lv_obj_set_size(spinner, 64, 64);
lv_obj_align(spinner, LV_ALIGN_BOTTOM_MID, 0, 0);
and the flush_cb()
:
void disp_flush(lv_display_t * disp_drv, const lv_area_t * area, uint8_t * px_map)
{
//see it it gets called by using the led
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_12, 1);
if(disp_flush_enabled) {
int32_t x;
int32_t y;
for(y = area->y1; y <= area->y2; y++) {
for(x = area->x1; x <= area->x2; x++) {
ST7735_DrawPixel(y,x,*px_map);
x_map++;
}
}
}
lv_display_flush_ready(disp_drv);
}
This example works fine :
#define BUF_W 20
#define BUF_H 10
lv_color_t buf[BUF_W * BUF_H];
lv_color_t * buf_p = buf;
uint16_t x, y;
for(y = 0; y < BUF_H; y++) {
lv_color_t c = lv_color_mix(LV_COLOR_BLUE, LV_COLOR_RED, (y * 255) / BUF_H);
for(x = 0; x < BUF_W; x++){
(*buf_p) = c;
buf_p++;
}
}
lv_area_t a;
a.x1 = 10;
a.y1 = 40;
a.x2 = a.x1 + BUF_W - 1;
a.y2 = a.y1 + BUF_H - 1;
disp_flush(NULL, &a, buf);