[Feature][ZXW-41] merged 0601 version
Change-Id: I667af6bb09d65581d455b73f8984c160b2c67ad8
diff --git a/ap/app/crc/crc.c b/ap/app/crc/crc.c
index ee14405..bb4aa1b 100755
--- a/ap/app/crc/crc.c
+++ b/ap/app/crc/crc.c
@@ -329,6 +329,24 @@
}
+static void com_SetIO_Para(int32_t iFdCom)
+{
+ struct termios tOldTermios = {0};
+
+ bzero(&tOldTermios, sizeof(tOldTermios));
+ tcgetattr(iFdCom, &tOldTermios); // get the serial port attributions
+ tOldTermios.c_iflag &= ~(ICRNL | IXON);
+ tOldTermios.c_lflag &= ~(ICANON | ECHO | ECHOE | ECHOK | ISIG);
+ tOldTermios.c_oflag &= ~OPOST;
+ if(tcsetattr(iFdCom, TCSANOW, &tOldTermios) != 0) //设置新属性, TCSANOW: 所由改变立即生效
+ {
+ printf("Set TimeOut error. iFd == %d\n", iFdCom);
+ return;
+ }
+ tcflush(iFdCom, TCIOFLUSH);
+ printf("com_SetIO_Para over.\n");
+}
+
static int zUP_SetPort_0(int32_t iFd ,int ctsrts_en, int iBaud, int iDelay)
{
@@ -338,6 +356,7 @@
//com_SetParity(iFd, 'O');
com_SetnStop(iFd,1);
com_SetCtrl(iFd,ctsrts_en); //add flow control
+ com_SetIO_Para(iFd);
com_SetTimeOut(iFd,iDelay); //timeout 100ms
printf("set serial port done!\n");