From 990f5e8ce6526460f2720d58a3230e26a1d51207 Mon Sep 17 00:00:00 2001 From: Federico Amedeo Izzo Date: Sun, 26 Sep 2021 18:38:29 +0200 Subject: [PATCH] UI: Fix level meter and set it to platform mic level --- openrtx/src/graphics.c | 2 +- openrtx/src/ui/ui_main.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openrtx/src/graphics.c b/openrtx/src/graphics.c index 97d8099c..c1b9afe9 100644 --- a/openrtx/src/graphics.c +++ b/openrtx/src/graphics.c @@ -721,7 +721,7 @@ void gfx_drawSmeterLevel(point_t start, uint16_t width, uint16_t height, float r gfx_setPixel(pixel_pos, white); } // Level bar - uint16_t level_width = (level / 255 * width); + uint16_t level_width = (level / 255.0 * width); point_t level_pos = { start.x, start.y + 2 }; gfx_drawRect(level_pos, level_width, bar_height, green, true); // RSSI bar diff --git a/openrtx/src/ui/ui_main.c b/openrtx/src/ui/ui_main.c index 3fc1a816..5cae7b38 100644 --- a/openrtx/src/ui/ui_main.c +++ b/openrtx/src/ui/ui_main.c @@ -158,6 +158,7 @@ void _ui_drawMainBottom() uint16_t meter_height = layout.bottom_h; point_t meter_pos = { layout.horizontal_pad, SCREEN_HEIGHT - meter_height - layout.bottom_pad}; + uint8_t mic_level = platform_getMicLevel(); switch(last_state.channel.mode) { case FM: @@ -173,14 +174,14 @@ void _ui_drawMainBottom() meter_width, meter_height, rssi, - 255); + mic_level); break; case M17: gfx_drawSmeterLevel(meter_pos, meter_width, meter_height, rssi, - 255); + mic_level); break; } }