更新了大量文档

This commit is contained in:
NeoZng
2023-06-03 21:58:21 +08:00
parent ff5028036a
commit 253f391cd5
17 changed files with 141 additions and 74 deletions

View File

@@ -11,6 +11,28 @@
bsp_log是基于segger RTT实现的日志打印模块。
推荐使用`bsp_log.h`中提供了三级日志:
```c
#define LOGINFO(format,...)
#define LOGWARNING(format,...)
#define LOGERROR(format,...)
```
分别用于输出不同等级的日志。
**若想启用RTT必须通过`launch.json`的`debug-jlink`启动调试(不论使用什么调试器)。**
注意若你使用的是cmsis-dap和daplink**请在调试任务启动之后再打开`log`任务。**(均在项目文件夹下的.vsocde/task.json中有注释自行查看
在ozone中查看log输出直接打开console调试任务台和terminal调试中断便可看到调试输出。
> 由于ozone版本的原因可能出现日志不换行或没有颜色。
## 自定义输出
你也可以自定义输出格式详见Segger RTT的文档。
```c
int printf_log(const char *fmt, ...);
void Float2Str(char *str, float va);
@@ -33,3 +55,6 @@ printf_log("Motor %d met some problem, error code %d!\n",3,1);
```
或直接通过`%f`格式符直接使用`printf_log()`发送日志,可以设置小数点位数以降低带宽开销。