powerpods/main/CMakeLists.txt
simon e5db0b21c7 Add optional BMA456 accelerometer init on shared I2C bus.
Probe and configure the sensor when present; log and continue boot if
init fails so boards without BMA456 still run normally.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 22:51:32 +02:00

45 lines
901 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"
"cmd_client_info.c"
"client_registry.c"
"esp_now_comm.c"
"esp_now_proto.c"
"bosch456.c"
"proto/uart_messages.pb.c"
"proto/esp_now_messages.pb.c"
"proto/pb_encode.c"
"proto/pb_decode.c"
"proto/pb_common.c"
INCLUDE_DIRS
"."
"proto"
REQUIRES
esp_wifi
esp_netif
esp_event
nvs_flash
PRIV_REQUIRES
esp_driver_gpio
esp_driver_uart
esp_driver_i2c
app_update
bma456)
target_compile_definitions(${COMPONENT_LIB}
PRIVATE "POWERPOD_GIT_HASH=\"${POWERPOD_GIT_HASH}\"")