- 将UI相关的代码从display_module.c中提取到新的display_ui.c文件 - 创建display_ui.h头文件定义UI模型和接口函数 - 在CMakeLists.txt中添加UI目录包含路径和源文件引用 - 修改display_module.c中的UI相关数据结构和函数调用 - 将UI创建和刷新逻辑替换为对新UI模块的调用 - 优化了时间日期文本的更新机制,提高性能 - 移除了原有的内部UI实现代码,保持模块职责清晰
64 lines
2.0 KiB
CMake
64 lines
2.0 KiB
CMake
cmake_minimum_required(VERSION 3.20.0)
|
|
|
|
if(EXISTS "E:/extra/modules/ip5306")
|
|
list(APPEND ZEPHYR_EXTRA_MODULES "E:/extra/modules/ip5306")
|
|
endif()
|
|
|
|
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
|
|
|
project(new_kbd)
|
|
|
|
zephyr_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc)
|
|
zephyr_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/events)
|
|
zephyr_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/ui)
|
|
|
|
zephyr_compile_definitions(
|
|
LV_LVGL_H_INCLUDE_SIMPLE=1
|
|
LV_FONT_MONTSERRAT_14=0
|
|
LV_FONT_UNSCII_8=0
|
|
LV_FONT_DEFAULT=\&ui_font_keyboard_small_18
|
|
"LV_FONT_CUSTOM_DECLARE=LV_FONT_DECLARE(ui_font_keyboard_small_18) LV_FONT_DECLARE(ui_font_keyboard_time_48)"
|
|
)
|
|
|
|
target_compile_definitions(app PRIVATE
|
|
APP_HID_KEYMAP_DEF_PATH=\"hid_keymap_def.h\"
|
|
)
|
|
|
|
target_sources(app PRIVATE
|
|
src/main.c
|
|
src/events/battery_status_event.c
|
|
src/events/config_event.c
|
|
src/events/display_theme_event.c
|
|
src/events/hid_boot_event.c
|
|
src/events/hid_host_ack_event.c
|
|
src/events/hid_host_command_error_event.c
|
|
src/events/hid_host_command_event.c
|
|
src/events/hid_protocol_event.c
|
|
src/events/hid_report_event.c
|
|
src/events/hid_tx_done_event.c
|
|
src/events/hid_tx_event.c
|
|
src/events/hid_vendor_mask_event.c
|
|
src/events/keyboard_led_event.c
|
|
src/events/mode_event.c
|
|
src/events/qdec_step_event.c
|
|
src/events/time_sync_event.c
|
|
src/modules/battery_module.c
|
|
src/modules/ble_adv_ctrl_module.c
|
|
src/modules/ble_battery_module.c
|
|
src/modules/ble_bond_module.c
|
|
src/modules/ble_slot_ctrl_module.c
|
|
src/modules/display_module.c
|
|
src/modules/hid_host_command_module.c
|
|
src/modules/hid_tx_manager_module.c
|
|
src/modules/keyboard_module.c
|
|
src/modules/led_state_module.c
|
|
src/modules/mode_switch_module.c
|
|
src/modules/qdec_module.c
|
|
src/modules/time_manager_module.c
|
|
src/modules/usb_hid_module.c
|
|
src/modules/ble_hid_module.c
|
|
src/ui/display_ui.c
|
|
src/ui/fonts/ui_font_keyboard_small_18.c
|
|
src/ui/fonts/ui_font_keyboard_time_48.c
|
|
)
|