From 7cb7bf621d0c7fcb9947c57d8873096234d59104 Mon Sep 17 00:00:00 2001 From: Kuristian Date: Fri, 9 Feb 2024 11:54:22 +0100 Subject: [PATCH] lut screen start --- main/CMakeLists.txt | 1 + main/modules/screen_settings.c | 55 +++++++++++++++++++++++++++++++++ resources/Lutdial.png | Bin 0 -> 4374 bytes resources/lutdial.png | Bin 0 -> 1420 bytes 4 files changed, 56 insertions(+) create mode 100644 resources/Lutdial.png create mode 100644 resources/lutdial.png diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index a9c624d..392bff7 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -34,6 +34,7 @@ idf_component_register( ${project_dir}/resources/battery1.png ${project_dir}/resources/battery2.png ${project_dir}/resources/map.png + ${project_dir}/resources/lutdial.png ${project_dir}/resources/pointclick/dock1_e.png ${project_dir}/resources/pointclick/dock1_n.png ${project_dir}/resources/pointclick/dock1_s.png diff --git a/main/modules/screen_settings.c b/main/modules/screen_settings.c index ed859bb..c67a343 100644 --- a/main/modules/screen_settings.c +++ b/main/modules/screen_settings.c @@ -30,6 +30,8 @@ extern const uint8_t battery1_png_start[] asm("_binary_battery1_png_start"); extern const uint8_t battery1_png_end[] asm("_binary_battery1_png_end"); extern const uint8_t battery2_png_start[] asm("_binary_battery2_png_start"); extern const uint8_t battery2_png_end[] asm("_binary_battery2_png_end"); +extern const uint8_t lutdial_png_start[] asm("_binary_lutdial_png_start"); +extern const uint8_t lutdial_png_end[] asm("_binary_lutdial_png_end"); static const char* TAG = "settings"; @@ -482,6 +484,59 @@ screen_t screen_settings_entry(QueueHandle_t application_event_queue, QueueHandl case SWITCH_4: ota_update_wrapped(keyboard_event_queue, false); break; case SWITCH_5: ota_update_wrapped(keyboard_event_queue, true); break; } + break; + default: ESP_LOGE(TAG, "Unhandled event type %u", event.type); + } + } + } +} + +screen_t screen_lut_dial(QueueHandle_t application_event_queue, QueueHandle_t keyboard_event_queue) { + if (log) + ESP_LOGE(TAG, "Enter screen_home_entry"); + // update the keyboard event handler settings + InitKeyboard(keyboard_event_queue); + configure_keyboard_presses(keyboard_event_queue, true, false, false, false, false); + configure_keyboard_rotate_both(keyboard_event_queue, SWITCH_5, true); + int cursor = 0; + epaper_lut_t activeLut = lut_4s; + + while (1) { + pax_buf_t* gfx = bsp_get_gfx_buffer(); + pax_insert_png_buf(gfx, lutdial_png_start, lutdial_png_end - lutdial_png_start, 0, 0, 0); + AddOneTextSWtoBuffer(SWITCH_1, "Exit"); + DrawArrowHorizontal(SWITCH_5); + + switch (cursor) { + case 0: activeLut = lut_1s; break; + case 1: activeLut = lut_4s; break; + case 2: activeLut = lut_8s; break; + case 3: activeLut = lut_full; break; + default: break; + } + + event_t event = {0}; + if (xQueueReceive(application_event_queue, &event, portMAX_DELAY) == pdTRUE) { + switch (event.type) { + case event_input_button: break; // Ignore raw button input + case event_input_keyboard: + switch (event.args_input_keyboard.action) { + case SWITCH_1: return screen_home; break; + case SWITCH_2: break; + case SWITCH_3: break; + case SWITCH_4: break; + case SWITCH_5: break; + case SWITCH_L5: + if (cursor) + cursor--; + break; + case SWITCH_R5: + if (cursor) + cursor++; + break; + } + + break; default: ESP_LOGE(TAG, "Unhandled event type %u", event.type); } diff --git a/resources/Lutdial.png b/resources/Lutdial.png new file mode 100644 index 0000000000000000000000000000000000000000..9c55777ef547aae20ab4b1db7f04417365d33e58 GIT binary patch literal 4374 zcmV+x5$W!UP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf5dZ)S5dnW>Uy%R+02_2gSaefwW^{L9 za%BKRWo&bKb0AZ6b!2I8AXIN}Y{94Dd;kCtgh@m}RCr$Poe7hjwiblPPQ1h!Px=4< z$&{BkUXr{weLX$tIhH_h5lEuHDlTFZlF;dUBm_MB-#yQsJ-fM|-56s`3s94u-G{AA z#+W9t2W5=#&p(&>^XEy2bQm5hjnoliBBk|&w#R*R|HnA) ze`bdn%x&+DKmYvm=JxjXVQD*1MieXX%P+q?gvNoD%9uH>(Uhb>vGP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