generated from hulk/gd32f4xx_template_cmake_vscode
Shared NTC sampling + M2 continuous temperature report
This commit is contained in:
+6
-2
@@ -48,13 +48,17 @@ int main(void)
|
||||
/* RS485 数据口命令处理(D5 帧协议,具体业务命令在 command.c 扩展) */
|
||||
command_process();
|
||||
|
||||
/* debug 串口周期打印 NTC 温度(约 1s 一次) */
|
||||
/* NTC 后台采样(100ms 一次)+ M2 连续上报任务 */
|
||||
ntc_sample_task();
|
||||
command_report_task();
|
||||
|
||||
/* debug 串口周期打印 NTC 温度(约 1s 一次,读后台采样全局值) */
|
||||
#if DEBUG_MODE == CFG_ENABLE
|
||||
{
|
||||
static uint16_t temp_report_counter = 0;
|
||||
if (++temp_report_counter >= 100U) { /* 主循环 10ms 一圈 → 1s */
|
||||
temp_report_counter = 0;
|
||||
float temp = ntc_read_temperature();
|
||||
float temp = ntc_get_temperature();
|
||||
if (temp <= -274.0f) {
|
||||
printf("NTC SHORT (PC5 pulled low)\r\n");
|
||||
} else if (temp <= -273.0f) {
|
||||
|
||||
Reference in New Issue
Block a user