| 175 | } |
| 176 | |
| 177 | void serial_begin() { |
| 178 | SERIAL_PORT.begin(SERIAL_BAUD); |
| 179 | |
| 180 | while (SERIAL_PORT.available()) SERIAL_PORT.read(); |
| 181 | |
| 182 | debug("Connecting via serial"); |
| 183 | |
| 184 | connection = true; |
| 185 | |
| 186 | send(MSG_CONNECTED); |
| 187 | |
| 188 | update(); |
| 189 | |
| 190 | debug("Serial Connection "); |
| 191 | debugln(connection ? "OK" : "ERROR"); |
| 192 | } |
| 193 | |
| 194 | void serial_update() { |
| 195 | if (SERIAL_PORT.available() >= sizeof(status_t)+2) { |