Commit 5932ece6 authored by Wenxi XU's avatar Wenxi XU
Browse files

删除不完整的test

parent ee4b6a90
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
set(CMAKE_CXX_STANDARD 17)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(motor)

FILE(GLOB app_sources src/*.c)

include_directories(${ZEPHYR_BASE}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/dts)
target_sources(app PRIVATE ${app_sources})
target_include_directories(app PRIVATE ${ZEPHYR_BASE}/include)
target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/dts)

test/dji_motor_test/README.rst

deleted100644 → 0
+0 −51
Original line number Diff line number Diff line
.. zephyr:code-sample:: can-babbling
   :name: Controller Area Network (CAN) babbling node
   :relevant-api: can_interface

   Simulate a babbling CAN node.

Overview
********

In a Controller Area Network a babbling node is a node continuously (and usually erroneously)
transmitting CAN frames with identical - often high - priority. This constant babbling blocks CAN
bus access for any CAN frame with lower priority as these frames will loose the bus arbitration.

This sample application simulates a babbling CAN node. The properties of the CAN frames sent are
configurable via :ref:`Kconfig <kconfig>`. The frames carry no data as only the arbitration part of
the CAN frame is of interest.

Being able to simulate a babbling CAN node is useful when examining the behavior of other nodes on
the same CAN bus when they constantly loose bus arbitration.

The source code for this sample application can be found at:
:zephyr_file:`samples/drivers/can/babbling`.

Requirements
************

This sample requires a board with a CAN controller. The CAN controller must be configured using the
``zephyr,canbus`` :ref:`devicetree <dt-guide>` chosen node property.

The sample supports an optional button for stopping the babbling. If present, the button must be
configured using the ``sw0`` :ref:`devicetree <dt-guide>` alias, usually in the :ref:`BOARD.dts file
<devicetree-in-out-files>`.

Building and Running
********************

Example building for :ref:`twr_ke18f`:

.. zephyr-app-commands::
   :zephyr-app: samples/drivers/can/babbling
   :board: twr_ke18f
   :goals: build flash

Sample output
=============

.. code-block:: console

   *** Booting Zephyr OS build zephyr-v3.1.0-4606-g8c1efa8b96bb  ***
   babbling on can@40024000 with standard (11-bit) CAN ID 0x010, RTR 0, CAN FD 0
   abort by pressing User SW3 button
+0 −35
Original line number Diff line number Diff line
/ {
	motor0: motor0{
		compatible = "dji,motor";
		is_m3508;
		id = <1>;
		rx_id = <0x201>;
		tx_id = <0x200>;
		gear_ratio = "19.20";
		status = "okay";
		can_channel = <&canbus1>;
		controllers = <&angle_pid_1 &speed_pid_1>;
		capabilities = "angle", "speed";
	};

	pid {
		angle_pid_1: angle_pid_1 {
			#controller-cells = <0>;
			compatible = "pid,single";
			k_p = "7";
			k_i = "0.3";
			k_d = "80";
		};
		speed_pid_1: speed_pid_1 {
			#controller-cells = <0>;
			compatible = "pid,single";
			k_p = "1.8";
			k_i = "2.0";
			k_d = "2";
		};
	};
	sbus0: sbus0 {
		compatible = "ares,sbus";
		status = "okay";
	};
};
 No newline at end of file
+0 −35
Original line number Diff line number Diff line
/ {
	motor0: motor0{
		compatible = "dji,motor";
		is_m3508;
		id = <1>;
		rx_id = <0x201>;
		tx_id = <0x200>;
		gear_ratio = "19.20";
		status = "okay";
		can_channel = <&canbus1>;
		controllers = <&angle_pid_1 &speed_pid_1>;
		capabilities = "angle", "speed";
	};

	pid {
		angle_pid_1: angle_pid_1 {
			#controller-cells = <0>;
			compatible = "pid,single";
			k_p = "7";
			k_i = "0.3";
			k_d = "80";
		};
		speed_pid_1: speed_pid_1 {
			#controller-cells = <0>;
			compatible = "pid,single";
			k_p = "1.8";
			k_i = "2.0";
			k_d = "2";
		};
	};
	sbus0: sbus0 {
		compatible = "ares,sbus";
		status = "okay";
	};
};
 No newline at end of file

test/dji_motor_test/prj.conf

deleted100644 → 0
+0 −67
Original line number Diff line number Diff line

# 启用线程分析器
CONFIG_THREAD_ANALYZER=y
CONFIG_THREAD_ANALYZER_USE_LOG=y
CONFIG_THREAD_ANALYZER_USE_PRINTK=n
CONFIG_THREAD_NAME=y
# CONFIG_THREAD_ANALYZER_AUTO=y
# CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=5
CONFIG_THREAD_ANALYZER_LOG_LEVEL_INF=y
CONFIG_THREAD_ANALYZER_AUTO_SEPARATE_CORES=n

# 启用 Shell 支持
CONFIG_SHELL=n
CONFIG_SHELL_BACKENDS=n
CONFIG_SHELL_BACKEND_SERIAL=n

# 启用 UART 控制台
CONFIG_UART_CONSOLE=y

# 禁用 SEGGER RTT
CONFIG_USE_SEGGER_RTT=n

# 启用事件支持
CONFIG_EVENTS=y

# 启用控制台支持
CONFIG_CONSOLE=y

# 启用日志系统
CONFIG_LOG=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_LOG_PRINTK=y
CONFIG_LOG_BACKEND_UART=y
# CONFIG_LOG_MODE_IMMEDIATE=y

# 启用串行支持
CONFIG_SERIAL=y

# 禁用优化
CONFIG_NO_OPTIMIZATIONS=y
CONFIG_COMPILER_OPT=""

# 启用驱动
CONFIG_MOTOR=y
CONFIG_MOTOR_DJI=y
CONFIG_MOTOR_LOG_LEVEL=4
CONFIG_CAN=y
CONFIG_MOTOR_INIT_PRIORITY=90

CONFIG_ARES=y

# use ASYNC uart API
CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y
CONFIG_UART_INTERRUPT_DRIVEN=y

CONFIG_DMA=y
CONFIG_DMA_STM32=y  # STM32 DMA 驱动
CONFIG_UART_STM32=y # STM32 UART 驱动
# CONFIG_STM32_UART_DMA=y

# CONFIG_HAS_STM32CUBE=y
# CONFIG_USE_STM32_HAL_DMA=y
CONFIG_SPI=y
CONFIG_SPI_STM32=y

CONFIG_DEBUG=y
 No newline at end of file
Loading