Skip to content

Commit 82894bb

Browse files
committed
reverts changes made to RGB bus driver.
1 parent 371a3ee commit 82894bb

File tree

2 files changed

+5
-62
lines changed

2 files changed

+5
-62
lines changed

api_drivers/common_api_drivers/display/rgb_display.py

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import display_driver_framework
2-
import lvgl as lv
32

43
STATE_HIGH = display_driver_framework.STATE_HIGH
54
STATE_LOW = display_driver_framework.STATE_LOW
@@ -11,58 +10,6 @@
1110

1211
class RGBDisplay(display_driver_framework.DisplayDriver):
1312

14-
def __init__(
15-
self,
16-
data_bus,
17-
display_width,
18-
display_height,
19-
frame_buffer1=None,
20-
frame_buffer2=None,
21-
reset_pin=None,
22-
reset_state=STATE_HIGH,
23-
power_pin=None,
24-
power_on_state=STATE_HIGH,
25-
backlight_pin=None,
26-
backlight_on_state=STATE_HIGH,
27-
offset_x=0,
28-
offset_y=0,
29-
color_byte_order=BYTE_ORDER_RGB,
30-
color_space=lv.COLOR_FORMAT.RGB888,
31-
rgb565_byte_swap=False
32-
):
33-
34-
super().__init__(
35-
data_bus=data_bus,
36-
display_width=display_width,
37-
display_height=display_height,
38-
frame_buffer1=frame_buffer1,
39-
frame_buffer2=frame_buffer2,
40-
reset_pin=reset_pin,
41-
reset_state=reset_state,
42-
power_pin=power_pin,
43-
power_on_state=power_on_state,
44-
backlight_pin=backlight_pin,
45-
backlight_on_state=backlight_on_state,
46-
offset_x=offset_x,
47-
offset_y=offset_y,
48-
color_byte_order=color_byte_order,
49-
color_space=color_space,
50-
rgb565_byte_swap=rgb565_byte_swap
51-
)
52-
53-
self.__flushing_fb_index = None
54-
55-
def _flush_ready_cb(self, buf_num):
56-
if (
57-
self.__flushing_fb_index is None or
58-
buf_num != self.__flushing_fb_index
59-
):
60-
self._disp_drv.flush_ready()
61-
self.__flushing_fb_index = buf_num
62-
return True
63-
64-
return False
65-
6613
def _dummy_set_memory_location(self, *_, **__):
6714
return 0x00
6815

ext_mod/lcd_bus/esp32_src/rgb_bus.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
uint8_t bb_fb_index; // Current frame buffer index which used by bounce buffer
5454
} rgb_panel_t;
5555

56-
bool callback_from_isr(mp_obj_t cb, uint8_t buf_num)
56+
bool callback_from_isr(mp_obj_t cb)
5757
{
5858
volatile uint32_t sp = (uint32_t)esp_cpu_get_sp();
5959
bool ret = false;
@@ -74,11 +74,8 @@
7474

7575
nlr_buf_t nlr;
7676
if (nlr_push(&nlr) == 0) {
77-
mp_obj_t args[1] = { mp_obj_new_int_from_uint(buf_num) };
78-
mp_obj_t ret_val = mp_call_function_n_kw(cb, 1, 0, &args[0]);
79-
if ((ret_val != mp_const_none) && mp_obj_is_integer(ret_val) && (mp_obj_get_int_truncated(ret_val) == 1)) {
80-
ret = true;
81-
}
77+
mp_call_function_n_kw(cb,0, 0, NULL);
78+
ret = true;
8279
nlr_pop();
8380
} else {
8481
ets_printf("Uncaught exception in IRQ callback handler!\n");
@@ -89,12 +86,11 @@
8986
mp_sched_unlock();
9087

9188
mp_thread_set_state(old_state);
92-
// mp_hal_wake_main_task_from_isr();
89+
mp_hal_wake_main_task_from_isr();
9390

9491
return ret;
9592
}
9693

97-
9894
IRAM_ATTR static bool rgb_bus_trans_done_cb(esp_lcd_panel_handle_t panel, const esp_lcd_rgb_panel_event_data_t *edata, void *user_ctx)
9995
{
10096
LCD_UNUSED(edata);
@@ -104,7 +100,7 @@
104100
bool ret = false;
105101

106102
if (self->callback != mp_const_none && mp_obj_is_callable(self->callback)) {
107-
ret = callback_from_isr(self->callback, (uint8_t)rgb_panel->cur_fb_index);
103+
ret = callback_from_isr(self->callback);
108104
}
109105
return ret;
110106
}

0 commit comments

Comments
 (0)