Commit 8e021097f2ac80da1306e7b9e4fdd2a2af078469

Authored by Calvin Bulla
1 parent 5db0f6db
Exists in master and in 1 other branch dev

Serial Bugfix

Showing 1 changed file with 8 additions and 1 deletions   Show diff stats
app/src/serial.c
... ... @@ -69,7 +69,8 @@ int serial_discover(int max, struct ino *inos)
69 69  
70 70 int serial_init(struct ino *ino, char *port)
71 71 {
72   - ino->port = strdup(port);
  72 + ino->port = malloc(strlen(port) + 1);
  73 + strcpy(ino->port, port);
73 74 ino->status = 0;
74 75 ino->fd = -1;
75 76 ino->read = 0;
... ... @@ -105,9 +106,13 @@ int serial_connect(struct ino *ino)
105 106 switch(BAUD_RATE) {
106 107 case 4800: brate = B4800; break;
107 108 case 9600: brate = B9600; break;
  109 +#ifdef B14400
108 110 case 14400: brate = B14400; break;
  111 +#endif
109 112 case 19200: brate = B19200; break;
  113 +#ifdef B28800
110 114 case 28800: brate = B28800; break;
  115 +#endif
111 116 case 38400: brate = B38400; break;
112 117 case 57600: brate = B57600; break;
113 118 case 115200: brate = B115200; break;
... ... @@ -124,7 +129,9 @@ int serial_connect(struct ino *ino)
124 129 toptions.c_cflag &= ~CSIZE;
125 130 toptions.c_cflag |= CS8;
126 131 // No Flow Control
  132 +#ifdef CRTSCTS
127 133 toptions.c_cflag &= ~CRTSCTS;
  134 +#endif
128 135  
129 136 //toptions.c_cflag &= ~HUPCL;
130 137  
... ...