Skip to content

Commit 0e05a9d

Browse files
committed
moved around the init lock...
1 parent 4330733 commit 0e05a9d

File tree

6 files changed

+5
-12
lines changed

6 files changed

+5
-12
lines changed

ext_mod/lcd_bus/src/common/modlcd_bus.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ static mp_obj_t mp_lcd_bus_init(size_t n_args, const mp_obj_t *pos_args, mp_map_
118118
mp_lcd_lock_init(&self->sw_rot.handles.tx_color_lock);
119119
mp_lcd_event_init(&self->sw_rot.handles.copy_task_exit);
120120
mp_lcd_event_init(&self->sw_rot.handles.swap_bufs);
121-
mp_lcd_event_set(&self->sw_rot.handles.swap_bufs);
122121
mp_lcd_lock_init(&self->sw_rot.handles.init_lock);
123-
mp_lcd_lock_acquire(&self->sw_rot.handles.init_lock);
124122
mp_lcd_lock_init(&self->sw_rot.tx_params.lock);
125123

126124
ret = self->panel_io_handle.init(

ext_mod/lcd_bus/src/common/sw_rotate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,8 @@ void rotate_16bpp_swap(uint16_t *src, uint16_t *dst, mp_lcd_sw_rotation_data_t *
421421
dst_height -= 1;
422422

423423
for (uint32_t y = y_start; y < y_end; y++) {
424+
src_line_bytes = (y * src_bytes_per_line) - offset;
425+
424426
for (uint32_t x = x_start; x < x_end; x++) {
425427
i = src_line_bytes + x;
426428
j = ((dst_height - x) * dst_width) + y;

ext_mod/lcd_bus/src/common/sw_rotate_task_common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ void mp_lcd_sw_rotate_task(void *self_in)
3838
int cmd;
3939

4040
mp_lcd_lock_acquire(&handles->copy_lock);
41+
mp_lcd_event_set(&self->sw_rot.handles.swap_bufs);
4142

4243
init->err = LCD_OK;
4344
mp_lcd_lock_release(&handles->init_lock);

ext_mod/lcd_bus/src/esp32/spi_bus.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,6 @@ mp_lcd_err_t spi_init(mp_obj_t obj, uint8_t cmd_bits, uint8_t param_bits)
300300
self->sw_rot.flush_cb = &spi_flush_cb;
301301
self->sw_rot.tx_params.cb = &spi_tx_param_cb;
302302

303-
mp_lcd_lock_init(&self->sw_rot.handles.copy_lock);
304-
mp_lcd_lock_init(&self->sw_rot.handles.tx_color_lock);
305-
mp_lcd_event_init(&self->sw_rot.handles.copy_task_exit);
306-
mp_lcd_event_init(&self->sw_rot.handles.swap_bufs);
307-
mp_lcd_event_set(&self->sw_rot.handles.swap_bufs);
308-
mp_lcd_lock_init(&self->sw_rot.handles.init_lock);
309-
mp_lcd_lock_acquire(&self->sw_rot.handles.init_lock);
310-
mp_lcd_lock_init(&self->sw_rot.tx_params.lock);
311303
self->sw_rot.tx_params.len = 0;
312304

313305
mp_machine_hw_spi_bus_add_device(&self->spi_device);

ext_mod/lcd_bus/src/esp32/sw_rotate_task.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,14 @@ bool mp_lcd_start_rotate_task(void *self_in)
117117
{
118118
mp_lcd_bus_obj_t *self = (mp_lcd_bus_obj_t *)self_in;
119119

120+
mp_lcd_lock_acquire(&self->sw_rot.handles.init_lock);
121+
120122
xTaskCreatePinnedToCore(
121123
mp_lcd_sw_rotate_task, "rotate_task", LCD_DEFAULT_STACK_SIZE / sizeof(StackType_t),
122124
self, ESP_TASK_PRIO_MAX - 1, &self->sw_rot.handles.task_handle, 0);
123125

124126
mp_lcd_lock_acquire(&self->sw_rot.handles.init_lock);
125127
mp_lcd_lock_release(&self->sw_rot.handles.init_lock);
126-
mp_lcd_lock_delete(&self->sw_rot.handles.init_lock);
127128

128129
if (self->sw_rot.init.err != LCD_OK) {
129130
mp_raise_msg_varg(&mp_type_OSError, self->sw_rot.init.err_msg, self->sw_rot.init.err);

ext_mod/lcd_bus/src/posix/sw_rotate_task.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ bool mp_lcd_start_rotate_task(void *self_in)
182182

183183
mp_lcd_lock_acquire(&self->sw_rot.handles.init_lock);
184184
mp_lcd_lock_release(&self->sw_rot.handles.init_lock);
185-
mp_lcd_lock_delete(&self->sw_rot.handles.init_lock);
186185

187186
if (self->sw_rot.init.err != LCD_OK) {
188187
mp_raise_msg_varg(&mp_type_OSError, self->sw_rot.init.err_msg, self->sw_rot.init.err);

0 commit comments

Comments
 (0)