Change Details
tools/antorcha.c |
285 | 285 | uint8_t buf[MAX_PSDU] = { 0, }; |
286 | 286 | int got; |
287 | 287 | uint8_t *s; |
| 288 | uint16_t t_high, t_low, last; |
288 | 289 | int x, y; |
289 | 290 | |
290 | 291 | buf[0] = 1; |
... | ... | |
305 | 306 | } |
306 | 307 | if (debug) |
307 | 308 | fprintf(stderr, "%d:", got); |
308 | | s = buf+3+2; |
| 309 | s = buf+3; |
| 310 | t_high = *s++; |
| 311 | t_high |= *s++ << 8; |
| 312 | last = 0; |
309 | 313 | while (s < buf+got-2) { |
310 | | s += 2; |
| 314 | t_low = *s++; |
| 315 | t_low |= *s++ << 8; |
| 316 | if (t_low < last) |
| 317 | t_high++; |
| 318 | last = t_low; |
311 | 319 | x = *s++; |
312 | 320 | x |= *s++ << 8; |
313 | | s += 2; |
| 321 | |
| 322 | if (debug) |
| 323 | fprintf(stderr, "\t%11.6f %d", |
| 324 | (t_high << 16 | t_low)/1000000.0, x); |
| 325 | |
| 326 | t_low = *s++; |
| 327 | t_low |= *s++ << 8; |
| 328 | if (t_low < last) |
| 329 | t_high++; |
| 330 | last = t_low; |
314 | 331 | y = *s++; |
315 | 332 | y |= *s++ << 8; |
| 333 | |
316 | 334 | if (debug) |
317 | | fprintf(stderr, "\t%d %d\n", x, y); |
| 335 | fprintf(stderr, "\t%11.6f %d\n", |
| 336 | (t_high << 16 | t_low)/1000000.0, y); |
| 337 | |
318 | 338 | if (!plot(x, y)) |
319 | 339 | goto quit; |
320 | 340 | } |
Download the corresponding diff file