From 52b2aaae11ed3bfc86a708a7e4428d9524bbabd8 Mon Sep 17 00:00:00 2001 From: cuu Date: Sun, 16 May 2021 13:40:12 +0800 Subject: [PATCH] one tab become two spaces --- Code/thermal_printer/devterm_thermal_printer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Code/thermal_printer/devterm_thermal_printer.c b/Code/thermal_printer/devterm_thermal_printer.c index ff89464..edcffb0 100644 --- a/Code/thermal_printer/devterm_thermal_printer.c +++ b/Code/thermal_printer/devterm_thermal_printer.c @@ -682,7 +682,13 @@ void loop() { { fread(readbuf,1, 1,fp); //printf("read %x",readbuf[0]); - parse_serial_stream(&g_config,readbuf[0]); + if(readbuf[0] == ASCII_TAB) { + readbuf[0] = ' '; + parse_serial_stream(&g_config,readbuf[0]); + parse_serial_stream(&g_config,readbuf[0]); + }else{ + parse_serial_stream(&g_config,readbuf[0]); + } } fclose(fp); g_config.fp = NULL;