串口输出禁中文:syslog 中文描述改 ASCII(MCU 6 处 + 模拟器 6 处)
This commit is contained in:
+6
-6
@@ -324,9 +324,9 @@ static int run_logtest(void)
|
||||
(void)remove("sim_run.log");
|
||||
(void)remove("sim_selftest.log");
|
||||
|
||||
syslog_post(SYSLOG_RUN, "装置上电记录");
|
||||
syslog_post(SYSLOG_SELFTEST, "时钟芯片异常");
|
||||
syslog_post(SYSLOG_SELFTEST, "NAND异常");
|
||||
syslog_post(SYSLOG_RUN, "power on");
|
||||
syslog_post(SYSLOG_SELFTEST, "clock chip fault");
|
||||
syslog_post(SYSLOG_SELFTEST, "NAND fault");
|
||||
|
||||
if (syslog_count(SYSLOG_RUN) != 1u) {
|
||||
printf("[logtest] FAIL run count = %u (expect 1)\n", (unsigned)syslog_count(SYSLOG_RUN));
|
||||
@@ -346,7 +346,7 @@ static int run_logtest(void)
|
||||
printf("[logtest] FAIL ts format = \"%s\"\n", ts);
|
||||
return 1;
|
||||
}
|
||||
if (strcmp(desc, "装置上电记录") != 0) {
|
||||
if (strcmp(desc, "power on") != 0) {
|
||||
printf("[logtest] FAIL desc = \"%s\"\n", desc);
|
||||
return 1;
|
||||
}
|
||||
@@ -354,7 +354,7 @@ static int run_logtest(void)
|
||||
printf("[logtest] FAIL get_record(selftest, 1)\n");
|
||||
return 1;
|
||||
}
|
||||
if (strcmp(desc, "NAND异常") != 0) {
|
||||
if (strcmp(desc, "NAND fault") != 0) {
|
||||
printf("[logtest] FAIL desc[1] = \"%s\"\n", desc);
|
||||
return 1;
|
||||
}
|
||||
@@ -390,7 +390,7 @@ static int run_logtest(void)
|
||||
(unsigned)SYSLOG_TS_LEN, (unsigned)(SYSLOG_DESC_OFFS - 1u));
|
||||
return 1;
|
||||
}
|
||||
for (uint32_t i = SYSLOG_DESC_OFFS + strlen("装置上电记录"); i < SYSLOG_REC_SIZE; i++) {
|
||||
for (uint32_t i = SYSLOG_DESC_OFFS + strlen("power on"); i < SYSLOG_REC_SIZE; i++) {
|
||||
if (rec[i] != '\0') {
|
||||
printf("[logtest] FAIL NUL padding at [%u]\n", (unsigned)i);
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user