Reduced smeter width, fix max RSSI representation
This commit is contained in:
parent
e35870a40f
commit
3017ff1f3a
|
|
@ -551,13 +551,13 @@ void gfx_drawSmeter(point_t start, uint16_t width, uint16_t height, float rssi,
|
|||
{
|
||||
color_t color = (i % 3 == 0) ? yellow : white;
|
||||
color = (i > 9) ? red : color;
|
||||
point_t pixel_pos = {i * (width - 1) / 11, start.y};
|
||||
point_t pixel_pos = {start.x + i * (width - 1) / 11, start.y};
|
||||
gfx_setPixel(pixel_pos, color);
|
||||
pixel_pos.y += height;
|
||||
gfx_setPixel(pixel_pos, color);
|
||||
}
|
||||
|
||||
point_t pixel_pos = {width - 1, start.y};
|
||||
point_t pixel_pos = {start.x + width - 1, start.y};
|
||||
gfx_setPixel(pixel_pos, red);
|
||||
pixel_pos.y += height;
|
||||
gfx_setPixel(pixel_pos, red);
|
||||
|
|
@ -566,6 +566,7 @@ void gfx_drawSmeter(point_t start, uint16_t width, uint16_t height, float rssi,
|
|||
uint16_t rssi_height = height * 2 / 3;
|
||||
float s_level = (127.0f + rssi) / 6.0f;
|
||||
uint16_t rssi_width = (s_level < 0.0f) ? 0 : (s_level * (width - 1) / 11);
|
||||
rssi_width = (s_level > 10.0f) ? width : rssi_width;
|
||||
point_t rssi_pos = { start.x, start.y + 1 };
|
||||
gfx_drawRect(rssi_pos, rssi_width, rssi_height, white, true);
|
||||
|
||||
|
|
|
|||
|
|
@ -156,11 +156,17 @@ void _ui_drawBottom()
|
|||
// Squelch bar
|
||||
float rssi = last_state.rssi;
|
||||
float squelch = last_state.sqlLevel / 16.0f;
|
||||
point_t smeter_pos = { 0, layout.bottom_pos.y +
|
||||
layout.status_v_pad +
|
||||
layout.text_v_offset -
|
||||
layout.bottom_h };
|
||||
gfx_drawSmeter(smeter_pos, SCREEN_WIDTH, layout.bottom_h - 1, rssi, squelch, color_white);
|
||||
point_t smeter_pos = { layout.horizontal_pad,
|
||||
layout.bottom_pos.y +
|
||||
layout.status_v_pad +
|
||||
layout.text_v_offset -
|
||||
layout.bottom_h };
|
||||
gfx_drawSmeter(smeter_pos,
|
||||
SCREEN_WIDTH - 2 * layout.horizontal_pad,
|
||||
layout.bottom_h - 1,
|
||||
rssi,
|
||||
squelch,
|
||||
color_white);
|
||||
}
|
||||
|
||||
void _ui_drawMainVFO()
|
||||
|
|
|
|||
|
|
@ -510,12 +510,13 @@ bool _ui_drawMacroMenu() {
|
|||
// Smeter bar
|
||||
float rssi = last_state.rssi;
|
||||
float squelch = last_state.sqlLevel / 16.0f;
|
||||
point_t smeter_pos = { 0, layout.bottom_pos.y +
|
||||
layout.status_v_pad +
|
||||
layout.text_v_offset -
|
||||
layout.bottom_h };
|
||||
point_t smeter_pos = { layout.horizontal_pad,
|
||||
layout.bottom_pos.y +
|
||||
layout.status_v_pad +
|
||||
layout.text_v_offset -
|
||||
layout.bottom_h };
|
||||
gfx_drawSmeter(smeter_pos,
|
||||
SCREEN_WIDTH,
|
||||
SCREEN_WIDTH - 2 * layout.horizontal_pad,
|
||||
layout.bottom_h - 1,
|
||||
rssi,
|
||||
squelch,
|
||||
|
|
|
|||
Loading…
Reference in New Issue