From 68b69a2be94f84ca5c42e118bda65332b7b92b32 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Fri, 18 Jun 2021 00:45:27 +0200 Subject: [PATCH] M10: fix serial number: consistent with M20 (with dashes), consistent with autorx --- RX_FSK/version.h | 2 +- libraries/SondeLib/Display.cpp | 2 +- libraries/SondeLib/M10M20.cpp | 19 +++++++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/RX_FSK/version.h b/RX_FSK/version.h index b1e40e8..7a66c30 100644 --- a/RX_FSK/version.h +++ b/RX_FSK/version.h @@ -1,4 +1,4 @@ const char *version_name = "rdzTTGOsonde"; -const char *version_id = "devel20210614"; +const char *version_id = "devel20210618"; const int SPIFFS_MAJOR=2; const int SPIFFS_MINOR=11; diff --git a/libraries/SondeLib/Display.cpp b/libraries/SondeLib/Display.cpp index 5fdb49e..f139495 100644 --- a/libraries/SondeLib/Display.cpp +++ b/libraries/SondeLib/Display.cpp @@ -188,7 +188,7 @@ DispInfo staticLayouts[5] = { /////////////// Wrapper code for various display // ALLFONTS requires 30k extra flash memory... for now there is still enough space :) -#define ALLFONTS 1 +//#define ALLFONTS 1 static const uint8_t *fl[] = { u8x8_font_chroma48medium8_r, // 0 ** default small u8x8_font_7x14_1x2_f, // 1 ** default large diff --git a/libraries/SondeLib/M10M20.cpp b/libraries/SondeLib/M10M20.cpp index 0eaf6ed..67d8525 100644 --- a/libraries/SondeLib/M10M20.cpp +++ b/libraries/SondeLib/M10M20.cpp @@ -281,7 +281,7 @@ int M10M20::decodeframeM10(uint8_t *data) { Serial.println("Decoding..."); // Its a M10 // getid... - char ids[11]; + char ids[12]; ids[0] = 'M'; ids[1] = 'E'; ids[2] = hex(data[95]/16); @@ -297,14 +297,17 @@ int M10M20::decodeframeM10(uint8_t *data) { ids[0] = hex(data[95]/16); ids[1] = dez((data[95]&0x0f)/10); ids[2] = dez((data[95]&0x0f)); - ids[3] = dez(data[93]); - ids[4] = dez(id>>13); + ids[3] = '-'; + ids[4] = dez(data[93]); + ids[5] = '-'; + ids[6] = dez(id>>13); id &= 0x1fff; - ids[5] = dez(id/1000); - ids[6] = dez((id/100)%10); - ids[7] = dez((id/10)%10); - ids[8] = dez(id%10); - strncpy(sonde.si()->ser, ids, 10); + ids[7] = dez(id/1000); + ids[8] = dez((id/100)%10); + ids[9] = dez((id/10)%10); + ids[10] = dez(id%10); + ids[11] = 0; + strncpy(sonde.si()->ser, ids, 12); sonde.si()->validID = true; Serial.printf("ID is %s [%02x %02x %d]\n", ids, data[95], data[93], id); // ID printed on sonde is ...-.-abbbb, with a=id>>13, bbbb=id&0x1fff in decimal