mirror of
https://github.com/armel/uv-k1-k5v3-firmware-custom.git
synced 2026-10-02 03:15:37 +00:00
Merge pull request #242 from mrkusypl/feature_update_v5_2
Eliminating high bars in Audio Scope after releasing the DTMF button
This commit is contained in:
1 file changed
+9
-8
+9
-8
@@ -279,16 +279,17 @@ void UI_DisplayAudioScope(void)
|
||||
s_was_tx = true;
|
||||
}
|
||||
|
||||
g_scope_buf[g_scope_write] = BK4819_GetVoiceAmplitudeOut();
|
||||
|
||||
// Let’s assume that values below 200 may be incorrect
|
||||
// to avoid full-height bars that may appear on the first TX
|
||||
if (g_scope_ready < SCOPE_SAMPLES) {
|
||||
// The first 7 bars after turning on the radio
|
||||
// will not display any values: they cause high bars.
|
||||
if (g_scope_ready >= 7)
|
||||
g_scope_buf[g_scope_write] = BK4819_GetVoiceAmplitudeOut();
|
||||
else
|
||||
g_scope_ready++;
|
||||
|
||||
if (g_scope_buf[g_scope_write] < SCOPE_VOLUME_MIN)
|
||||
g_scope_buf[g_scope_write] = SCOPE_VOLUME_MIN;
|
||||
}
|
||||
// If the reading is 0, it is definitely an incorrect value
|
||||
// caused by the microphone being muted - set it to 200.
|
||||
if (g_scope_buf[g_scope_write] == 0)
|
||||
g_scope_buf[g_scope_write] = SCOPE_VOLUME_MIN;
|
||||
|
||||
g_scope_write = (g_scope_write + 1u) % SCOPE_SAMPLES;
|
||||
|
||||
|
||||
Reference in new issue
Block a user