- Added MainUI class for displaying voice state, status icon, and buttons. - Introduced MainUIHandler to manage UI interactions and bridge communication. - Created SettingsUI for displaying QR code and configuration instructions. - Implemented SettingsUIHandler to manage settings and web server interactions. - Developed WebHandler for handling HTTP requests for settings configuration. - Updated AppRegistry to initialize with the new Discord app descriptor. - Enhanced InteractionHandler to support keyboard interactions across app switches. - Updated UIHandler to manage app switching and rendering of app icons. - Enabled QR code support in LVGL configuration.
42 lines
2.1 KiB
CMake
42 lines
2.1 KiB
CMake
set(requires esp-tls spi_flash nvs_flash esp_event esp_netif esp_http_client esp_http_server esp_wifi esp_psram esp_lvgl_port)
|
|
file(GLOB_RECURSE SRCS "main.cpp" "*.cpp" "*.c" "ui/**/*.cpp" "ui/**/*.c" "external/**/*.cpp" "external/**/*.c")
|
|
|
|
|
|
# Path to the source JSON in this component
|
|
set(ASSETS_SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/../assets)
|
|
set(ASSETS_BINARY_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/assets)
|
|
set(MTR_JSON_SRC ${ASSETS_SRC_DIR}/MTR_LINE_STATION.json)
|
|
set(MTR_JSON_HEADER ${ASSETS_BINARY_OUTPUT_DIR}/MTR_LINE_STATION.h)
|
|
set(CUSTOM_CMAKE_MODULES_DIR ${CMAKE_CURRENT_LIST_DIR}/cmake)
|
|
|
|
## Generate a minified header at configure time using Python
|
|
find_package(Python3 COMPONENTS Interpreter)
|
|
file(MAKE_DIRECTORY ${ASSETS_BINARY_OUTPUT_DIR})
|
|
if (Python3_Interpreter_FOUND)
|
|
execute_process(
|
|
COMMAND ${Python3_EXECUTABLE} -c "import json,sys,io; sys.stdout.write(json.dumps(json.load(open(sys.argv[1], 'r', encoding='utf-8')),separators=(',',':')))"
|
|
"${MTR_JSON_SRC}"
|
|
RESULT_VARIABLE _mtr_json_minify_result
|
|
OUTPUT_VARIABLE MTR_JSON_MINIFIED
|
|
ERROR_VARIABLE _mtr_json_minify_error
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
if (_mtr_json_minify_result)
|
|
message(WARNING "Python minify failed (code=${_mtr_json_minify_result}): ${_mtr_json_minify_error}\nEmbedding original ${MTR_JSON_SRC} instead.")
|
|
file(READ ${MTR_JSON_SRC} MTR_JSON_MINIFIED)
|
|
elseif (NOT MTR_JSON_MINIFIED)
|
|
message(WARNING "Python minified output empty; embedding original ${MTR_JSON_SRC} instead.")
|
|
file(READ ${MTR_JSON_SRC} MTR_JSON_MINIFIED)
|
|
endif()
|
|
else()
|
|
message(WARNING "Python3 not found; embedding original JSON without minification.")
|
|
file(READ ${MTR_JSON_SRC} MTR_JSON_MINIFIED)
|
|
endif()
|
|
|
|
file(WRITE ${MTR_JSON_HEADER} "#pragma once\nstatic const char MTR_LINE_STATION_JSON[] = R\"json(${MTR_JSON_MINIFIED})json\";\n")
|
|
|
|
|
|
idf_component_register(SRCS ${SRCS}
|
|
PRIV_REQUIRES ${requires}
|
|
INCLUDE_DIRS "." "${CMAKE_CURRENT_BINARY_DIR}" "display" "network" "ui" "ui/apps" "io" "common" "external")
|