串口输出禁中文:syslog 中文描述改 ASCII(MCU 6 处 + 模拟器 6 处)

This commit is contained in:
2026-09-20 02:45:27 +08:00
parent ffcf85f74f
commit 898aa9b016
7 changed files with 16 additions and 16 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ typedef enum {
#define SYSLOG_SELFTEST_MAX 512u /* /log/selftest.log:32KB */
/*
* 上电/重启分类窗口(秒):run.log 末条 epoch 距 now < 该值 → "装置重启记录",否则 "装置上电记录"
* 上电/重启分类窗口(秒):run.log 末条 epoch 距 now < 该值 → "reboot",否则 "power on"
*/
#define SYSLOG_REBOOT_WINDOW_S 600u
+2 -2
View File
@@ -154,7 +154,7 @@ int syslog_mcu_init(void) {
void syslog_mcu_mounted(void) {
FILINFO finfo;
uint32_t last = 0u;
const char *desc = "装置上电记录";
const char *desc = "power on";
if (f_stat("/log", &finfo) != FR_OK) {
FRESULT fr = f_mkdir("/log");
@@ -168,7 +168,7 @@ void syslog_mcu_mounted(void) {
/* 上电/重启分类:末条 epoch 距 now < SYSLOG_REBOOT_WINDOW_S → 重启,否则上电 */
if (syslog_last_epoch(SYSLOG_RUN, &last) == 0 && sys_clock_get() != UINT32_MAX) {
if ((uint32_t)(sys_clock_get() - last) < SYSLOG_REBOOT_WINDOW_S) {
desc = "装置重启记录";
desc = "reboot";
}
}
(void)s_append(SYSLOG_RUN, desc);