X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Flib%2Fcc-telem.c;h=678c078eb3183b7067b2406fd2ce23907483aa8d;hb=3fd320ea38f2945f5611a09a0e48d16db467d105;hp=ccd40ac2cb9db31e15501c57ab8bcfc6bbfaa287;hpb=b0d7e3f9c9322542e9b649bb6ad7f7e5bb99dffa;p=fw%2Faltos diff --git a/ao-tools/lib/cc-telem.c b/ao-tools/lib/cc-telem.c index ccd40ac2..678c078e 100644 --- a/ao-tools/lib/cc-telem.c +++ b/ao-tools/lib/cc-telem.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -101,6 +102,10 @@ cc_telem_parse(const char *input_line, struct cc_telem *telem) telem->flight = 0; cc_parse_int(&telem->rssi, words[5]); + if (version <= 2) { + /* Older telemetry versions mis-computed the rssi value */ + telem->rssi = (telem->rssi + 74) / 2 - 74; + } cc_parse_string(telem->state, sizeof (telem->state), words[9]); cc_parse_int(&telem->tick, words[10]); cc_parse_int(&telem->accel, words[12]);