From 67b4e964174f8facd1ba87db469aa7ef5b6a7c18 Mon Sep 17 00:00:00 2001 From: "Schoenberger, Philipp" Date: Tue, 16 Apr 2019 21:29:00 +0200 Subject: [PATCH] display freq offset since telemetry is not working --- remote/src/state.cpp | 7 +++++-- remote/src/state_fly.cpp | 24 +++++++++--------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/remote/src/state.cpp b/remote/src/state.cpp index 5aa38c1..55522b3 100644 --- a/remote/src/state.cpp +++ b/remote/src/state.cpp @@ -17,6 +17,7 @@ State *s_init = NULL; State *s_bind = NULL; State *s_fly = NULL; State *s_joy = NULL; +State *s_hf_cfg = NULL; #ifndef ENABLE_DBEUG State *s_usb = NULL; #endif @@ -39,6 +40,8 @@ void init_state(void) { s_usb = new LCD_state_joy_usb(); #endif s_menu = new LCD_state_menu(); + s_hf_cfg = new LCD_state_hf_cfg(); + lcd.backlight(); curr_state = NULL; new_state = s_init; @@ -65,7 +68,7 @@ void lcd_centerText(const char *text) int fieldWidth = 16; int padlen = 0; padlen = (fieldWidth - strlen(text)) / 2 ; - char line[17] = {0}; - sprintf(line, "%*s%s%*s\n", padlen, "", text, padlen, ""); + char line[17] = " "; + sprintf(line, "%*s%s%*s", padlen, "", text, padlen, ""); lcd.print(line); } diff --git a/remote/src/state_fly.cpp b/remote/src/state_fly.cpp index a37ce6d..5ff7414 100644 --- a/remote/src/state_fly.cpp +++ b/remote/src/state_fly.cpp @@ -76,14 +76,15 @@ void LCD_state_fly::enter(void) { lcd.setCursor(12,0); lcd.write(battery_char); -#if 1 - lcd.setCursor(12,1); - lcd.write(battery_char); + + //lcd.setCursor(12,1); + //lcd.write(battery_char); + lcd.setCursor(6,1); lcd.write(rssiantenna); + lcd.setCursor(7,1); lcd.write(rssi_bars); -#endif } void LCD_state_fly::print_time(uint16_t time) @@ -147,8 +148,8 @@ void LCD_state_fly::print_rssi(uint8_t rssi_percent) void LCD_state_fly::update(void) { uint8_t call=0; - uint8_t rssi_percent = 100; - uint8_t akku_quad = 1; + uint8_t rssi_percent = freq_offset; + uint8_t akku_quad = freq_offset; uint32_t akku_remote = 2; uint32_t old_akku_remote = 2; unsigned long time_in_ms = millis() - this->time_enter; @@ -197,23 +198,16 @@ void LCD_state_fly::update(void) this->print_time(time_in_s); break; -#if 1 case 20: - rssi_percent = TX_RSSI; - if(rssi_percent > 100) - rssi_percent = 0; + rssi_percent = freq_offset;//TX_RSSI; this->print_rssi(rssi_percent); break; case 30: // update akku - akku_quad += 1; - if(akku_quad > 100) - akku_quad = 0; - this->print_akku_quad(akku_quad); + //this->print_akku_quad(akku_quad); break; -#endif case 40: // update akku // 3.7 -> 1560