This commit is contained in:
gaoyuhang 2024-01-25 10:42:26 +08:00
parent db5056cfb0
commit 49f1072a7f
2 changed files with 8 additions and 4 deletions

10
.vscode/settings.json vendored
View File

@ -38,7 +38,10 @@
"C_Cpp_Runner.compilerArgs": [], "C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [], "C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [], "C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": ["*", "**/*"], "C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [ "C_Cpp_Runner.excludeSearch": [
"**/build", "**/build",
"**/build/**", "**/build/**",
@ -57,5 +60,6 @@
"pid_g.h": "c", "pid_g.h": "c",
"mode_pwmp.h": "c", "mode_pwmp.h": "c",
"eeprom_m95.h": "c" "eeprom_m95.h": "c"
} },
} "C_Cpp.errorSquiggles": "disabled"
}

View File

@ -33,7 +33,7 @@ static void current_inspection(void)
{ {
float32 current = 0.0; // 定义一个浮点数变量loop_current用于存储当前电流 float32 current = 0.0; // 定义一个浮点数变量loop_current用于存储当前电流
// 计算当前电流方法为读取ADC通道ADC_LOOP_CHANNEL的平均值并转换为浮点数 // 计算当前电流方法为读取ADC通道ADC_LOOP_CHANNEL的平均值并转换为浮点数
current = loop_current_convert(adc_result_average(ADCS_1,ADC_LOOP_CHANNEL)); current = loop_current_convert(adc_result_average(ADCS_1, ADC_LOOP_CHANNEL));
// 判断当前电流是否大于等于3.8mA如果是则启动UART // 判断当前电流是否大于等于3.8mA如果是则启动UART
if (current >= INPUT_CURRENT_MIN) if (current >= INPUT_CURRENT_MIN)