fix horizontal speed value (was wrong for all except RS41)

pull/36/head
Hansi, dl9rdz 2020-11-18 10:05:37 +01:00
rodzic b586fafa5a
commit 8f75960405
4 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -1,4 +1,4 @@
const char *version_name = "rdzTTGOsonde";
const char *version_id = "devel20201115";
const char *version_id = "devel20201118";
const int SPIFFS_MAJOR=2;
const int SPIFFS_MINOR=4;

Wyświetl plik

@ -1004,7 +1004,7 @@ void Display::drawHS(DispEntry *de) {
}
boolean is_ms = (de->extra && de->extra[0]=='m')?true:false; // m/s or km/h
float hs = sonde.si()->hs;
if(is_ms) hs = hs / 3.6;
if(!is_ms) hs = hs * 3.6;
boolean has_extra = (de->extra && de->extra[1]!=0)? true: false;
snprintf(buf, 16, hs>99?" %3.0f":" %2.1f", hs);
if(has_extra) { strcat(buf, de->extra+1); }

Wyświetl plik

@ -356,7 +356,7 @@ static void posrs41(const byte b[], uint32_t b_len, uint32_t p)
if (dir<0.0) dir = 360.0+dir;
sonde.si()->dir = dir;
Serial.print(" ");
sonde.si()->hs = sqrt((float)(vn*vn+ve*ve))*3.6f;
sonde.si()->hs = sqrt((float)(vn*vn+ve*ve));
Serial.print(sonde.si()->hs);
Serial.print("km/h ");
Serial.print(dir);

Wyświetl plik

@ -64,8 +64,8 @@ typedef struct st_sondeinfo {
float lat; // latitude
float lon; // longitude
float alt; // altitude
float vs; // vertical speed
float hs; // horizontal speed
float vs; // vertical speed in m/s
float hs; // horizontal speed in m/s
float dir; // 0..360
uint8_t sats; // number of sats
uint8_t validPos; // bit pattern for validity of above 7 fields; 0x80: position is old