docs: add __SDCC_SYNTAX_FIX comments

This commit is contained in:
IOsetting 2022-06-11 20:53:50 +08:00
parent 0d77d71ce8
commit 788a49bc5b
2 changed files with 26 additions and 2 deletions

View File

@ -52,6 +52,18 @@ build_flags =
#include "fw_hal.h" #include "fw_hal.h"
``` ```
## VS Code 代码高亮错误
VS Code 并不完全支持 SDCC 的 Intel 8051 语法 ([issue 7146](https://github.com/microsoft/vscode-cpptools/issues/7146)), 如果您需要在代码编辑中消除错误提示, 需要增加一个env, 并在 build_flags 中添加 `__SDCC_SYNTAX_FIX`:
```
build_flags =
-D__SDCC_SYNTAX_FIX
-D__CONF_FOSC=36864000UL
-D__CONF_MCU_MODEL=MCU_MODEL_STC8H3K32S2
...
```
这个特殊的env仅用于代码编辑, 编译和上载依然需要使用正常的env.
# Keil C51 快速上手 # Keil C51 快速上手

View File

@ -50,7 +50,19 @@ build_flags =
```c ```c
#include "fw_hal.h" #include "fw_hal.h"
``` ```
then it's ready to use. then it's ready to go.
## VS Code Syntax Problem
VS Code doesn't support some of SDCC syntax for Intel 8051 ([issue 7146](https://github.com/microsoft/vscode-cpptools/issues/7146)), if you want to eliminate syntax errors in code editor, add a separate env for code editing and add `__SDCC_SYNTAX_FIX` in build_flags:
```
build_flags =
-D__SDCC_SYNTAX_FIX
-D__CONF_FOSC=36864000UL
-D__CONF_MCU_MODEL=MCU_MODEL_STC8H3K32S2
...
```
This special env is for code editing only, building and uploading should use the normal env.
# Keil C51 Quick Start # Keil C51 Quick Start
@ -78,7 +90,7 @@ The explanation of these arguments
```c ```c
#include "fw_hal.h" #include "fw_hal.h"
``` ```
then it's ready to use. then it's ready to go.
# Macros # Macros