change frsky_telemetry default port to USART8 for pixracer

add a 50msec timeout to poll calls in sPort_telemetry to prevent hangs
This commit is contained in:
Mark Whitehorn
2016-01-22 14:42:39 -07:00
committed by Lorenz Meier
parent 8d089d95d4
commit a402b3beeb
2 changed files with 4 additions and 3 deletions

View File

@@ -133,7 +133,7 @@ static void usage()
static int frsky_telemetry_thread_main(int argc, char *argv[])
{
/* Default values for arguments */
char *device_name = "/dev/ttyS1"; /* USART2 */
char *device_name = "/dev/ttyS6"; /* USART8 */
/* Work around some stupidity in task_create's argv handling */
argc -= 2;

View File

@@ -185,8 +185,9 @@ static int sPort_telemetry_thread_main(int argc, char *argv[])
/* wait for poll frame starting with value 0x7E
* note that only the bus master is supposed to put a 0x7E on the bus.
* slaves use byte stuffing to send 0x7E and 0x7D.
* we expect a poll frame every 12msec
*/
int status = poll(fds, sizeof(fds) / sizeof(fds[0]), -1);
int status = poll(fds, sizeof(fds) / sizeof(fds[0]), 50);
if (status < 1) { continue; }
@@ -196,7 +197,7 @@ static int sPort_telemetry_thread_main(int argc, char *argv[])
if (newBytes < 1 || sbuf[0] != 0x7E) { continue; }
/* wait for ID byte */
status = poll(fds, sizeof(fds) / sizeof(fds[0]), -1);
status = poll(fds, sizeof(fds) / sizeof(fds[0]), 50);
if (status < 1) { continue; }