From cdb8c62267e017d447a5ba1086f4d12d7f5c18ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=5F666?= <13089258+pony-six-hundred-and-sixty-six@user.noreply.gitee.com> Date: Sun, 13 Apr 2025 22:40:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=88=E6=9A=82=E5=AD=98=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .mrs/BLE_TYQ_BJQ_CH584M.mrs-workspace | 26 +++++++++++ .mrs/launch.json | 65 +++++++++++++++++++++++++++ bsp/src/bsp_iwdg.c | 3 +- 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 .mrs/BLE_TYQ_BJQ_CH584M.mrs-workspace create mode 100644 .mrs/launch.json diff --git a/.mrs/BLE_TYQ_BJQ_CH584M.mrs-workspace b/.mrs/BLE_TYQ_BJQ_CH584M.mrs-workspace new file mode 100644 index 0000000..d15aa25 --- /dev/null +++ b/.mrs/BLE_TYQ_BJQ_CH584M.mrs-workspace @@ -0,0 +1,26 @@ +{ + "folders": [ + { + "path": "." + }, + { + "name": "BLE_TYQ_BJQ_CH584M", + "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..f3acb26 --- /dev/null +++ b/.mrs/launch.json @@ -0,0 +1,65 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "mrs-debugger", + "request": "launch", + "name": "BLE_TYQ_BJQ_CH584M", + "cwd": "d:\\SXDT\\Project\\CH32\\ble_-tyq_-bjq_-ch584-m", + "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\"" + ], + "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": "d:\\SXDT\\Project\\CH32\\ble_-tyq_-bjq_-ch584-m\\obj\\BLE_TYQ_BJQ_CH584M.elf", + "symbolFile": "d:\\SXDT\\Project\\CH32\\ble_-tyq_-bjq_-ch584-m\\obj\\BLE_TYQ_BJQ_CH584M.elf", + "executableFileOffset": 0, + "symbolFileOffset": 0 + }, + "runCommands": { + "runReset": true, + "runResetType": "halt", + "additionalCommands": [], + "setBreakAt": "handle_reset", + "continue": true, + "setProgramCounterAt": 0 + }, + "debugInRAM": false + }, + "svdpath": "", + "output": { + "showDebugGDBTrace": true, + "saveDebugOutputToFile": false, + "showDebugOutputTimestamps": true + } + } + ] +} \ No newline at end of file diff --git a/bsp/src/bsp_iwdg.c b/bsp/src/bsp_iwdg.c index 485bcc7..41eb3ea 100644 --- a/bsp/src/bsp_iwdg.c +++ b/bsp/src/bsp_iwdg.c @@ -25,12 +25,13 @@ uint8_t IWDGTaskId; #define IWIG_FEED_EVENT (0x01 << 0) + uint16_t IWDG_ProcessEvent(uint8_t task_id, uint16_t events) { if (events & IWIG_FEED_EVENT) { FEED_IWDG(); - tmos_start_task(task_id, IWIG_FEED_EVENT, 20000); + tmos_start_task(task_id, IWIG_FEED_EVENT, 10000); return (events ^ IWIG_FEED_EVENT); } return 0;