Skip to content

Commit 4186466

Browse files
author
Greg Smith
committed
- Fixed UI random freeze issue on JC3248/Waveshare 3.5B (thanks LariBasillio for reporting)
- Enabled flashing tempo indicator in JC3248/Waveshare 3.5B platforms - swapped the left/right gesture for preset next/previous to be more intuitive, like a book pages (thanks LariBasillio for suggestion)
1 parent 8b6bfb2 commit 4186466

File tree

8 files changed

+52
-29
lines changed

8 files changed

+52
-29
lines changed

build_distrib/build_distrib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
dirname = Path.cwd()
1010

1111
# set version
12-
version = '2.0.2.2_beta_2'
12+
version = '2.0.2.2_beta_3'
1313

1414
def delete_files_in_folder(directory):
1515
for filename in os.listdir(directory):

source/main/display.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,12 @@ void __attribute__((unused)) action_gesture(lv_event_t * e)
313313
dir = platform_adjust_gesture(dir);
314314

315315
// called from LVGL
316-
if (dir == LV_DIR_LEFT)
316+
if (dir == LV_DIR_RIGHT)
317317
{
318318
ESP_LOGI(TAG, "UI Previous Swipe");
319319
control_request_preset_down();
320320
}
321-
else if (dir == LV_DIR_RIGHT)
321+
else if (dir == LV_DIR_LEFT)
322322
{
323323
ESP_LOGI(TAG, "UI Next Swipe");
324324
control_request_preset_up();

source/main/platform_jc3248w.c

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static const char *TAG = "platform_jc3248w";
9595
#define BUF_SIZE (1024)
9696
#define I2C_MASTER_TIMEOUT_MS 1000
9797
#define I2C_AXS15231B_ADDRESS (0x3B)
98-
98+
#define TRANS_DONE_TIMEOUT 100 //msec
9999
typedef bool (*lvgl_port_wait_cb)(void *handle);
100100

101101
static SemaphoreHandle_t I2CMutexHandle;
@@ -106,7 +106,7 @@ static esp_lcd_panel_handle_t lcd_panel = NULL;
106106
static esp_lcd_touch_handle_t tp = NULL;
107107
static esp_lcd_panel_io_handle_t tp_io_handle = NULL;
108108
static lv_indev_drv_t indev_drv; // Input device driver (Touch)
109-
static uint32_t trans_size = LCD_BUFFER_SIZE / 15;
109+
static uint32_t trans_size = LCD_BUFFER_SIZE / 5;
110110
static lv_color_t* trans_buf_1 = NULL;
111111
static lv_color_t* trans_buf_2 = NULL;
112112
static lv_color_t* trans_act = NULL;
@@ -448,13 +448,27 @@ static void lvgl_port_flush_callback(lv_disp_drv_t *drv, const lv_area_t *area,
448448
{
449449
draw_wait_cb(drv->user_data);
450450
}
451-
xSemaphoreGive(trans_done_sem);
451+
452+
if (xSemaphoreGive(trans_done_sem) != pdTRUE)
453+
{
454+
//ESP_LOGE(TAG, "Transfer sempahore give timeout");
455+
}
452456
}
453457

454-
xSemaphoreTake(trans_done_sem, portMAX_DELAY);
458+
if (xSemaphoreTake(trans_done_sem, pdMS_TO_TICKS(TRANS_DONE_TIMEOUT)) == pdTRUE)
459+
{
460+
esp_err_t res = esp_lcd_panel_draw_bitmap(panel_handle, x_draw_start, y_draw_start, x_draw_end + 1, y_draw_end + 1, to);
461+
if (res != ESP_OK)
462+
{
463+
ESP_LOGE(TAG, "Failed to draw bitmap %d", res);
464+
}
465+
}
466+
else
467+
{
468+
ESP_LOGE(TAG, "Transfer sempahore take timeout");
469+
break;
470+
}
455471

456-
esp_lcd_panel_draw_bitmap(panel_handle, x_draw_start, y_draw_start, x_draw_end + 1, y_draw_end + 1, to);
457-
458472
if (LV_DISP_ROT_90 == rotation_setting)
459473
{
460474
x_start_tmp += max_width;
@@ -550,13 +564,13 @@ void platform_init(i2c_master_bus_handle_t bus_handle, SemaphoreHandle_t I2CMute
550564
lv_color_t* buf2 = NULL;
551565
lv_color_t* buf3 = NULL;
552566

553-
buf1 = heap_caps_malloc(LCD_BUFFER_SIZE * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);
567+
buf1 = heap_caps_aligned_alloc(32, LCD_BUFFER_SIZE * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);
554568

555-
buf2 = heap_caps_malloc(trans_size * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);
569+
buf2 = heap_caps_aligned_alloc(32, trans_size * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);
556570
assert(buf2);
557571
trans_buf_1 = buf2;
558572

559-
buf3 = heap_caps_malloc(trans_size * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);
573+
buf3 = heap_caps_aligned_alloc(32, trans_size * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);
560574
assert(buf3);
561575
trans_buf_2 = buf3;
562576

source/main/platform_ws35b.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static esp_lcd_touch_handle_t tp = NULL;
107107
static esp_lcd_panel_io_handle_t tp_io_handle = NULL;
108108
static lv_indev_drv_t indev_drv; // Input device driver (Touch)
109109
static esp_io_expander_handle_t expander_handle = NULL;
110-
static uint32_t trans_size = LCD_BUFFER_SIZE / 15;
110+
static uint32_t trans_size = LCD_BUFFER_SIZE / 5;
111111
static lv_color_t* trans_buf_1 = NULL;
112112
static lv_color_t* trans_buf_2 = NULL;
113113
static lv_color_t* trans_act = NULL;
@@ -495,16 +495,24 @@ static void lvgl_port_flush_callback(lv_disp_drv_t *drv, const lv_area_t *area,
495495
{
496496
draw_wait_cb(drv->user_data);
497497
}
498-
xSemaphoreGive(trans_done_sem);
498+
499+
if (xSemaphoreGive(trans_done_sem) != pdTRUE)
500+
{
501+
//ESP_LOGE(TAG, "Transfer sempahore give timeout");
502+
}
499503
}
500504

501505
if (xSemaphoreTake(trans_done_sem, pdMS_TO_TICKS(TRANS_DONE_TIMEOUT)) == pdTRUE)
502506
{
503-
esp_lcd_panel_draw_bitmap(panel_handle, x_draw_start, y_draw_start, x_draw_end + 1, y_draw_end + 1, to);
507+
esp_err_t res = esp_lcd_panel_draw_bitmap(panel_handle, x_draw_start, y_draw_start, x_draw_end + 1, y_draw_end + 1, to);
508+
if (res != ESP_OK)
509+
{
510+
ESP_LOGE(TAG, "Failed to draw bitmap %d", res);
511+
}
504512
}
505513
else
506514
{
507-
ESP_LOGE(TAG, "Transfer sempahore timeout");
515+
ESP_LOGE(TAG, "Transfer sempahore take timeout");
508516
break;
509517
}
510518

@@ -607,13 +615,13 @@ void platform_init(i2c_master_bus_handle_t bus_handle, SemaphoreHandle_t I2CMute
607615
lv_color_t* buf2 = NULL;
608616
lv_color_t* buf3 = NULL;
609617

610-
buf1 = heap_caps_malloc(LCD_BUFFER_SIZE * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);
618+
buf1 = heap_caps_aligned_alloc(32, LCD_BUFFER_SIZE * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);
611619

612-
buf2 = heap_caps_malloc(trans_size * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);
620+
buf2 = heap_caps_aligned_alloc(32, trans_size * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);
613621
assert(buf2);
614622
trans_buf_1 = buf2;
615623

616-
buf3 = heap_caps_malloc(trans_size * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);
624+
buf3 = heap_caps_aligned_alloc(32, trans_size * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);
617625
assert(buf3);
618626
trans_buf_2 = buf3;
619627

source/main/ui_generated_480x320land/screens.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,8 @@ void create_screen_screen1() {
229229
// ui_BPMIndicator
230230
lv_obj_t *obj = lv_obj_create(parent_obj);
231231
objects.ui_bpm_indicator = obj;
232-
lv_obj_set_pos(obj, 410, 143);
233-
lv_obj_set_size(obj, 40, 40);
234-
lv_obj_add_flag(obj, LV_OBJ_FLAG_HIDDEN);
232+
lv_obj_set_pos(obj, 415, 147);
233+
lv_obj_set_size(obj, 30, 30);
235234
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
236235
lv_obj_set_style_bg_color(obj, lv_color_hex(0xffd1a60c), LV_PART_MAIN | LV_STATE_DEFAULT);
237236
lv_obj_set_style_bg_grad_color(obj, lv_color_hex(0xffd1b44d), LV_PART_MAIN | LV_STATE_DEFAULT);

source/sdkconfig.jc3248w

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
2222
CONFIG_LV_COLOR_16_SWAP=y
2323
CONFIG_LV_FONT_MONTSERRAT_18=y
2424
CONFIG_LV_FONT_MONTSERRAT_22=y
25-
CONFIG_LV_FONT_MONTSERRAT_32=y
25+
CONFIG_LV_FONT_MONTSERRAT_32=y
26+
CONFIG_TONEX_CONTROLLER_SHOW_BPM_INDICATOR=y

source/sdkconfig.ws35b

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
2222
CONFIG_LV_COLOR_16_SWAP=y
2323
CONFIG_LV_FONT_MONTSERRAT_18=y
2424
CONFIG_LV_FONT_MONTSERRAT_22=y
25-
CONFIG_LV_FONT_MONTSERRAT_32=y
25+
CONFIG_LV_FONT_MONTSERRAT_32=y
26+
CONFIG_TONEX_CONTROLLER_SHOW_BPM_INDICATOR=y

ui_design_480x320land/Tonex_Controller_480_320.eez-project

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,10 +1087,10 @@
10871087
{
10881088
"objID": "114b30e9-9dc8-460f-854e-711f54e6bb2c",
10891089
"type": "LVGLPanelWidget",
1090-
"left": 410,
1091-
"top": 143,
1092-
"width": 40,
1093-
"height": 40,
1090+
"left": 415,
1091+
"top": 147,
1092+
"width": 30,
1093+
"height": 30,
10941094
"customInputs": [],
10951095
"customOutputs": [],
10961096
"style": {
@@ -1109,7 +1109,7 @@
11091109
"heightUnit": "px",
11101110
"children": [],
11111111
"widgetFlags": "CLICK_FOCUSABLE|GESTURE_BUBBLE|PRESS_LOCK|SCROLL_CHAIN_HOR|SCROLL_CHAIN_VER|SCROLL_ELASTIC|SCROLL_MOMENTUM|SCROLL_WITH_ARROW|SNAPPABLE",
1112-
"hiddenFlag": true,
1112+
"hiddenFlag": false,
11131113
"hiddenFlagType": "literal",
11141114
"clickableFlag": true,
11151115
"clickableFlagType": "literal",

0 commit comments

Comments
 (0)