looking glass: correct max_hold computation with new modes (#1047)

This commit is contained in:
gullradriel 2023-05-22 23:24:46 +02:00 committed by GitHub
parent a1189faad1
commit ec8bf04baa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,9 +144,13 @@ void GlassView::add_spectrum_pixel(uint8_t power) {
// save max powerwull freq // save max powerwull freq
if (spectrum_data[xpos] > max_freq_power) { if (spectrum_data[xpos] > max_freq_power) {
max_freq_power = spectrum_data[xpos]; 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); int16_t point = y_max_range.clip(((spectrum_data[xpos] - raw_min) * (320 - (108 + 16))) / raw_delta);
uint8_t color_gradient = (point * 255) / 212; uint8_t color_gradient = (point * 255) / 212;
// clear if not in peak view // clear if not in peak view