Skip to content

Commit

Permalink
fix unused warning (#1970)
Browse files Browse the repository at this point in the history
  • Loading branch information
gullradriel authored Mar 10, 2024
1 parent 2ac36d2 commit 986e37a
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions firmware/application/apps/ui_level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,24 +172,26 @@ void LevelView::on_statistics_update(const ChannelStatistics& statistics) {
}
// refresh sat
uint8_t rx_sat = ((uint32_t)shared_memory.m4_performance_counter) * 100 / 127;
last_rx_sat = rx_sat;
freq_stats_rx.set("RxSat: " + to_string_dec_uint(rx_sat) + "%");
uint8_t br = 0;
uint8_t bg = 0;
uint8_t bb = 0;
if (rx_sat <= 80) {
bg = (255 * rx_sat) / 80;
bb = 255 - bg;
} else if (rx_sat > 80) {
br = (255 * (rx_sat - 80)) / 20;
bg = 255 - br;
if (last_rx_sat != rx_sat) {
last_rx_sat = rx_sat;
freq_stats_rx.set("RxSat: " + to_string_dec_uint(rx_sat) + "%");
uint8_t br = 0;
uint8_t bg = 0;
uint8_t bb = 0;
if (rx_sat <= 80) {
bg = (255 * rx_sat) / 80;
bb = 255 - bg;
} else if (rx_sat > 80) {
br = (255 * (rx_sat - 80)) / 20;
bg = 255 - br;
}
Style style_freq_stats_rx{
.font = font::fixed_8x16,
.background = {br, bg, bb},
.foreground = {255, 255, 255},
};
freq_stats_rx.set_style(&style_freq_stats_rx);
}
Style style_freq_stats_rx{
.font = font::fixed_8x16,
.background = {br, bg, bb},
.foreground = {255, 255, 255},
};
freq_stats_rx.set_style(&style_freq_stats_rx);

} /* on_statistic_updates */

Expand Down

0 comments on commit 986e37a

Please sign in to comment.