Fixed:uart read bug.

This commit is contained in:
Fancy code 2024-05-22 09:20:22 +08:00
parent 5c95effe7c
commit 21432a5719
2 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,7 @@ void ConfigBaseImpl::OpenConfigFile(void)
} }
} }
else { else {
LogInfo("Config file doesn't exist.\n"); LogInfo("Config file doesn't exist.mFileName = %s\n", mFileName.c_str());
/* Write out the new configuration. */ /* Write out the new configuration. */
if (!config_write_file(&cfg, mFileName.c_str())) { if (!config_write_file(&cfg, mFileName.c_str())) {
fprintf(stderr, "Error while writing file.\n"); fprintf(stderr, "Error while writing file.\n");

View File

@ -223,6 +223,7 @@ const StatusCode UartDeviceImpl::SetConfig(void)
options.c_oflag &= ~OPOST; options.c_oflag &= ~OPOST;
options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
// options.c_lflag &= ~(ISIG | ICANON); // options.c_lflag &= ~(ISIG | ICANON);
options.c_iflag &= ~ICRNL;
// set wait time // set wait time
options.c_cc[VTIME] = 1; options.c_cc[VTIME] = 1;
options.c_cc[VMIN] = 1; options.c_cc[VMIN] = 1;