mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 14:21:25 +03:00
Updated TX audio bar
This commit is contained in:
parent
04f9262635
commit
a4bb69a306
4
Makefile
4
Makefile
@ -37,8 +37,8 @@ ENABLE_AM_FIX_SHOW_DATA := 1
|
||||
ENABLE_SQUELCH_MORE_SENSITIVE := 1
|
||||
ENABLE_FASTER_CHANNEL_SCAN := 1
|
||||
ENABLE_RSSI_BAR := 1
|
||||
ENABLE_SHOW_TX_TIMEOUT := 1
|
||||
ENABLE_AUDIO_BAR := 0
|
||||
ENABLE_SHOW_TX_TIMEOUT := 0
|
||||
ENABLE_AUDIO_BAR := 1
|
||||
ENABLE_COPY_CHAN_TO_VFO := 1
|
||||
#ENABLE_PANADAPTER := 0
|
||||
#ENABLE_SINGLE_VFO_CHAN := 0
|
||||
|
@ -65,8 +65,8 @@ ENABLE_AM_FIX_SHOW_DATA := 1 show debug data for the AM fix (still t
|
||||
ENABLE_SQUELCH_MORE_SENSITIVE := 1 make squelch levels a little bit more sensitive - I plan to let user adjust the values themselves
|
||||
ENABLE_FASTER_CHANNEL_SCAN := 1 increases the channel scan speed, but the squelch is also made more twitchy
|
||||
ENABLE_RSSI_BAR := 1 enable a dBm/Sn RSSI bar graph level inplace of the little antenna symbols
|
||||
ENABLE_AUDIO_BAR := 0 experimental, display an audo bar level when TX'ing
|
||||
ENABLE_SHOW_TX_TIMEOUT := 1 show the TX time left when transmitting
|
||||
ENABLE_SHOW_TX_TIMEOUT := 0 show the remainng TX time
|
||||
ENABLE_AUDIO_BAR := 1 experimental, display an audo bar level when TX'ing, includes remaining TX time (in seconds)
|
||||
ENABLE_COPY_CHAN_TO_VFO := 1 copy current channel into the other VFO. Long press Menu key ('M')
|
||||
#ENABLE_BAND_SCOPE := 0 not yet implemented - spectrum/pan-adapter
|
||||
#ENABLE_SINGLE_VFO_CHAN := 0 not yet implemented - single VFO on display when possible
|
||||
|
@ -1529,7 +1529,7 @@ void APP_TimeSlice10ms(void)
|
||||
{ // transmitting
|
||||
#ifdef ENABLE_AUDIO_BAR
|
||||
if (g_setting_mic_bar && (g_flash_light_blink_counter % (150 / 10)) == 0) // once every 150ms
|
||||
UI_DisplayAudioBar();
|
||||
UI_DisplayAudioBar(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
30
app/fm.c
30
app/fm.c
@ -24,6 +24,7 @@
|
||||
#include "driver/bk1080.h"
|
||||
#include "driver/eeprom.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "driver/uart.h"
|
||||
#include "functions.h"
|
||||
#include "misc.h"
|
||||
#include "settings.h"
|
||||
@ -458,7 +459,7 @@ static void FM_Key_MENU(bool key_pressed, bool key_held)
|
||||
g_key_input_count_down = key_input_timeout_500ms;
|
||||
|
||||
if (key_held || key_pressed)
|
||||
return;
|
||||
return; // key still pressed
|
||||
|
||||
// see if the frequency is already stored in a channel
|
||||
for (i = 0; i < ARRAY_SIZE(g_fm_channels) && channel < 0; i++)
|
||||
@ -467,6 +468,10 @@ static void FM_Key_MENU(bool key_pressed, bool key_held)
|
||||
|
||||
g_request_display_screen = DISPLAY_FM;
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
//UART_SendText("fm menu 1\r\n");
|
||||
#endif
|
||||
|
||||
if (g_fm_scan_state == FM_SCAN_OFF)
|
||||
{ // not scanning
|
||||
|
||||
@ -501,25 +506,40 @@ static void FM_Key_MENU(bool key_pressed, bool key_held)
|
||||
else
|
||||
g_ask_to_delete = true;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{ // scanning
|
||||
|
||||
// scanning
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
//UART_SendText("fm menu 2\r\n");
|
||||
#endif
|
||||
|
||||
if (g_fm_auto_scan || !g_fm_found_frequency)
|
||||
{
|
||||
g_input_box_index = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
//UART_SendText("fm menu 3\r\n");
|
||||
#endif
|
||||
|
||||
if (g_ask_to_save)
|
||||
{
|
||||
g_fm_channels[g_fm_channel_position] = g_eeprom.fm_frequency_playing;
|
||||
g_ask_to_save = false;
|
||||
g_request_save_fm = true;
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
//UART_SendText("fm menu 4\r\n");
|
||||
#endif
|
||||
|
||||
if (channel < 0)
|
||||
g_ask_to_save = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void FM_Key_UP_DOWN(bool key_pressed, bool key_held, int8_t Step)
|
||||
|
@ -976,7 +976,8 @@ void BK4819_EnableDTMF(void)
|
||||
// <3:0> 14 Max symbol number for SelCall detection
|
||||
//
|
||||
// const uint16_t threshold = 24; // default, but doesn't decode non-QS radios
|
||||
const uint16_t threshold = 160; // but 128 ~ 247 does
|
||||
const uint16_t threshold = 130; // but 128 ~ 247 does
|
||||
// const uint16_t threshold = 8; // 0 ~ 63 ? .. doesn't work with A and B's :(
|
||||
BK4819_WriteRegister(BK4819_REG_24, // 1 00011000 1 1 1 1110
|
||||
(1u << BK4819_REG_24_SHIFT_UNKNOWN_15) |
|
||||
(threshold << BK4819_REG_24_SHIFT_THRESHOLD) | // 0 ~ 255
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -86,9 +86,9 @@ void UI_DisplayFM(void)
|
||||
}
|
||||
else
|
||||
if (!g_fm_auto_scan)
|
||||
strcpy(String, "M-SCAN");
|
||||
strcpy(String, "FREQ SCAN");
|
||||
else
|
||||
sprintf(String, "A-SCAN %u", 1 + g_fm_channel_position);
|
||||
sprintf(String, "A-SCAN %2u", 1 + g_fm_channel_position);
|
||||
}
|
||||
|
||||
UI_PrintString(String, 0, 127, 2, 10);
|
||||
|
66
ui/main.c
66
ui/main.c
@ -85,7 +85,7 @@ center_line_t center_line = CENTER_LINE_NONE;
|
||||
memset(p_line, 0, LCD_WIDTH);
|
||||
|
||||
sprintf(s, "TX %u", secs);
|
||||
UI_PrintStringSmall(s, 2, 0, line);
|
||||
UI_PrintStringSmallBold(s, 2, 0, line);
|
||||
|
||||
#if 1
|
||||
// solid bar
|
||||
@ -146,30 +146,41 @@ void UI_drawBars(uint8_t *p, const unsigned int level)
|
||||
return sqrti;
|
||||
}
|
||||
|
||||
void UI_DisplayAudioBar(void)
|
||||
bool UI_DisplayAudioBar(const bool now)
|
||||
{
|
||||
if (g_setting_mic_bar)
|
||||
{
|
||||
const unsigned int line = 3;
|
||||
const unsigned int bar_x = 2;
|
||||
const unsigned int bar_width = LCD_WIDTH - 2 - bar_x;
|
||||
unsigned int i;
|
||||
if (g_current_function != FUNCTION_TRANSMIT || g_screen_to_display != DISPLAY_MAIN)
|
||||
return false;
|
||||
|
||||
if (g_current_function != FUNCTION_TRANSMIT ||
|
||||
g_screen_to_display != DISPLAY_MAIN ||
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
||||
{
|
||||
return; // screen is in use
|
||||
}
|
||||
if (center_line != CENTER_LINE_NONE && center_line != CENTER_LINE_AUDIO_BAR)
|
||||
return false;
|
||||
|
||||
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
||||
return false;
|
||||
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
if (g_alarm_state != ALARM_STATE_OFF)
|
||||
return;
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (g_setting_mic_bar)
|
||||
{
|
||||
#if 1
|
||||
// TX audio level
|
||||
const unsigned int line = 3;
|
||||
const unsigned int txt_width = 7 * 3; // 3 text chars
|
||||
const unsigned int bar_x = 2 + txt_width + 4; // X coord of bar graph
|
||||
const unsigned int bar_width = LCD_WIDTH - 1 - bar_x;
|
||||
const unsigned int secs = g_tx_timer_count_down_500ms / 2;
|
||||
uint8_t *p_line = g_frame_buffer[line];
|
||||
unsigned int i;
|
||||
char s[16];
|
||||
|
||||
if (now)
|
||||
memset(p_line, 0, LCD_WIDTH);
|
||||
|
||||
// TX timeout seconds
|
||||
sprintf(s, "%3u", secs);
|
||||
UI_PrintStringSmallBold(s, 2, 0, line);
|
||||
|
||||
{ // TX audio level
|
||||
|
||||
const unsigned int voice_amp = BK4819_GetVoiceAmplitudeOut(); // 15:0
|
||||
|
||||
@ -182,20 +193,6 @@ void UI_drawBars(uint8_t *p, const unsigned int level)
|
||||
const unsigned int sqrt_level = sqrt16((level < 65535) ? level : 65535);
|
||||
const unsigned int len = (sqrt_level <= bar_width) ? sqrt_level : bar_width;
|
||||
|
||||
#else
|
||||
// TX/RX AF input level (dB)
|
||||
|
||||
const uint8_t af_tx_rx = BK4819_GetAfTxRx(); // 6:0
|
||||
const unsigned int max = 63;
|
||||
const unsigned int level = (((uint16_t)af_tx_rx * bar_width) + (max / 2)) / max; // with rounding
|
||||
const unsigned int len = (level <= bar_width) ? level : bar_width;
|
||||
|
||||
#endif
|
||||
|
||||
uint8_t *p_line = g_frame_buffer[line];
|
||||
|
||||
memset(p_line, 0, LCD_WIDTH);
|
||||
|
||||
#if 1
|
||||
// solid bar
|
||||
for (i = 0; i < bar_width; i++)
|
||||
@ -206,10 +203,12 @@ void UI_drawBars(uint8_t *p, const unsigned int level)
|
||||
p_line[bar_x + i] = (i <= len) ? 0x7f : 0x41;
|
||||
#endif
|
||||
|
||||
if (g_current_function == FUNCTION_TRANSMIT)
|
||||
if (now)
|
||||
ST7565_BlitFullScreen();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -805,10 +804,9 @@ void UI_DisplayMain(void)
|
||||
|
||||
#ifdef ENABLE_AUDIO_BAR
|
||||
// show the TX audio level
|
||||
if (g_setting_mic_bar && g_current_function == FUNCTION_TRANSMIT)
|
||||
if (UI_DisplayAudioBar(false))
|
||||
{
|
||||
center_line = CENTER_LINE_AUDIO_BAR;
|
||||
UI_DisplayAudioBar();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
@ -35,7 +35,7 @@ extern center_line_t center_line;
|
||||
bool UI_DisplayTXCountdown(const bool now);
|
||||
#endif
|
||||
#ifdef ENABLE_AUDIO_BAR
|
||||
void UI_DisplayAudioBar(void);
|
||||
bool UI_DisplayAudioBar(const bool now);
|
||||
#endif
|
||||
void UI_UpdateRSSI(const int16_t rssi, const int vfo);
|
||||
void UI_DisplayMain(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user