Commit 11ea84c8 authored by Wenxi Xu's avatar Wenxi Xu
Browse files

未启用软中断的达妙驱动完毕

parent a393466a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
            "runToEntryPoint": "main",
            "servertype": "openocd",
            "configFiles": [
                "interface/stlink.cfg",
                "interface/cmsis-dap.cfg",
                "target/stm32f4x.cfg"
                // "esp32dap.cfg"
            ],
@@ -36,7 +36,7 @@
            "runToEntryPoint": "main",
            "servertype": "openocd",
            "configFiles": [
                "interface/stlink.cfg",
                "interface/cmsis-dap.cfg",
                "target/stm32f4x.cfg"
            ],
            "gdbPath": "${userHome}/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb"
+26 −55
Original line number Diff line number Diff line
@@ -32,67 +32,39 @@
    },
    "C_Cpp.formatting": "clangFormat",
    "C_Cpp.errorSquiggles": "disabled",
    "stm32-for-vscode.armToolchainPath": false,
    "cortex-debug.variableUseNaturalFormat": false,
    "terminal.integrated.defaultProfile.linux": "Zephyr IDE Terminal",
    "C_Cpp.default.compileCommands": "${workspaceFolder}/.vscode/compile_commands.json",
    "cmake.configureOnOpen": false,
    "zephyr-ide.use-zephyr-ide-json": true,
    "zephyr-ide.projects": null,
    "mcu-debug.rtos-views.showRTOS": false,
    // "clangd.arguments": [
    //     // 在后台自动分析文件(基于complie_commands)
    //     "--background-index",
    //     // 标记compelie_commands.json文件的目录位置
    //     "--compile-commands-dir=build",
    //     // 同时开启的任务数量
    //     "-j=8",
    //     // clang-tidy功能
    //     "--clang-tidy",
    //     // 全局补全(会自动补充头文件)
    //     "--all-scopes-completion",
    //     // 详细补全
    //     "--completion-style=detailed",
    //     // 补充头文件
    //     "--header-insertion=iwyu",
    //     // pch优化的位置
    //     "--pch-storage=disk",
	// 	"--query-driver=${userHome}/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/*"
    // ],
    "terminal.integrated.defaultProfile.osx": "zsh",
    "terminal.integrated.profiles.osx": {
        "zsh": {
            "path": "/bin/zsh",
            "args": []
        }
    },

    /*editor*/
    "editor.cursorBlinking": "smooth",//使编辑器光标的闪烁平滑,有呼吸感
	"editor.cursorSmoothCaretAnimation": "on",//让光标移动、插入变得平滑

    "editor.formatOnPaste": false,//在粘贴时格式化代码
    "editor.formatOnType": true,//敲完一行代码自动格式化
    "editor.smoothScrolling": true,//使编辑器滚动变平滑
    "editor.tabCompletion": "on",//启用Tab补全
    "editor.fontLigatures": true,//启用字体连字
    "editor.detectIndentation": false,//不基于文件内容选择缩进用制表符还是空格
    /*
    因为有时候VSCode的判断是错误的
    */
    "editor.insertSpaces": false,//敲下Tab键时插入4个空格而不是制表符
    "editor.copyWithSyntaxHighlighting": false,//复制代码时复制纯文本而不是连语法高亮都复制了
    "editor.suggest.snippetsPreventQuickSuggestions": false,//这个开不开效果好像都一样,据说是因为一个bug,建议关掉
    "editor.stickyTabStops": true,//在缩进上移动光标时四个空格一组来移动,就仿佛它们是制表符(\t)一样
    "editor.wordBasedSuggestions": "matchingDocuments",//关闭基于文件中单词来联想的功能(语言自带的联想就够了,开了这个会导致用vscode写MarkDown时的中文引号异常联想)
    "editor.linkedEditing": true,//html标签自动重命名(喜大普奔!终于不需要Auto Rename Tag插件了!)
    "editor.wordWrap": "on",//在文件内容溢出vscode显示区域时自动折行
    "editor.cursorSmoothCaretAnimation": "on",//让光标移动、插入变得平滑
    "editor.renderControlCharacters": true,//编辑器中显示不可见的控制字符
    
    "editor.renderWhitespace": "boundary",//除了两个单词之间用于分隔单词的一个空格,以一个小灰点的样子使空格可见

    /*terminal*/	
    "terminal.integrated.cursorBlinking": true,//终端光标闪烁
    "terminal.integrated.rightClickBehavior": "default",//在终端中右键时显示菜单而不是粘贴(个人喜好)
	"terminal.integrated.defaultProfile.linux": "zsh",
	"terminal.integrated.profiles.linux": {
		"zsh": {
			"path": "/bin/zsh",
			"args": []
		}
	},
	"terminal.integrated.defaultProfile.osx": "zsh",
    "terminal.integrated.profiles.osx": {
        "zsh": {
            "path": "/bin/zsh",
            "args": []
        }
    },
	
    /*files*/
    "files.autoGuessEncoding": true,//让VScode自动猜源代码文件的编码格式
    "files.autoSave": "afterDelay",//在编辑器失去焦点时自动保存,这使自动保存近乎达到“无感知”的体验
    "files.autoSave": "afterDelay",
    "files.exclude": {//隐藏一些碍眼的文件夹
        "**/.git": true,
        "**/.svn": true,
@@ -113,18 +85,17 @@
    },
    /*workbench*/
    "workbench.list.smoothScrolling": true,//使文件列表滚动变平滑
    "workbench.editor.enablePreview": false,//打开文件时不是“预览”模式,即在编辑一个文件时打开编辑另一个文件不会覆盖当前编辑的文件而是新建一个标签页
    "workbench.editor.wrapTabs": true,//编辑器标签页在空间不足时以多行显示
    "workbench.editor.untitled.hint": "hidden",//隐藏新建无标题文件时的“选择语言?”提示(个人喜好,可以删掉此行然后Ctrl+N打开无标题新文件看看不hidden的效果)

    /*explorer*/
    "explorer.confirmDelete": false,//删除文件时不弹出确认弹窗(因为很烦)
    "explorer.confirmDragAndDrop": false,//往左边文件资源管理器拖动东西来移动/复制时不显示确认窗口(因为很烦)
    "explorer.confirmDragAndDrop": false,//往左边文件资源管理器拖动东西来移动/复制时不显示确认窗口

    /*search*/
    "search.followSymlinks": false,//据说可以减少vscode的CPU和内存占用

    /*debug*/
    "debug.internalConsoleOptions": "openOnSessionStart",//每次调试都打开调试控制台,方便调试
    "debug.showBreakpointsInOverviewRuler": true,//在滚动条标尺上显示断点的位置,便于查找断点的位置
    "debug.toolBarLocation": "docked",//固定调试时工具条的位置,防止遮挡代码内容(个人喜好)
    "debug.saveBeforeStart": "nonUntitledEditorsInActiveGroup",//在启动调试会话前保存除了无标题文档以外的文档(毕竟你创建了无标题文档就说明你根本没有想保存它的意思(至少我是这样的。))
    "debug.saveBeforeStart": "nonUntitledEditorsInActiveGroup",//在启动调试会话前保存除了无标题文档以外的文档
    "debug.onTaskErrors": "showErrors",//预启动任务出错后显示错误,并不启动调试
}
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
        {
            "label": "Flash",
            "type": "shell",
            "command": "west flash",
            "command": "west flash --runner openocd",
            "group": {
                "kind": "build",
                "isDefault": false
@@ -32,7 +32,7 @@
        {
            "label": "Build & Flash",
            "type": "shell",
            "command": "west build -p always -b robomaster_board_c motor && west flash",
            "command": "west build -p always -b robomaster_board_c motor && west flash --runner openocd",
            "group": {
                "kind": "build",
                "isDefault": false
+17 −0
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)

2024_3wheel/README.rst

0 → 100644
+51 −0
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
Loading