From f2823f2254786537ec7508890f21cb9ce30a2735 Mon Sep 17 00:00:00 2001 From: AEVENC <17782625440@163.com> Date: Wed, 9 Apr 2025 14:26:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cproject | 846 +++++++++++++++----- .mrs/ble_bjq_ch303rct6_ml307.mrs-workspace | 26 + .mrs/launch.json | 65 ++ .project | 67 +- .template | 7 +- .vscode/settings.json | 4 +- ble_bjq_ch303rct6_ml307.launch | 62 ++ ble_bjq_ch303rct6_ml307.wvproj | 866 ++++++++++++++++++++- bsp/inc/bsp_adc.h | 13 +- bsp/inc/bsp_beep.h | 3 +- bsp/inc/bsp_button.h | 3 +- bsp/inc/bsp_led.h | 9 +- bsp/src/bsp_adc.c | 9 +- bsp/src/bsp_led.c | 6 +- libcpu/cpu/cpuport.c | 3 +- 15 files changed, 1738 insertions(+), 251 deletions(-) create mode 100644 .mrs/ble_bjq_ch303rct6_ml307.mrs-workspace create mode 100644 .mrs/launch.json create mode 100644 ble_bjq_ch303rct6_ml307.launch diff --git a/.cproject b/.cproject index 07e4900..cf4bc99 100644 --- a/.cproject +++ b/.cproject @@ -1,201 +1,649 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.mrs/ble_bjq_ch303rct6_ml307.mrs-workspace b/.mrs/ble_bjq_ch303rct6_ml307.mrs-workspace new file mode 100644 index 0000000..1c39ace --- /dev/null +++ b/.mrs/ble_bjq_ch303rct6_ml307.mrs-workspace @@ -0,0 +1,26 @@ +{ + "folders": [ + { + "path": "." + }, + { + "name": "ble_bjq_ch303rct6_ml307", + "path": "../" + } + ], + "settings": { + "mrs.workspace.type": "project", + "files.associations": { + "*.c": "c", + "*.h": "cpp", + "*.hxx": "cpp", + "*.hpp": "cpp", + "*.c++": "cpp", + "*.cpp": "cpp", + "*.cxx": "cpp", + "*.cc": "cpp", + "*.hh": "cpp", + "*.h++": "cpp" + } + } +} \ No newline at end of file diff --git a/.mrs/launch.json b/.mrs/launch.json new file mode 100644 index 0000000..31f5cf7 --- /dev/null +++ b/.mrs/launch.json @@ -0,0 +1,65 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "mrs-debugger", + "request": "launch", + "name": "ble_bjq_ch303rct6_ml307", + "cwd": "c:\\Users\\AEVEN\\Desktop\\ble_-tyq_-bjq_-ch32-v303", + "openOCDCfg": { + "useLocalOpenOCD": true, + "executable": "c:/MounRiver/MounRiver_Studio2/resources/app/resources/win32/components/WCH/OpenOCD/OpenOCD/bin/openocd.exe", + "configOptions": [ + "-f \"c:/MounRiver/MounRiver_Studio2/resources/app/resources/win32/components/WCH/OpenOCD/OpenOCD/bin/wch-riscv.cfg\" -c \"chip_id CH32V30x\"" + ], + "gdbport": 3333, + "telnetport": 4444, + "tclport": 6666, + "host": "localhost", + "port": 3333, + "skipDownloadBeforeDebug": false, + "enablePageEraser": false, + "enableNoZeroWaitingAreaFlash": false + }, + "gdbCfg": { + "executable": "c:/MounRiver/MounRiver_Studio2/resources/app/resources/win32/components/WCH/Toolchain/RISC-V Embedded GCC12/bin/riscv-wch-elf-gdb.exe", + "commands": [ + "set mem inaccessible-by-default off", + "set architecture riscv:rv32", + "set remotetimeout unlimited", + "set disassembler-options xw" + ], + "options": [] + }, + "startup": { + "initCommands": { + "initReset": true, + "initResetType": "init", + "armSemihosting": false, + "additionalCommands": [] + }, + "loadedFiles": { + "executableFile": "c:\\Users\\AEVEN\\Desktop\\ble_-tyq_-bjq_-ch32-v303\\obj\\ble_bjq_ch303rct6_ml307.elf", + "symbolFile": "c:\\Users\\AEVEN\\Desktop\\ble_-tyq_-bjq_-ch32-v303\\obj\\ble_bjq_ch303rct6_ml307.elf", + "executableFileOffset": 0, + "symbolFileOffset": 0 + }, + "runCommands": { + "runReset": true, + "runResetType": "halt", + "additionalCommands": [], + "setBreakAt": "handle_reset", + "continue": true, + "setProgramCounterAt": 0 + }, + "debugInRAM": false + }, + "svdpath": "c:\\MounRiver\\MounRiver_Studio2\\resources\\app\\resources\\win32\\components\\WCH\\SDK\\default/RISC-V/CH32V307/NoneOS/CH32V307xx.svd", + "output": { + "showDebugGDBTrace": true, + "saveDebugOutputToFile": false, + "showDebugOutputTimestamps": true + } + } + ] +} \ No newline at end of file diff --git a/.project b/.project index 7e84ca2..4595938 100644 --- a/.project +++ b/.project @@ -1,37 +1,34 @@ - ble_bjq_ch303rct6_ml307 - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - 1595986042669 - - 22 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-*.wvproj - - - - + ble_bjq_ch303rct6_ml307 + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + + + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.wvproj + + + + \ No newline at end of file diff --git a/.template b/.template index 3a8929b..5e55e1a 100644 --- a/.template +++ b/.template @@ -9,10 +9,15 @@ Description=========ROM(byte): 256K, SRAM(byte): 64K, CHIP PINS: 64, GPIO PORTS: Mcu Type=CH32V30x Address=0x08000000 Target Path=obj\ble_bjq_ch303rct6_ml307.hex +Exe Path= +Exe Arguments= CLKSpeed=1 -DebugInterfaceMode=-1 +DebugInterfaceMode=0 Erase All=true Program=true Verify=true Reset=true SDIPrintf=false +Disable Power Output=false +Clear CodeFlash=false +Disable Code-Protect=false \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index dd1f635..22560be 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -55,6 +55,8 @@ "ulog.h": "c", "ctype.h": "c", "string.h": "c", - "completion.h": "c" + "completion.h": "c", + "bsp_mb26.h": "c", + "stdio.h": "c" } } diff --git a/ble_bjq_ch303rct6_ml307.launch b/ble_bjq_ch303rct6_ml307.launch new file mode 100644 index 0000000..7523c2f --- /dev/null +++ b/ble_bjq_ch303rct6_ml307.launch @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ble_bjq_ch303rct6_ml307.wvproj b/ble_bjq_ch303rct6_ml307.wvproj index 2cd99d9..ee6faf6 100644 --- a/ble_bjq_ch303rct6_ml307.wvproj +++ b/ble_bjq_ch303rct6_ml307.wvproj @@ -1,2 +1,864 @@ -iCZ ?"ǁrF<.ſ?/XOĿChQN$*EBk!2t+buhnUb]xll| -+" #include #include "ch32v30x.h" -#include "libcpu/cpu/cpuport.h" +// #include "libcpu/cpu/cpuport.h" +#include "cpuport.h" #ifndef RT_USING_SMP volatile rt_ubase_t rt_interrupt_from_thread = 0;