Fixed:uart read bug.
This commit is contained in:
parent
5c95effe7c
commit
21432a5719
|
@ -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");
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user