UI: Fix level meter and set it to platform mic level

This commit is contained in:
Federico Amedeo Izzo 2021-09-26 18:38:29 +02:00
parent 5113a39f2a
commit 990f5e8ce6
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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;
}
}