Centralize command dispatch over a FreeRTOS queue so UART and future ESP-NOW transports can register handlers; implement the protobuf VERSION command with framed nanopb responses including build git hash. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
600 B
CMake
27 lines
600 B
CMake
execute_process(
|
|
COMMAND git -C ${CMAKE_CURRENT_LIST_DIR}/.. rev-parse --short=8 HEAD
|
|
OUTPUT_VARIABLE POWERPOD_GIT_HASH
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
ERROR_QUIET)
|
|
if(NOT POWERPOD_GIT_HASH)
|
|
set(POWERPOD_GIT_HASH "unknown")
|
|
endif()
|
|
|
|
idf_component_register(
|
|
SRCS
|
|
"powerpod.c"
|
|
"led_ring.c"
|
|
"uart.c"
|
|
"uart_proto.c"
|
|
"cmd_handler.c"
|
|
"cmd_version.c"
|
|
"proto/uart_messages.pb.c"
|
|
"proto/pb_encode.c"
|
|
"proto/pb_common.c"
|
|
INCLUDE_DIRS
|
|
"."
|
|
"proto")
|
|
|
|
target_compile_definitions(${COMPONENT_LIB}
|
|
PRIVATE "POWERPOD_GIT_HASH=\"${POWERPOD_GIT_HASH}\"")
|