Commit debf33a7 authored by Wenxi Xu's avatar Wenxi Xu
Browse files

CMake and Kconfig update

parent c7d5d2d2
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -6,11 +6,7 @@

# add_definitions(-D__ZEPHYR_SUPERVISOR__)

add_subdirectory_ifdef(CONFIG_MOTOR_DJI motor/dji)

add_subdirectory_ifdef(CONFIG_MOTOR_MI motor/mi)

add_subdirectory_ifdef(CONFIG_MOTOR_DM motor/dm)
add_subdirectory_ifdef(CONFIG_MOTOR_COMMON motor)

add_subdirectory_ifdef(CONFIG_PID pid)

+3 −0
Original line number Diff line number Diff line
# Copyright (c) 2024 ttwards <12411711@mail.sustech.edu.cn>
# SPDX-License-Identifier: Apache-2.0

add_subdirectory_ifdef(CONFIG_MOTOR_DJI dji)

add_subdirectory_ifdef(CONFIG_MOTOR_MI mi)

add_subdirectory_ifdef(CONFIG_MOTOR_DM dm)

add_subdirectory_ifdef(CONFIG_MOTOR_COMMON common)
+15 −0
Original line number Diff line number Diff line
@@ -14,23 +14,32 @@ module = MOTOR
module-str = MOTOR
source "subsys/logging/Kconfig.template.log_config"

config MOTOR_COMMON
    bool "MOTOR COMMON"
    help
      Add support for common motor drivers
	select CAN

config MOTOR_DJI
    bool "MOTOR DJI"
    help
      Add support for dji motors
    select PID
    select MOTOR_COMMON

config MOTOR_DM
    bool "MOTOR DM"
    help
      Add support for dm motors
    select PID
    select MOTOR_COMMON

config MOTOR_MI
    bool "MOTOR MI"
    help
      Add support for mi motors
    select PID
    select MOTOR_COMMON
    
config MOTOR_LOG_LEVEL
    int "Motor log level"
@@ -43,4 +52,10 @@ config MOTOR_INIT_PRIORITY
    default 90
    help
      The init priority of motor driver

config CAN_COUNT
    int "CAN count"
    default 2
    help
      The number of CAN devices
endif
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
# Copyright (c) 2024 ttwards <12411711@mail.sustech.edu.cn>
# SPDX-License-Identifier: Apache-2.0

zephyr_library()
zephyr_library_sources_ifdef(CONFIG_MOTOR_COMMON common.c)