|
71 | 71 |
|
72 | 72 | static bool rgb_init_cb(void *self_in)
|
73 | 73 | {
|
| 74 | + LCD_DEBUG_PRINT("rgb_init_cb\n") |
| 75 | + |
74 | 76 | mp_lcd_rgb_bus_obj_t *self = (mp_lcd_rgb_bus_obj_t *)self_in;
|
75 | 77 | mp_lcd_sw_rotation_init_t *init = &self->sw_rot.init;
|
76 | 78 |
|
|
81 | 83 | esp_lcd_rgb_panel_event_callbacks_t callbacks = { .on_vsync = rgb_trans_done_cb };
|
82 | 84 |
|
83 | 85 | LCD_DEBUG_PRINT("esp_lcd_new_rgb_panel\n")
|
84 |
| - |
85 | 86 | init->err = esp_lcd_new_rgb_panel(self->panel_io_config, &self->panel_handle);
|
86 | 87 | if (init->err != 0) {
|
87 | 88 | init->err_msg = MP_ERROR_TEXT("%d(esp_lcd_new_rgb_panel)");
|
|
366 | 367 | LCD_UNUSED(cmd_bits);
|
367 | 368 | LCD_UNUSED(param_bits);
|
368 | 369 |
|
369 |
| - mp_lcd_rgb_bus_obj_t *self = (mp_lcd_rgb_bus_obj_t *)obj; |
| 370 | + mp_lcd_rgb_bus_obj_t *self = (mp_lcd_rgb_bus_obj_t *)MP_OBJ_TO_PTR(obj); |
| 371 | + mp_lcd_sw_rotation_data_t *data = &self->sw_rot.data; |
370 | 372 |
|
371 | 373 | self->sw_rotate = 1;
|
372 | 374 |
|
373 |
| - if (self->sw_rot.data.bytes_per_pixel != 2) self->sw_rot.data.rgb565_swap = 0; |
| 375 | + if (data->bytes_per_pixel != 2) data->rgb565_swap = 0; |
374 | 376 |
|
375 |
| - if (self->sw_rot.data.rgb565_swap && self->panel_io_config->data_width == 16) { |
| 377 | + if (data->rgb565_swap && self->panel_io_config->data_width == 16) { |
376 | 378 | /*
|
377 | 379 | We change the pins aound when the bus width is 16 and wanting to
|
378 | 380 | swap bytes. This does the same thing as moving the bytes around in
|
|
389 | 391 | self->panel_io_config->data_gpio_nums[i + 8] = temp_pin;
|
390 | 392 | }
|
391 | 393 |
|
392 |
| - self->sw_rot.data.rgb565_swap = 0; |
| 394 | + data->rgb565_swap = 0; |
393 | 395 | }
|
394 | 396 |
|
395 |
| - self->panel_io_config->timings.h_res = self->sw_rot.data.dst_width; |
396 |
| - self->panel_io_config->timings.v_res = self->sw_rot.data.dst_height; |
397 |
| - self->panel_io_config->bits_per_pixel = self->sw_rot.data.bytes_per_pixel * 8; |
| 397 | + self->panel_io_config->timings.h_res = data->dst_width; |
| 398 | + self->panel_io_config->timings.v_res = data->dst_height; |
| 399 | + self->panel_io_config->bits_per_pixel = data->bytes_per_pixel * 8; |
398 | 400 | self->panel_io_config->flags.fb_in_psram = 1;
|
399 | 401 | self->panel_io_config->flags.double_fb = 1;
|
400 | 402 |
|
|
408 | 410 | LCD_DEBUG_PRINT("h_res=%lu\n", self->panel_io_config->timings.h_res)
|
409 | 411 | LCD_DEBUG_PRINT("v_res=%lu\n", self->panel_io_config->timings.v_res)
|
410 | 412 | LCD_DEBUG_PRINT("bits_per_pixel=%d\n", self->panel_io_config->bits_per_pixel)
|
411 |
| - LCD_DEBUG_PRINT("rgb565_byte_swap=%d\n", self->sw_rot.data.rgb565_swap) |
| 413 | + LCD_DEBUG_PRINT("rgb565_byte_swap=%d\n", data->rgb565_swap) |
412 | 414 |
|
413 | 415 | return LCD_OK;
|
414 | 416 | }
|
|
0 commit comments