Skip to content

Commit

Permalink
looking glass: correct max_hold computation with new modes (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
gullradriel committed May 22, 2023
1 parent a1189fa commit ec8bf04
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions firmware/application/apps/ui_looking_glass_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,13 @@ void GlassView::add_spectrum_pixel(uint8_t power) {
// save max powerwull freq
if (spectrum_data[xpos] > max_freq_power) {
max_freq_power = spectrum_data[xpos];
max_freq_hold = f_center + ((looking_glass_range)*xpos) / SCREEN_W;
if (mode == LOOKING_GLASS_SINGLEPASS) {
max_freq_hold = f_min + (xpos * looking_glass_range) / SCREEN_W;
} else // if( mode == LOOKING_GLASS_SLOWSCAN || mode == LOOKING_GLASS_FASTSCAN )
{
max_freq_hold = f_min + (offset * each_bin_size) + (xpos * looking_glass_range) / SCREEN_W;
}
}

int16_t point = y_max_range.clip(((spectrum_data[xpos] - raw_min) * (320 - (108 + 16))) / raw_delta);
uint8_t color_gradient = (point * 255) / 212;
// clear if not in peak view
Expand Down

0 comments on commit ec8bf04

Please sign in to comment.