2023-09-09 08:03:56 +01:00
|
|
|
/* Copyright 2023 Dual Tachyon
|
|
|
|
* https://github.com/DualTachyon
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-10-05 15:26:08 +01:00
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
|
|
|
#pragma GCC diagnostic pop
|
|
|
|
|
2023-09-09 08:03:56 +01:00
|
|
|
#include <string.h>
|
2023-09-27 17:29:49 +01:00
|
|
|
#include <stdlib.h> // abs()
|
2023-09-09 08:03:56 +01:00
|
|
|
|
|
|
|
#include "app/dtmf.h"
|
2023-09-23 12:07:46 +01:00
|
|
|
#ifdef ENABLE_AM_FIX_SHOW_DATA
|
|
|
|
#include "am_fix.h"
|
|
|
|
#endif
|
2023-09-09 08:03:56 +01:00
|
|
|
#include "bitmaps.h"
|
2023-09-20 08:29:11 +01:00
|
|
|
#include "board.h"
|
2023-10-09 12:39:47 +01:00
|
|
|
#include "driver/backlight.h"
|
2023-09-21 07:31:29 +01:00
|
|
|
#include "driver/bk4819.h"
|
2023-09-09 08:03:56 +01:00
|
|
|
#include "driver/st7565.h"
|
|
|
|
#include "external/printf/printf.h"
|
|
|
|
#include "functions.h"
|
2023-09-18 14:31:14 +01:00
|
|
|
#include "helper/battery.h"
|
2023-09-09 08:03:56 +01:00
|
|
|
#include "misc.h"
|
|
|
|
#include "radio.h"
|
|
|
|
#include "settings.h"
|
|
|
|
#include "ui/helper.h"
|
|
|
|
#include "ui/inputbox.h"
|
|
|
|
#include "ui/main.h"
|
2023-10-08 12:39:30 +01:00
|
|
|
#include "ui/menu.h"
|
2023-09-23 12:25:06 +01:00
|
|
|
#include "ui/ui.h"
|
2023-09-09 08:03:56 +01:00
|
|
|
|
2023-10-02 09:31:35 +01:00
|
|
|
center_line_t center_line = CENTER_LINE_NONE;
|
2023-09-30 11:22:19 +01:00
|
|
|
|
2023-09-29 08:43:05 +01:00
|
|
|
// ***************************************************************************
|
|
|
|
|
2023-10-08 12:39:30 +01:00
|
|
|
#ifdef ENABLE_SHOW_TX_TIMEOUT
|
|
|
|
bool UI_DisplayTXCountdown(const bool now)
|
|
|
|
{
|
|
|
|
unsigned int timeout_secs = 0;
|
|
|
|
|
2023-10-08 23:08:18 +01:00
|
|
|
if (g_current_function != FUNCTION_TRANSMIT || g_screen_to_display != DISPLAY_MAIN)
|
2023-10-08 12:39:30 +01:00
|
|
|
return false;
|
|
|
|
|
|
|
|
if (center_line != CENTER_LINE_NONE && center_line != CENTER_LINE_TX_TIMEOUT)
|
|
|
|
return false;
|
|
|
|
|
2023-10-08 17:14:13 +01:00
|
|
|
if (g_eeprom.tx_timeout_timer == 0)
|
2023-10-08 12:39:30 +01:00
|
|
|
timeout_secs = 30; // 30 sec
|
|
|
|
else
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_eeprom.tx_timeout_timer < (ARRAY_SIZE(g_sub_menu_TOT) - 1))
|
2023-10-08 17:14:13 +01:00
|
|
|
timeout_secs = 60 * g_eeprom.tx_timeout_timer; // minutes
|
2023-10-08 12:39:30 +01:00
|
|
|
else
|
|
|
|
timeout_secs = 60 * 15; // 15 minutes
|
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (timeout_secs == 0 || g_tx_timer_count_down_500ms == 0)
|
2023-10-08 12:39:30 +01:00
|
|
|
return false;
|
2023-10-11 23:07:58 +01:00
|
|
|
|
2023-10-08 12:39:30 +01:00
|
|
|
{
|
|
|
|
const unsigned int line = 3;
|
|
|
|
const unsigned int txt_width = 7 * 6; // 6 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;
|
2023-10-08 20:23:37 +01:00
|
|
|
const unsigned int secs = g_tx_timer_count_down_500ms / 2;
|
2023-10-08 12:39:30 +01:00
|
|
|
const unsigned int level = ((secs * bar_width) + (timeout_secs / 2)) / timeout_secs; // with rounding
|
|
|
|
// const unsigned int level = (((timeout_secs - secs) * bar_width) + (timeout_secs / 2)) / timeout_secs; // with rounding
|
|
|
|
const unsigned int len = (level <= bar_width) ? level : bar_width;
|
2023-10-08 20:23:37 +01:00
|
|
|
uint8_t *p_line = g_frame_buffer[line];
|
2023-10-08 12:39:30 +01:00
|
|
|
unsigned int i;
|
2023-10-12 10:45:35 +01:00
|
|
|
char s[17];
|
2023-10-11 23:07:58 +01:00
|
|
|
|
2023-10-08 12:39:30 +01:00
|
|
|
if (now)
|
|
|
|
memset(p_line, 0, LCD_WIDTH);
|
|
|
|
|
|
|
|
sprintf(s, "TX %u", secs);
|
2023-10-12 14:55:10 +01:00
|
|
|
#ifdef ENABLE_SMALL_BOLD
|
|
|
|
UI_PrintStringSmallBold(s, 2, 0, line);
|
|
|
|
#else
|
|
|
|
UI_PrintStringSmall(s, 2, 0, line);
|
|
|
|
#endif
|
2023-10-14 09:43:53 +01:00
|
|
|
|
2023-10-08 12:39:30 +01:00
|
|
|
#if 1
|
|
|
|
// solid bar
|
|
|
|
for (i = 0; i < bar_width; i++)
|
|
|
|
p_line[bar_x + i] = (i > len) ? ((i & 1) == 0) ? 0x41 : 0x00 : ((i & 1) == 0) ? 0x7f : 0x3e;
|
|
|
|
#else
|
|
|
|
// knuled bar
|
|
|
|
for (i = 0; i < bar_width; i += 2)
|
|
|
|
p_line[bar_x + i] = (i <= len) ? 0x7f : 0x41;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (now)
|
|
|
|
ST7565_BlitFullScreen();
|
|
|
|
}
|
2023-10-11 23:07:58 +01:00
|
|
|
|
2023-10-08 12:39:30 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2023-10-04 10:01:07 +01:00
|
|
|
void UI_drawBars(uint8_t *p, const unsigned int level)
|
|
|
|
{
|
2023-10-05 15:26:08 +01:00
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
|
|
|
|
2023-10-04 10:01:07 +01:00
|
|
|
switch (level)
|
|
|
|
{
|
|
|
|
default:
|
2023-10-08 20:23:37 +01:00
|
|
|
case 7: memmove(p + 20, BITMAP_ANTENNA_LEVEL6, sizeof(BITMAP_ANTENNA_LEVEL6));
|
|
|
|
case 6: memmove(p + 17, BITMAP_ANTENNA_LEVEL5, sizeof(BITMAP_ANTENNA_LEVEL5));
|
|
|
|
case 5: memmove(p + 14, BITMAP_ANTENNA_LEVEL4, sizeof(BITMAP_ANTENNA_LEVEL4));
|
|
|
|
case 4: memmove(p + 11, BITMAP_ANTENNA_LEVEL3, sizeof(BITMAP_ANTENNA_LEVEL3));
|
|
|
|
case 3: memmove(p + 8, BITMAP_ANTENNA_LEVEL2, sizeof(BITMAP_ANTENNA_LEVEL2));
|
|
|
|
case 2: memmove(p + 5, BITMAP_ANTENNA_LEVEL1, sizeof(BITMAP_ANTENNA_LEVEL1));
|
2023-10-14 11:55:43 +01:00
|
|
|
case 1: memmove(p + 0, BITMAP_ANTENNA, sizeof(BITMAP_ANTENNA)); break;
|
|
|
|
case 0: memset( p + 0, 0, sizeof(BITMAP_ANTENNA)); break;
|
2023-10-04 10:01:07 +01:00
|
|
|
}
|
2023-10-05 15:26:08 +01:00
|
|
|
|
|
|
|
#pragma GCC diagnostic pop
|
2023-10-04 10:01:07 +01:00
|
|
|
}
|
|
|
|
|
2023-09-21 07:31:29 +01:00
|
|
|
#ifdef ENABLE_AUDIO_BAR
|
2023-09-27 00:26:58 +01:00
|
|
|
|
2023-10-12 10:45:35 +01:00
|
|
|
uint32_t sqrt16(uint32_t value)
|
2023-09-27 00:26:58 +01:00
|
|
|
{ // return square root of 'value'
|
2023-10-12 10:45:35 +01:00
|
|
|
unsigned int shift = 16; // this is the number of bits supplied in 'value' .. 2 ~ 32
|
|
|
|
uint32_t bit = 1u << --shift;
|
|
|
|
uint32_t sqrti = 0;
|
2023-09-29 08:43:05 +01:00
|
|
|
while (bit)
|
|
|
|
{
|
2023-10-12 10:45:35 +01:00
|
|
|
const uint32_t temp = ((sqrti << 1) | bit) << shift--;
|
2023-09-27 00:26:58 +01:00
|
|
|
if (value >= temp)
|
|
|
|
{
|
|
|
|
value -= temp;
|
|
|
|
sqrti |= bit;
|
|
|
|
}
|
2023-09-29 08:43:05 +01:00
|
|
|
bit >>= 1;
|
|
|
|
}
|
2023-09-27 00:26:58 +01:00
|
|
|
return sqrti;
|
|
|
|
}
|
|
|
|
|
2023-10-11 23:07:58 +01:00
|
|
|
bool UI_DisplayAudioBar(const bool now)
|
2023-09-21 07:31:29 +01:00
|
|
|
{
|
2023-10-11 23:07:58 +01:00
|
|
|
if (g_current_function != FUNCTION_TRANSMIT || g_screen_to_display != DISPLAY_MAIN)
|
|
|
|
return false;
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-11 23:07:58 +01:00
|
|
|
if (center_line != CENTER_LINE_NONE && center_line != CENTER_LINE_AUDIO_BAR)
|
|
|
|
return false;
|
2023-09-29 10:25:33 +01:00
|
|
|
|
2023-10-11 23:07:58 +01:00
|
|
|
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
|
|
|
return false;
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-11 23:07:58 +01:00
|
|
|
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
|
|
|
if (g_alarm_state != ALARM_STATE_OFF)
|
|
|
|
return false;
|
|
|
|
#endif
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-11 23:07:58 +01:00
|
|
|
if (g_setting_mic_bar)
|
|
|
|
{
|
|
|
|
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];
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-11 23:07:58 +01:00
|
|
|
if (now)
|
|
|
|
memset(p_line, 0, LCD_WIDTH);
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-11 23:07:58 +01:00
|
|
|
// TX timeout seconds
|
|
|
|
sprintf(s, "%3u", secs);
|
|
|
|
UI_PrintStringSmallBold(s, 2, 0, line);
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-11 23:07:58 +01:00
|
|
|
{ // TX audio level
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-11 23:07:58 +01:00
|
|
|
const unsigned int voice_amp = BK4819_GetVoiceAmplitudeOut(); // 15:0
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-11 23:07:58 +01:00
|
|
|
// const unsigned int max = 65535;
|
|
|
|
// const unsigned int level = ((voice_amp * bar_width) + (max / 2)) / max; // with rounding
|
|
|
|
// const unsigned int len = (level <= bar_width) ? level : bar_width;
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-11 23:07:58 +01:00
|
|
|
// make non-linear to make more sensitive at low values
|
|
|
|
const unsigned int level = voice_amp * 8;
|
|
|
|
const unsigned int sqrt_level = sqrt16((level < 65535) ? level : 65535);
|
|
|
|
const unsigned int len = (sqrt_level <= bar_width) ? sqrt_level : bar_width;
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-05 00:01:13 +01:00
|
|
|
#if 1
|
|
|
|
// solid bar
|
|
|
|
for (i = 0; i < bar_width; i++)
|
|
|
|
p_line[bar_x + i] = (i > len) ? ((i & 1) == 0) ? 0x41 : 0x00 : ((i & 1) == 0) ? 0x7f : 0x3e;
|
|
|
|
#else
|
|
|
|
// knuled bar
|
|
|
|
for (i = 0; i < bar_width; i += 2)
|
|
|
|
p_line[bar_x + i] = (i <= len) ? 0x7f : 0x41;
|
|
|
|
#endif
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-11 23:07:58 +01:00
|
|
|
if (now)
|
2023-10-05 00:01:13 +01:00
|
|
|
ST7565_BlitFullScreen();
|
|
|
|
}
|
2023-09-21 07:31:29 +01:00
|
|
|
}
|
2023-10-11 23:07:58 +01:00
|
|
|
|
|
|
|
return true;
|
2023-09-21 07:31:29 +01:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2023-10-08 12:39:30 +01:00
|
|
|
#ifdef ENABLE_RSSI_BAR
|
2023-09-29 08:43:05 +01:00
|
|
|
void UI_DisplayRSSIBar(const int16_t rssi, const bool now)
|
|
|
|
{
|
2023-10-01 00:04:51 +01:00
|
|
|
// const int16_t s0_dBm = -127; // S0 .. base level
|
|
|
|
const int16_t s0_dBm = -147; // S0 .. base level
|
2023-09-29 08:43:05 +01:00
|
|
|
|
2023-09-30 17:14:48 +01:00
|
|
|
const int16_t s9_dBm = s0_dBm + (6 * 9); // S9 .. 6dB/S-Point
|
2023-09-29 20:48:23 +01:00
|
|
|
const int16_t bar_max_dBm = s9_dBm + 30; // S9+30dB
|
2023-10-01 09:14:19 +01:00
|
|
|
// const int16_t bar_min_dBm = s0_dBm + (6 * 0); // S0
|
2023-10-01 00:10:45 +01:00
|
|
|
const int16_t bar_min_dBm = s0_dBm + (6 * 4); // S4
|
2023-09-29 08:43:05 +01:00
|
|
|
|
2023-09-29 20:48:23 +01:00
|
|
|
// ************
|
2023-09-29 08:43:05 +01:00
|
|
|
|
2023-09-29 20:48:23 +01:00
|
|
|
const unsigned int txt_width = 7 * 8; // 8 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;
|
2023-09-29 08:43:05 +01:00
|
|
|
|
2023-09-30 20:03:09 +01:00
|
|
|
const int16_t rssi_dBm = (rssi / 2) - 160;
|
|
|
|
const int16_t clamped_dBm = (rssi_dBm <= bar_min_dBm) ? bar_min_dBm : (rssi_dBm >= bar_max_dBm) ? bar_max_dBm : rssi_dBm;
|
2023-09-29 20:48:23 +01:00
|
|
|
const unsigned int bar_range_dB = bar_max_dBm - bar_min_dBm;
|
|
|
|
const unsigned int len = ((clamped_dBm - bar_min_dBm) * bar_width) / bar_range_dB;
|
2023-09-29 08:43:05 +01:00
|
|
|
|
2023-09-29 20:48:23 +01:00
|
|
|
const unsigned int line = 3;
|
2023-10-08 20:23:37 +01:00
|
|
|
uint8_t *p_line = g_frame_buffer[line];
|
2023-09-29 20:48:23 +01:00
|
|
|
|
|
|
|
char s[16];
|
|
|
|
unsigned int i;
|
2023-09-29 10:25:33 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_eeprom.key_lock && g_keypad_locked > 0)
|
2023-09-29 08:43:05 +01:00
|
|
|
return; // display is in use
|
2023-10-05 09:17:38 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_current_function == FUNCTION_TRANSMIT ||
|
|
|
|
g_screen_to_display != DISPLAY_MAIN ||
|
|
|
|
g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
2023-09-29 08:43:05 +01:00
|
|
|
return; // display is in use
|
2023-09-29 10:25:33 +01:00
|
|
|
|
2023-09-29 08:43:05 +01:00
|
|
|
if (now)
|
2023-10-01 10:15:24 +01:00
|
|
|
memset(p_line, 0, LCD_WIDTH);
|
2023-09-29 08:43:05 +01:00
|
|
|
|
2023-09-30 20:03:09 +01:00
|
|
|
if (rssi_dBm >= (s9_dBm + 6))
|
|
|
|
{ // S9+XXdB, 1dB increment
|
2023-10-02 09:31:35 +01:00
|
|
|
const char *fmt[] = {"%3d 9+%u ", "%3d 9+%2u "};
|
|
|
|
const unsigned int s9_dB = ((rssi_dBm - s9_dBm) <= 99) ? rssi_dBm - s9_dBm : 99;
|
|
|
|
sprintf(s, (s9_dB < 10) ? fmt[0] : fmt[1], rssi_dBm, s9_dB);
|
2023-09-30 20:03:09 +01:00
|
|
|
}
|
2023-09-29 08:43:05 +01:00
|
|
|
else
|
2023-09-30 20:03:09 +01:00
|
|
|
{ // S0 ~ S9, 6dB per S-point
|
|
|
|
const unsigned int s_level = (rssi_dBm >= s0_dBm) ? (rssi_dBm - s0_dBm) / 6 : 0;
|
2023-10-02 09:31:35 +01:00
|
|
|
sprintf(s, "%4d S%u ", rssi_dBm, s_level);
|
2023-09-30 20:03:09 +01:00
|
|
|
}
|
2023-09-29 08:43:05 +01:00
|
|
|
UI_PrintStringSmall(s, 2, 0, line);
|
|
|
|
|
2023-09-29 09:58:32 +01:00
|
|
|
#if 1
|
|
|
|
// solid bar
|
|
|
|
for (i = 0; i < bar_width; i++)
|
2023-10-01 10:15:24 +01:00
|
|
|
p_line[bar_x + i] = (i > len) ? ((i & 1) == 0) ? 0x41 : 0x00 : ((i & 1) == 0) ? 0x7f : 0x3e;
|
2023-09-29 09:58:32 +01:00
|
|
|
#else
|
|
|
|
// knuled bar
|
|
|
|
for (i = 0; i < bar_width; i += 2)
|
2023-10-01 10:15:24 +01:00
|
|
|
p_line[bar_x + i] = (i <= len) ? 0x7f : 0x41;
|
2023-09-29 09:58:32 +01:00
|
|
|
#endif
|
2023-09-29 08:43:05 +01:00
|
|
|
|
|
|
|
if (now)
|
|
|
|
ST7565_BlitFullScreen();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void UI_UpdateRSSI(const int16_t rssi, const int vfo)
|
|
|
|
{
|
|
|
|
#ifdef ENABLE_RSSI_BAR
|
|
|
|
|
2023-10-05 15:26:08 +01:00
|
|
|
(void)vfo; // unused
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-02 09:31:35 +01:00
|
|
|
// optional larger RSSI dBm, S-point and bar level
|
|
|
|
|
|
|
|
if (center_line != CENTER_LINE_RSSI)
|
2023-09-30 11:22:19 +01:00
|
|
|
return;
|
2023-09-30 20:03:09 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_current_function == FUNCTION_RECEIVE ||
|
|
|
|
g_current_function == FUNCTION_MONITOR ||
|
|
|
|
g_current_function == FUNCTION_INCOMING)
|
2023-10-02 01:44:33 +01:00
|
|
|
{
|
|
|
|
UI_DisplayRSSIBar(rssi, true);
|
|
|
|
}
|
2023-10-02 09:31:35 +01:00
|
|
|
|
2023-09-29 08:43:05 +01:00
|
|
|
#else
|
|
|
|
|
2023-10-02 09:31:35 +01:00
|
|
|
// original little RS bars
|
|
|
|
|
2023-10-14 11:55:43 +01:00
|
|
|
// const int16_t dBm = (rssi / 2) - 160;
|
|
|
|
const uint8_t Line = (vfo == 0) ? 3 : 7;
|
|
|
|
uint8_t *p_line = g_frame_buffer[Line - 1];
|
|
|
|
uint8_t rssi_level = 0;
|
2023-09-29 15:22:41 +01:00
|
|
|
|
|
|
|
// TODO: sort out all 8 values from the eeprom
|
2023-09-29 08:43:05 +01:00
|
|
|
|
2023-10-14 09:43:53 +01:00
|
|
|
#if 1
|
|
|
|
const unsigned int band = g_rx_vfo->band;
|
2023-10-08 20:23:37 +01:00
|
|
|
const int16_t level0 = g_eeprom_rssi_calib[band][0];
|
|
|
|
const int16_t level1 = g_eeprom_rssi_calib[band][1];
|
|
|
|
const int16_t level2 = g_eeprom_rssi_calib[band][2];
|
|
|
|
const int16_t level3 = g_eeprom_rssi_calib[band][3];
|
2023-09-29 08:43:05 +01:00
|
|
|
#else
|
2023-10-14 09:43:53 +01:00
|
|
|
const int16_t level0 = (-115 + 160) * 2; // -115dBm
|
|
|
|
const int16_t level1 = ( -89 + 160) * 2; // -89dBm
|
|
|
|
const int16_t level2 = ( -64 + 160) * 2; // -64dBm
|
|
|
|
const int16_t level3 = ( -39 + 160) * 2; // -39dBm
|
2023-09-29 08:43:05 +01:00
|
|
|
#endif
|
2023-10-14 11:55:43 +01:00
|
|
|
// create intermediate threshold values (linear interpolation) to make full use of the available RSSI bars/graphics
|
2023-09-29 08:43:05 +01:00
|
|
|
const int16_t level01 = (level0 + level1) / 2;
|
|
|
|
const int16_t level12 = (level1 + level2) / 2;
|
|
|
|
const int16_t level23 = (level2 + level3) / 2;
|
2023-09-29 10:25:33 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
g_vfo_rssi[vfo] = rssi;
|
2023-09-29 10:25:33 +01:00
|
|
|
|
2023-10-14 11:55:43 +01:00
|
|
|
if (rssi >= level3)
|
|
|
|
rssi_level = 7;
|
2023-09-29 08:43:05 +01:00
|
|
|
else
|
2023-10-14 11:55:43 +01:00
|
|
|
if (rssi >= level23)
|
|
|
|
rssi_level = 6;
|
2023-09-29 08:43:05 +01:00
|
|
|
else
|
2023-10-14 11:55:43 +01:00
|
|
|
if (rssi >= level2)
|
|
|
|
rssi_level = 5;
|
2023-09-29 08:43:05 +01:00
|
|
|
else
|
2023-10-14 11:55:43 +01:00
|
|
|
if (rssi >= level12)
|
|
|
|
rssi_level = 4;
|
2023-09-29 08:43:05 +01:00
|
|
|
else
|
2023-10-14 11:55:43 +01:00
|
|
|
if (rssi >= level1)
|
|
|
|
rssi_level = 3;
|
2023-09-29 08:43:05 +01:00
|
|
|
else
|
2023-10-14 11:55:43 +01:00
|
|
|
if (rssi >= level01)
|
|
|
|
rssi_level = 2;
|
2023-09-29 08:43:05 +01:00
|
|
|
else
|
2023-10-14 11:55:43 +01:00
|
|
|
if (rssi >= level0 ||
|
|
|
|
g_current_function == FUNCTION_MONITOR ||
|
|
|
|
g_current_function == FUNCTION_INCOMING)
|
|
|
|
{
|
|
|
|
rssi_level = 1;
|
|
|
|
}
|
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_vfo_rssi_bar_level[vfo] == rssi_level)
|
2023-09-29 08:43:05 +01:00
|
|
|
return;
|
2023-09-29 10:25:33 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
g_vfo_rssi_bar_level[vfo] = rssi_level;
|
2023-09-29 10:25:33 +01:00
|
|
|
|
2023-09-29 08:43:05 +01:00
|
|
|
// **********************************************************
|
2023-09-29 10:25:33 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_eeprom.key_lock && g_keypad_locked > 0)
|
2023-09-29 08:43:05 +01:00
|
|
|
return; // display is in use
|
2023-09-29 10:25:33 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_current_function == FUNCTION_TRANSMIT || g_screen_to_display != DISPLAY_MAIN)
|
2023-09-29 08:43:05 +01:00
|
|
|
return; // display is in use
|
2023-09-29 10:25:33 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
p_line = g_frame_buffer[Line - 1];
|
2023-09-29 10:25:33 +01:00
|
|
|
|
2023-10-01 10:15:24 +01:00
|
|
|
memset(p_line, 0, 23);
|
2023-09-29 10:25:33 +01:00
|
|
|
|
2023-10-04 10:01:07 +01:00
|
|
|
// untested !!!
|
|
|
|
|
|
|
|
if (rssi_level == 0)
|
2023-10-01 10:15:24 +01:00
|
|
|
p_line = NULL;
|
2023-10-04 10:01:07 +01:00
|
|
|
else
|
|
|
|
UI_drawBars(p_line, rssi_level);
|
2023-09-29 10:25:33 +01:00
|
|
|
|
2023-10-01 10:15:24 +01:00
|
|
|
ST7565_DrawLine(0, Line, 23, p_line);
|
2023-09-29 08:43:05 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
2023-09-09 08:03:56 +01:00
|
|
|
void UI_DisplayMain(void)
|
|
|
|
{
|
2023-10-01 10:15:24 +01:00
|
|
|
const unsigned int line0 = 0; // text screen line
|
|
|
|
const unsigned int line1 = 4;
|
|
|
|
char String[16];
|
|
|
|
unsigned int vfo_num;
|
2023-09-28 22:22:06 +01:00
|
|
|
|
2023-10-02 09:31:35 +01:00
|
|
|
center_line = CENTER_LINE_NONE;
|
2023-09-30 20:03:09 +01:00
|
|
|
|
2023-09-28 22:22:06 +01:00
|
|
|
// #ifdef SINGLE_VFO_CHAN
|
2023-10-08 17:14:13 +01:00
|
|
|
// const bool single_vfo = (g_eeprom.dual_watch == DUAL_WATCH_OFF && g_eeprom.cross_vfo_rx_tx == CROSS_BAND_OFF) ? true : false;
|
2023-09-28 22:22:06 +01:00
|
|
|
// #else
|
|
|
|
const bool single_vfo = false;
|
|
|
|
// #endif
|
2023-09-09 08:03:56 +01:00
|
|
|
|
2023-10-01 10:15:24 +01:00
|
|
|
// clear the screen
|
2023-10-08 20:23:37 +01:00
|
|
|
memset(g_frame_buffer, 0, sizeof(g_frame_buffer));
|
2023-09-09 08:03:56 +01:00
|
|
|
|
2023-10-09 12:39:47 +01:00
|
|
|
if (g_serial_config_count_down_500ms > 0)
|
|
|
|
{
|
|
|
|
backlight_turn_on();
|
|
|
|
UI_PrintString("UART", 0, LCD_WIDTH, 1, 8);
|
|
|
|
UI_PrintString("CONFIG COMMS", 0, LCD_WIDTH, 3, 8);
|
|
|
|
ST7565_BlitFullScreen();
|
|
|
|
return;
|
|
|
|
}
|
2023-10-11 23:07:58 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_eeprom.key_lock && g_keypad_locked > 0)
|
2023-09-19 07:16:15 +01:00
|
|
|
{ // tell user how to unlock the keyboard
|
2023-10-09 12:39:47 +01:00
|
|
|
backlight_turn_on();
|
2023-09-19 15:35:32 +01:00
|
|
|
UI_PrintString("Long press #", 0, LCD_WIDTH, 1, 8);
|
|
|
|
UI_PrintString("to unlock", 0, LCD_WIDTH, 3, 8);
|
2023-09-09 08:03:56 +01:00
|
|
|
ST7565_BlitFullScreen();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-09-10 05:49:39 +01:00
|
|
|
for (vfo_num = 0; vfo_num < 2; vfo_num++)
|
2023-09-09 08:03:56 +01:00
|
|
|
{
|
2023-10-01 19:17:51 +01:00
|
|
|
const unsigned int line = (vfo_num == 0) ? line0 : line1;
|
2023-10-08 17:14:13 +01:00
|
|
|
unsigned int channel = g_eeprom.tx_vfo;
|
|
|
|
// unsigned int tx_channel = (g_eeprom.cross_vfo_rx_tx == CROSS_BAND_OFF) ? g_eeprom.rx_vfo : g_eeprom.tx_vfo;
|
2023-10-01 19:17:51 +01:00
|
|
|
const bool same_vfo = (channel == vfo_num) ? true : false;
|
2023-10-08 20:23:37 +01:00
|
|
|
uint8_t *p_line0 = g_frame_buffer[line + 0];
|
|
|
|
uint8_t *p_line1 = g_frame_buffer[line + 1];
|
2023-10-05 15:26:08 +01:00
|
|
|
unsigned int mode = 0;
|
|
|
|
unsigned int state;
|
2023-09-16 22:29:02 +01:00
|
|
|
|
2023-09-10 13:52:41 +01:00
|
|
|
if (single_vfo)
|
2023-09-12 15:31:37 +01:00
|
|
|
{ // we're in single VFO mode - screen is dedicated to just one VFO
|
2023-09-11 00:02:57 +01:00
|
|
|
|
2023-10-01 10:15:24 +01:00
|
|
|
if (!same_vfo)
|
2023-09-12 15:31:37 +01:00
|
|
|
continue; // skip the unused vfo
|
2023-09-09 08:03:56 +01:00
|
|
|
|
2023-09-16 17:16:36 +01:00
|
|
|
|
2023-09-10 13:52:41 +01:00
|
|
|
}
|
2023-09-16 22:29:02 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_eeprom.dual_watch != DUAL_WATCH_OFF && g_rx_vfo_is_active)
|
2023-10-08 17:14:13 +01:00
|
|
|
channel = g_eeprom.rx_vfo; // we're currently monitoring the other VFO
|
2023-09-09 08:03:56 +01:00
|
|
|
|
2023-10-01 10:15:24 +01:00
|
|
|
if (channel != vfo_num)
|
2023-09-09 08:03:56 +01:00
|
|
|
{
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE || g_dtmf_is_tx || g_dtmf_input_mode)
|
2023-09-11 00:02:57 +01:00
|
|
|
{ // show DTMF stuff
|
2023-09-16 22:29:02 +01:00
|
|
|
|
2023-09-09 08:03:56 +01:00
|
|
|
char Contact[16];
|
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (!g_dtmf_input_mode)
|
2023-09-09 08:03:56 +01:00
|
|
|
{
|
2023-09-10 13:52:41 +01:00
|
|
|
memset(Contact, 0, sizeof(Contact));
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT)
|
|
|
|
strcpy(String, (g_dtmf_state == DTMF_STATE_CALL_OUT_RSP) ? "CALL OUT(RSP)" : "CALL OUT");
|
2023-09-09 08:03:56 +01:00
|
|
|
else
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED || g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED_STAY)
|
|
|
|
sprintf(String, "CALL FRM:%s", (DTMF_FindContact(g_dtmf_caller, Contact)) ? Contact : g_dtmf_caller);
|
2023-09-09 08:03:56 +01:00
|
|
|
else
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_dtmf_is_tx)
|
|
|
|
strcpy(String, (g_dtmf_state == DTMF_STATE_TX_SUCC) ? "DTMF TX(SUCC)" : "DTMF TX");
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
|
|
|
else
|
2023-09-17 10:13:55 +01:00
|
|
|
{
|
2023-10-08 20:23:37 +01:00
|
|
|
sprintf(String, ">%s", g_dtmf_input_box);
|
2023-09-17 10:13:55 +01:00
|
|
|
}
|
2023-10-06 19:31:29 +01:00
|
|
|
UI_PrintString(String, 2, 0, 0 + (vfo_num * 3), 8);
|
2023-09-09 08:03:56 +01:00
|
|
|
|
|
|
|
memset(String, 0, sizeof(String));
|
2023-10-08 20:23:37 +01:00
|
|
|
if (!g_dtmf_input_mode)
|
2023-09-09 08:03:56 +01:00
|
|
|
{
|
2023-09-10 13:52:41 +01:00
|
|
|
memset(Contact, 0, sizeof(Contact));
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT)
|
|
|
|
sprintf(String, ">%s", (DTMF_FindContact(g_dtmf_string, Contact)) ? Contact : g_dtmf_string);
|
2023-09-09 08:03:56 +01:00
|
|
|
else
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED || g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED_STAY)
|
|
|
|
sprintf(String, ">%s", (DTMF_FindContact(g_dtmf_callee, Contact)) ? Contact : g_dtmf_callee);
|
2023-09-09 08:03:56 +01:00
|
|
|
else
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_dtmf_is_tx)
|
|
|
|
sprintf(String, ">%s", g_dtmf_string);
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
2023-09-12 15:31:37 +01:00
|
|
|
UI_PrintString(String, 2, 0, 2 + (vfo_num * 3), 8);
|
2023-09-10 13:52:41 +01:00
|
|
|
|
2023-10-02 09:31:35 +01:00
|
|
|
center_line = CENTER_LINE_IN_USE;
|
2023-09-09 08:03:56 +01:00
|
|
|
continue;
|
|
|
|
}
|
2023-09-09 13:58:21 +01:00
|
|
|
|
2023-09-10 13:52:41 +01:00
|
|
|
// highlight the selected/used VFO with a marker
|
2023-10-01 10:15:24 +01:00
|
|
|
if (!single_vfo && same_vfo)
|
2023-10-08 20:23:37 +01:00
|
|
|
memmove(p_line0 + 0, BITMAP_VFO_DEFAULT, sizeof(BITMAP_VFO_DEFAULT));
|
2023-09-12 16:53:47 +01:00
|
|
|
else
|
2023-10-08 17:14:13 +01:00
|
|
|
if (g_eeprom.cross_vfo_rx_tx != CROSS_BAND_OFF)
|
2023-10-08 20:23:37 +01:00
|
|
|
memmove(p_line0 + 0, BITMAP_VFO_NOT_DEFAULT, sizeof(BITMAP_VFO_NOT_DEFAULT));
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
|
|
|
else
|
2023-09-10 13:52:41 +01:00
|
|
|
if (!single_vfo)
|
|
|
|
{ // highlight the selected/used VFO with a marker
|
2023-10-01 10:15:24 +01:00
|
|
|
if (same_vfo)
|
2023-10-08 20:23:37 +01:00
|
|
|
memmove(p_line0 + 0, BITMAP_VFO_DEFAULT, sizeof(BITMAP_VFO_DEFAULT));
|
2023-09-12 15:31:37 +01:00
|
|
|
else
|
2023-10-08 17:14:13 +01:00
|
|
|
//if (g_eeprom.cross_vfo_rx_tx != CROSS_BAND_OFF)
|
2023-10-08 20:23:37 +01:00
|
|
|
memmove(p_line0 + 0, BITMAP_VFO_NOT_DEFAULT, sizeof(BITMAP_VFO_NOT_DEFAULT));
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_current_function == FUNCTION_TRANSMIT)
|
2023-09-11 00:02:57 +01:00
|
|
|
{ // transmitting
|
2023-09-16 22:29:02 +01:00
|
|
|
|
2023-09-14 09:56:30 +01:00
|
|
|
#ifdef ENABLE_ALARM
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_alarm_state == ALARM_STATE_ALARM)
|
2023-10-14 11:55:43 +01:00
|
|
|
mode = 1;
|
2023-09-09 09:01:52 +01:00
|
|
|
else
|
|
|
|
#endif
|
2023-09-09 08:03:56 +01:00
|
|
|
{
|
2023-10-08 17:14:13 +01:00
|
|
|
channel = (g_eeprom.cross_vfo_rx_tx == CROSS_BAND_OFF) ? g_eeprom.rx_vfo : g_eeprom.tx_vfo;
|
2023-10-01 10:15:24 +01:00
|
|
|
if (channel == vfo_num)
|
2023-09-10 13:52:41 +01:00
|
|
|
{ // show the TX symbol
|
2023-10-03 16:09:25 +01:00
|
|
|
mode = 1;
|
|
|
|
#ifdef ENABLE_SMALL_BOLD
|
|
|
|
UI_PrintStringSmallBold("TX", 14, 0, line);
|
|
|
|
#else
|
|
|
|
UI_PrintStringSmall("TX", 14, 0, line);
|
|
|
|
#endif
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2023-09-12 15:31:37 +01:00
|
|
|
{ // receiving .. show the RX symbol
|
2023-10-03 16:09:25 +01:00
|
|
|
mode = 2;
|
2023-10-08 20:23:37 +01:00
|
|
|
if ((g_current_function == FUNCTION_RECEIVE ||
|
|
|
|
g_current_function == FUNCTION_MONITOR ||
|
|
|
|
g_current_function == FUNCTION_INCOMING) &&
|
2023-10-08 17:14:13 +01:00
|
|
|
g_eeprom.rx_vfo == vfo_num)
|
2023-10-03 16:09:25 +01:00
|
|
|
{
|
|
|
|
#ifdef ENABLE_SMALL_BOLD
|
|
|
|
UI_PrintStringSmallBold("RX", 14, 0, line);
|
|
|
|
#else
|
|
|
|
UI_PrintStringSmall("RX", 14, 0, line);
|
|
|
|
#endif
|
|
|
|
}
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
|
|
|
|
2023-10-08 17:14:13 +01:00
|
|
|
if (g_eeprom.screen_channel[vfo_num] <= USER_CHANNEL_LAST)
|
2023-09-11 00:02:57 +01:00
|
|
|
{ // channel mode
|
2023-09-12 15:31:37 +01:00
|
|
|
const unsigned int x = 2;
|
2023-10-08 20:23:37 +01:00
|
|
|
const bool inputting = (g_input_box_index == 0 || g_eeprom.tx_vfo != vfo_num) ? false : true;
|
2023-09-16 22:29:02 +01:00
|
|
|
if (!inputting)
|
2023-10-08 17:14:13 +01:00
|
|
|
NUMBER_ToDigits(g_eeprom.screen_channel[vfo_num] + 1, String); // show the memory channel number
|
2023-09-09 08:03:56 +01:00
|
|
|
else
|
2023-10-08 20:23:37 +01:00
|
|
|
memmove(String + 5, g_input_box, 3); // show the input text
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintStringSmall("M", x, 0, line + 1);
|
2023-10-08 20:23:37 +01:00
|
|
|
UI_Displaysmall_digits(3, String + 5, x + 7, line + 1, inputting);
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
|
|
|
else
|
2023-10-08 17:14:13 +01:00
|
|
|
if (IS_FREQ_CHANNEL(g_eeprom.screen_channel[vfo_num]))
|
2023-09-16 22:29:02 +01:00
|
|
|
{ // frequency mode
|
2023-09-11 00:02:57 +01:00
|
|
|
// show the frequency band number
|
2023-09-16 22:29:02 +01:00
|
|
|
const unsigned int x = 2; // was 14
|
2023-10-08 17:14:13 +01:00
|
|
|
// sprintf(String, "FB%u", 1 + g_eeprom.screen_channel[vfo_num] - FREQ_CHANNEL_FIRST);
|
|
|
|
sprintf(String, "VFO%u", 1 + g_eeprom.screen_channel[vfo_num] - FREQ_CHANNEL_FIRST);
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintStringSmall(String, x, 0, line + 1);
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
2023-09-16 22:29:02 +01:00
|
|
|
#ifdef ENABLE_NOAA
|
2023-09-09 08:03:56 +01:00
|
|
|
else
|
|
|
|
{
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_input_box_index == 0 || g_eeprom.tx_vfo != vfo_num)
|
2023-09-16 22:29:02 +01:00
|
|
|
{ // channel number
|
2023-10-08 17:14:13 +01:00
|
|
|
sprintf(String, "N%u", 1 + g_eeprom.screen_channel[vfo_num] - NOAA_CHANNEL_FIRST);
|
2023-09-16 22:29:02 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // user entering channel number
|
2023-10-08 20:23:37 +01:00
|
|
|
sprintf(String, "N%u%u", '0' + g_input_box[0], '0' + g_input_box[1]);
|
2023-09-16 22:29:02 +01:00
|
|
|
}
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintStringSmall(String, 7, 0, line + 1);
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
2023-09-16 22:29:02 +01:00
|
|
|
#endif
|
2023-09-09 08:03:56 +01:00
|
|
|
|
2023-09-12 15:31:37 +01:00
|
|
|
// ************
|
2023-09-16 22:29:02 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
state = g_vfo_state[vfo_num];
|
2023-09-09 08:03:56 +01:00
|
|
|
|
2023-09-14 09:56:30 +01:00
|
|
|
#ifdef ENABLE_ALARM
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_current_function == FUNCTION_TRANSMIT && g_alarm_state == ALARM_STATE_ALARM)
|
2023-09-09 09:01:52 +01:00
|
|
|
{
|
2023-10-08 17:14:13 +01:00
|
|
|
channel = (g_eeprom.cross_vfo_rx_tx == CROSS_BAND_OFF) ? g_eeprom.rx_vfo : g_eeprom.tx_vfo;
|
2023-10-01 10:15:24 +01:00
|
|
|
if (channel == vfo_num)
|
|
|
|
state = VFO_STATE_ALARM;
|
2023-09-09 09:01:52 +01:00
|
|
|
}
|
|
|
|
#endif
|
2023-09-09 13:58:21 +01:00
|
|
|
|
2023-10-01 10:15:24 +01:00
|
|
|
if (state != VFO_STATE_NORMAL)
|
2023-09-09 08:03:56 +01:00
|
|
|
{
|
2023-09-16 22:29:02 +01:00
|
|
|
const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALARM", "VOLT HIGH"};
|
2023-10-05 15:26:08 +01:00
|
|
|
if (state < ARRAY_SIZE(state_list))
|
2023-10-01 17:19:38 +01:00
|
|
|
UI_PrintString(state_list[state], 31, 0, line, 8);
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
|
|
|
else
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_input_box_index > 0 && IS_FREQ_CHANNEL(g_eeprom.screen_channel[vfo_num]) && g_eeprom.tx_vfo == vfo_num)
|
2023-09-16 22:29:02 +01:00
|
|
|
{ // user entering a frequency
|
2023-10-08 20:23:37 +01:00
|
|
|
UI_DisplayFrequency(g_input_box, 32, line, true, false);
|
2023-09-17 10:13:55 +01:00
|
|
|
|
2023-10-02 09:31:35 +01:00
|
|
|
// center_line = CENTER_LINE_IN_USE;
|
2023-09-16 22:29:02 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-10-13 15:12:32 +01:00
|
|
|
uint32_t frequency = g_eeprom.vfo_info[vfo_num].p_rx->frequency;
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_current_function == FUNCTION_TRANSMIT)
|
2023-09-16 22:29:02 +01:00
|
|
|
{ // transmitting
|
2023-10-08 17:14:13 +01:00
|
|
|
channel = (g_eeprom.cross_vfo_rx_tx == CROSS_BAND_OFF) ? g_eeprom.rx_vfo : g_eeprom.tx_vfo;
|
2023-10-01 12:44:22 +01:00
|
|
|
if (channel == vfo_num)
|
2023-10-13 15:12:32 +01:00
|
|
|
frequency = g_eeprom.vfo_info[vfo_num].p_tx->frequency;
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
2023-09-16 22:29:02 +01:00
|
|
|
|
2023-10-08 17:14:13 +01:00
|
|
|
if (g_eeprom.screen_channel[vfo_num] <= USER_CHANNEL_LAST)
|
2023-10-05 15:26:08 +01:00
|
|
|
{ // it's a channel
|
2023-09-16 22:29:02 +01:00
|
|
|
|
2023-09-19 17:30:12 +01:00
|
|
|
// show the channel symbols
|
2023-10-08 20:23:37 +01:00
|
|
|
const uint8_t attributes = g_user_channel_attributes[g_eeprom.screen_channel[vfo_num]];
|
2023-10-08 17:14:13 +01:00
|
|
|
if (attributes & USER_CH_SCANLIST1)
|
2023-10-08 20:23:37 +01:00
|
|
|
memmove(p_line0 + 113, BITMAP_SCANLIST1, sizeof(BITMAP_SCANLIST1));
|
2023-10-08 17:14:13 +01:00
|
|
|
if (attributes & USER_CH_SCANLIST2)
|
2023-10-08 20:23:37 +01:00
|
|
|
memmove(p_line0 + 120, BITMAP_SCANLIST2, sizeof(BITMAP_SCANLIST2));
|
2023-09-19 17:30:12 +01:00
|
|
|
#ifndef ENABLE_BIG_FREQ
|
2023-10-08 17:14:13 +01:00
|
|
|
if ((attributes & USER_CH_COMPAND) > 0)
|
2023-10-08 20:23:37 +01:00
|
|
|
memmove(p_line0 + 120 + LCD_WIDTH, BITMAP_COMPAND, sizeof(BITMAP_COMPAND));
|
2023-10-04 16:37:11 +01:00
|
|
|
#else
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-04 16:37:11 +01:00
|
|
|
// TODO: // find somewhere else to put the symbol
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-09-19 17:30:12 +01:00
|
|
|
#endif
|
2023-09-21 07:31:29 +01:00
|
|
|
|
2023-10-05 15:26:08 +01:00
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
|
|
|
|
2023-10-08 17:14:13 +01:00
|
|
|
switch (g_eeprom.channel_display_mode)
|
2023-09-16 22:29:02 +01:00
|
|
|
{
|
|
|
|
case MDF_FREQUENCY: // show the channel frequency
|
|
|
|
#ifdef ENABLE_BIG_FREQ
|
2023-09-18 18:26:10 +01:00
|
|
|
NUMBER_ToDigits(frequency, String);
|
2023-09-16 22:29:02 +01:00
|
|
|
// show the main large frequency digits
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_DisplayFrequency(String, 32, line, false, false);
|
2023-09-16 22:29:02 +01:00
|
|
|
// show the remaining 2 small frequency digits
|
2023-10-08 20:23:37 +01:00
|
|
|
UI_Displaysmall_digits(2, String + 6, 113, line + 1, true);
|
2023-09-16 22:29:02 +01:00
|
|
|
#else
|
|
|
|
// show the frequency in the main font
|
2023-09-18 18:26:10 +01:00
|
|
|
sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000);
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintString(String, 32, 0, line, 8);
|
2023-09-16 22:29:02 +01:00
|
|
|
#endif
|
|
|
|
break;
|
2023-09-09 13:58:21 +01:00
|
|
|
|
2023-09-16 22:29:02 +01:00
|
|
|
case MDF_CHANNEL: // show the channel number
|
2023-10-08 17:14:13 +01:00
|
|
|
sprintf(String, "CH-%03u", g_eeprom.screen_channel[vfo_num] + 1);
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintString(String, 32, 0, line, 8);
|
2023-09-16 22:29:02 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case MDF_NAME: // show the channel name
|
2023-09-20 08:29:11 +01:00
|
|
|
case MDF_NAME_FREQ: // show the channel name and frequency
|
2023-09-22 13:52:17 +01:00
|
|
|
|
2023-10-08 17:14:13 +01:00
|
|
|
BOARD_fetchChannelName(String, g_eeprom.screen_channel[vfo_num]);
|
2023-09-20 08:29:11 +01:00
|
|
|
if (String[0] == 0)
|
2023-09-16 22:29:02 +01:00
|
|
|
{ // no channel name, show the channel number instead
|
2023-10-08 17:14:13 +01:00
|
|
|
sprintf(String, "CH-%03u", g_eeprom.screen_channel[vfo_num] + 1);
|
2023-09-16 22:29:02 +01:00
|
|
|
}
|
2023-09-22 13:52:17 +01:00
|
|
|
|
2023-10-08 17:14:13 +01:00
|
|
|
if (g_eeprom.channel_display_mode == MDF_NAME)
|
2023-09-20 08:29:11 +01:00
|
|
|
{
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintString(String, 32, 0, line, 8);
|
2023-09-19 15:35:32 +01:00
|
|
|
}
|
|
|
|
else
|
2023-09-20 08:29:11 +01:00
|
|
|
{
|
2023-09-24 01:36:43 +01:00
|
|
|
#ifdef ENABLE_SMALL_BOLD
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintStringSmallBold(String, 32 + 4, 0, line);
|
2023-09-24 01:36:43 +01:00
|
|
|
#else
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintStringSmall(String, 32 + 4, 0, line);
|
2023-09-24 01:36:43 +01:00
|
|
|
#endif
|
2023-09-27 00:26:58 +01:00
|
|
|
|
2023-09-20 08:29:11 +01:00
|
|
|
// show the channel frequency below the channel number/name
|
|
|
|
sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000);
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintStringSmall(String, 32 + 4, 0, line + 1);
|
2023-09-19 15:35:32 +01:00
|
|
|
}
|
2023-09-22 13:52:17 +01:00
|
|
|
|
2023-09-19 15:35:32 +01:00
|
|
|
break;
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-05 15:26:08 +01:00
|
|
|
#pragma GCC diagnostic pop
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
2023-09-16 22:29:02 +01:00
|
|
|
else
|
|
|
|
{ // frequency mode
|
|
|
|
#ifdef ENABLE_BIG_FREQ
|
2023-09-18 18:26:10 +01:00
|
|
|
NUMBER_ToDigits(frequency, String); // 8 digits
|
2023-09-16 22:29:02 +01:00
|
|
|
// show the main large frequency digits
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_DisplayFrequency(String, 32, line, false, false);
|
2023-09-16 22:29:02 +01:00
|
|
|
// show the remaining 2 small frequency digits
|
2023-10-08 20:23:37 +01:00
|
|
|
UI_Displaysmall_digits(2, String + 6, 113, line + 1, true);
|
2023-09-16 22:29:02 +01:00
|
|
|
#else
|
|
|
|
// show the frequency in the main font
|
2023-09-18 18:26:10 +01:00
|
|
|
sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000);
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintString(String, 32, 0, line, 8);
|
2023-09-16 22:29:02 +01:00
|
|
|
#endif
|
2023-09-19 17:30:12 +01:00
|
|
|
|
2023-10-04 16:37:11 +01:00
|
|
|
// show the channel symbols
|
2023-10-08 20:23:37 +01:00
|
|
|
const uint8_t attributes = g_user_channel_attributes[g_eeprom.screen_channel[vfo_num]];
|
2023-10-08 17:14:13 +01:00
|
|
|
if ((attributes & USER_CH_COMPAND) > 0)
|
2023-10-04 16:37:11 +01:00
|
|
|
#ifdef ENABLE_BIG_FREQ
|
2023-10-08 20:23:37 +01:00
|
|
|
memmove(p_line0 + 120, BITMAP_COMPAND, sizeof(BITMAP_COMPAND));
|
2023-10-04 16:37:11 +01:00
|
|
|
#else
|
2023-10-08 20:23:37 +01:00
|
|
|
memmove(p_line0 + 120 + LCD_WIDTH, BITMAP_COMPAND, sizeof(BITMAP_COMPAND));
|
2023-10-04 16:37:11 +01:00
|
|
|
#endif
|
2023-09-16 22:29:02 +01:00
|
|
|
}
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
|
|
|
|
2023-09-12 15:31:37 +01:00
|
|
|
// ************
|
|
|
|
|
2023-09-10 13:52:41 +01:00
|
|
|
{ // show the TX/RX level
|
|
|
|
uint8_t Level = 0;
|
2023-09-09 08:03:56 +01:00
|
|
|
|
2023-10-03 16:09:25 +01:00
|
|
|
if (mode == 1)
|
2023-09-10 13:52:41 +01:00
|
|
|
{ // TX power level
|
2023-10-08 20:23:37 +01:00
|
|
|
switch (g_rx_vfo->output_power)
|
2023-09-10 13:52:41 +01:00
|
|
|
{
|
2023-09-16 22:29:02 +01:00
|
|
|
case OUTPUT_POWER_LOW: Level = 2; break;
|
|
|
|
case OUTPUT_POWER_MID: Level = 4; break;
|
|
|
|
case OUTPUT_POWER_HIGH: Level = 6; break;
|
2023-09-10 13:52:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2023-10-03 16:09:25 +01:00
|
|
|
if (mode == 2)
|
2023-09-10 13:52:41 +01:00
|
|
|
{ // RX signal level
|
2023-09-29 08:43:05 +01:00
|
|
|
#ifndef ENABLE_RSSI_BAR
|
2023-10-14 11:55:43 +01:00
|
|
|
// antenna bar graph
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_vfo_rssi_bar_level[vfo_num] > 0)
|
|
|
|
Level = g_vfo_rssi_bar_level[vfo_num];
|
2023-09-17 15:36:23 +01:00
|
|
|
#endif
|
2023-09-10 13:52:41 +01:00
|
|
|
}
|
2023-09-16 22:29:02 +01:00
|
|
|
|
2023-10-04 10:01:07 +01:00
|
|
|
UI_drawBars(p_line1 + LCD_WIDTH, Level);
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
2023-09-16 22:29:02 +01:00
|
|
|
|
2023-09-12 15:31:37 +01:00
|
|
|
// ************
|
|
|
|
|
2023-09-17 15:36:23 +01:00
|
|
|
String[0] = '\0';
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_eeprom.vfo_info[vfo_num].am_mode)
|
2023-09-10 13:52:41 +01:00
|
|
|
{ // show the AM symbol
|
2023-09-17 15:36:23 +01:00
|
|
|
strcpy(String, "AM");
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
|
|
|
else
|
2023-09-19 07:16:15 +01:00
|
|
|
{ // or show the CTCSS/DCS symbol
|
2023-10-13 15:12:32 +01:00
|
|
|
const freq_config_t *pConfig = (mode == 1) ? g_eeprom.vfo_info[vfo_num].p_tx : g_eeprom.vfo_info[vfo_num].p_rx;
|
2023-10-08 17:14:13 +01:00
|
|
|
const unsigned int code_type = pConfig->code_type;
|
2023-09-16 22:29:02 +01:00
|
|
|
const char *code_list[] = {"", "CT", "DCS", "DCR"};
|
2023-10-05 15:26:08 +01:00
|
|
|
if (code_type < ARRAY_SIZE(code_list))
|
2023-09-17 15:36:23 +01:00
|
|
|
strcpy(String, code_list[code_type]);
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintStringSmall(String, LCD_WIDTH + 24, 0, line + 1);
|
2023-09-09 08:03:56 +01:00
|
|
|
|
2023-10-01 10:15:24 +01:00
|
|
|
if (state == VFO_STATE_NORMAL || state == VFO_STATE_ALARM)
|
2023-09-16 22:29:02 +01:00
|
|
|
{ // show the TX power
|
|
|
|
const char pwr_list[] = "LMH";
|
2023-10-08 20:23:37 +01:00
|
|
|
const unsigned int i = g_eeprom.vfo_info[vfo_num].output_power;
|
2023-10-05 15:26:08 +01:00
|
|
|
String[0] = (i < ARRAY_SIZE(pwr_list)) ? pwr_list[i] : '\0';
|
2023-09-16 22:29:02 +01:00
|
|
|
String[1] = '\0';
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintStringSmall(String, LCD_WIDTH + 46, 0, line + 1);
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_eeprom.vfo_info[vfo_num].freq_config_rx.frequency != g_eeprom.vfo_info[vfo_num].freq_config_tx.frequency)
|
2023-09-10 13:52:41 +01:00
|
|
|
{ // show the TX offset symbol
|
2023-09-20 08:29:11 +01:00
|
|
|
const char dir_list[] = "\0+-";
|
2023-10-08 20:23:37 +01:00
|
|
|
const unsigned int i = g_eeprom.vfo_info[vfo_num].tx_offset_freq_dir;
|
2023-09-20 08:29:11 +01:00
|
|
|
String[0] = (i < sizeof(dir_list)) ? dir_list[i] : '?';
|
2023-09-16 17:16:36 +01:00
|
|
|
String[1] = '\0';
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintStringSmall(String, LCD_WIDTH + 54, 0, line + 1);
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
|
|
|
|
2023-09-10 13:52:41 +01:00
|
|
|
// show the TX/RX reverse symbol
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_eeprom.vfo_info[vfo_num].frequency_reverse)
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintStringSmall("R", LCD_WIDTH + 62, 0, line + 1);
|
2023-09-09 08:03:56 +01:00
|
|
|
|
2023-09-18 00:48:40 +01:00
|
|
|
{ // show the narrow band symbol
|
2023-09-19 07:16:15 +01:00
|
|
|
String[0] = '\0';
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_eeprom.vfo_info[vfo_num].channel_bandwidth == BANDWIDTH_NARROW)
|
2023-09-18 00:48:40 +01:00
|
|
|
{
|
2023-09-19 07:16:15 +01:00
|
|
|
String[0] = 'N';
|
|
|
|
String[1] = '\0';
|
2023-09-18 00:48:40 +01:00
|
|
|
}
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintStringSmall(String, LCD_WIDTH + 70, 0, line + 1);
|
2023-09-18 00:48:40 +01:00
|
|
|
}
|
2023-09-21 07:31:29 +01:00
|
|
|
|
2023-09-30 11:22:19 +01:00
|
|
|
// show the DTMF decoding symbol
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_eeprom.vfo_info[vfo_num].dtmf_decoding_enable || g_setting_killed)
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintStringSmall("DTMF", LCD_WIDTH + 78, 0, line + 1);
|
2023-09-09 08:03:56 +01:00
|
|
|
|
2023-09-10 13:52:41 +01:00
|
|
|
// show the audio scramble symbol
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_eeprom.vfo_info[vfo_num].scrambling_type > 0 && g_setting_scramble_enable)
|
2023-10-01 12:44:22 +01:00
|
|
|
UI_PrintStringSmall("SCR", LCD_WIDTH + 106, 0, line + 1);
|
2023-09-09 08:03:56 +01:00
|
|
|
}
|
|
|
|
|
2023-10-02 09:31:35 +01:00
|
|
|
if (center_line == CENTER_LINE_NONE)
|
2023-09-29 08:43:05 +01:00
|
|
|
{ // we're free to use the middle line
|
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
const bool rx = (g_current_function == FUNCTION_RECEIVE ||
|
|
|
|
g_current_function == FUNCTION_MONITOR ||
|
|
|
|
g_current_function == FUNCTION_INCOMING);
|
2023-09-22 13:52:17 +01:00
|
|
|
|
2023-10-08 12:39:30 +01:00
|
|
|
#ifdef ENABLE_SHOW_TX_TIMEOUT
|
|
|
|
// show the TX timeout count down
|
|
|
|
if (UI_DisplayTXCountdown(false))
|
|
|
|
{
|
|
|
|
center_line = CENTER_LINE_TX_TIMEOUT;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
|
2023-09-29 20:48:23 +01:00
|
|
|
#ifdef ENABLE_AUDIO_BAR
|
2023-10-08 12:39:30 +01:00
|
|
|
// show the TX audio level
|
2023-10-11 23:07:58 +01:00
|
|
|
if (UI_DisplayAudioBar(false))
|
2023-10-02 01:44:33 +01:00
|
|
|
{
|
2023-10-02 09:31:35 +01:00
|
|
|
center_line = CENTER_LINE_AUDIO_BAR;
|
2023-10-02 01:44:33 +01:00
|
|
|
}
|
2023-09-29 20:48:23 +01:00
|
|
|
else
|
|
|
|
#endif
|
|
|
|
|
2023-09-24 00:06:10 +01:00
|
|
|
#if defined(ENABLE_AM_FIX) && defined(ENABLE_AM_FIX_SHOW_DATA)
|
2023-10-08 12:39:30 +01:00
|
|
|
// show the AM-FIX debug data
|
2023-10-08 20:23:37 +01:00
|
|
|
if (rx && g_eeprom.vfo_info[g_eeprom.rx_vfo].am_mode && g_setting_am_fix)
|
2023-09-23 12:25:06 +01:00
|
|
|
{
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_screen_to_display != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
2023-10-04 22:08:13 +01:00
|
|
|
return;
|
|
|
|
|
2023-10-03 00:14:36 +01:00
|
|
|
center_line = CENTER_LINE_AM_FIX_DATA;
|
2023-10-08 17:14:13 +01:00
|
|
|
AM_fix_print_data(g_eeprom.rx_vfo, String);
|
2023-10-02 01:28:56 +01:00
|
|
|
UI_PrintStringSmall(String, 2, 0, 3);
|
2023-09-23 12:25:06 +01:00
|
|
|
}
|
2023-09-24 01:58:03 +01:00
|
|
|
else
|
|
|
|
#endif
|
2023-09-29 08:43:05 +01:00
|
|
|
|
|
|
|
#ifdef ENABLE_RSSI_BAR
|
2023-10-08 12:39:30 +01:00
|
|
|
// show the RX RSSI dBm, S-point and signal strength bar graph
|
2023-09-29 08:43:05 +01:00
|
|
|
if (rx)
|
2023-10-02 01:44:33 +01:00
|
|
|
{
|
2023-10-02 09:31:35 +01:00
|
|
|
center_line = CENTER_LINE_RSSI;
|
2023-10-08 20:23:37 +01:00
|
|
|
UI_DisplayRSSIBar(g_current_rssi[g_eeprom.rx_vfo], false);
|
2023-10-02 01:44:33 +01:00
|
|
|
}
|
2023-09-29 08:43:05 +01:00
|
|
|
else
|
|
|
|
#endif
|
2023-10-02 09:31:35 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (rx || g_current_function == FUNCTION_FOREGROUND || g_current_function == FUNCTION_POWER_SAVE)
|
2023-09-29 09:58:32 +01:00
|
|
|
{
|
2023-09-30 11:22:19 +01:00
|
|
|
#if 1
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_setting_live_dtmf_decoder && g_dtmf_rx_live[0] != 0)
|
2023-09-30 11:22:19 +01:00
|
|
|
{ // show live DTMF decode
|
2023-10-08 20:23:37 +01:00
|
|
|
const unsigned int len = strlen(g_dtmf_rx_live);
|
2023-09-30 11:22:19 +01:00
|
|
|
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
|
2023-10-04 22:08:13 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_screen_to_display != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
2023-10-04 22:08:13 +01:00
|
|
|
return;
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-03 00:14:36 +01:00
|
|
|
center_line = CENTER_LINE_DTMF_DEC;
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-09-30 11:22:19 +01:00
|
|
|
strcpy(String, "DTMF ");
|
2023-10-08 20:23:37 +01:00
|
|
|
strcat(String, g_dtmf_rx_live + idx);
|
2023-09-30 11:22:19 +01:00
|
|
|
UI_PrintStringSmall(String, 2, 0, 3);
|
|
|
|
}
|
|
|
|
#else
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_setting_live_dtmf_decoder && g_dtmf_rx_index > 0)
|
2023-09-30 11:22:19 +01:00
|
|
|
{ // show live DTMF decode
|
2023-10-08 20:23:37 +01:00
|
|
|
const unsigned int len = g_dtmf_rx_index;
|
2023-09-30 11:22:19 +01:00
|
|
|
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
|
2023-10-04 22:08:13 +01:00
|
|
|
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_screen_to_display != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
2023-10-04 22:08:13 +01:00
|
|
|
return;
|
|
|
|
|
2023-10-03 00:14:36 +01:00
|
|
|
center_line = CENTER_LINE_DTMF_DEC;
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-09-30 11:22:19 +01:00
|
|
|
strcpy(String, "DTMF ");
|
2023-10-08 20:23:37 +01:00
|
|
|
strcat(String, g_dtmf_rx + idx);
|
2023-09-30 11:22:19 +01:00
|
|
|
UI_PrintStringSmall(String, 2, 0, 3);
|
|
|
|
}
|
|
|
|
#endif
|
2023-09-30 20:03:09 +01:00
|
|
|
|
2023-09-29 09:58:32 +01:00
|
|
|
#ifdef ENABLE_SHOW_CHARGE_LEVEL
|
2023-09-23 12:07:46 +01:00
|
|
|
else
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_charging_with_type_c)
|
2023-10-08 12:39:30 +01:00
|
|
|
{ // show the battery charge state
|
2023-10-08 20:23:37 +01:00
|
|
|
if (g_screen_to_display != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
2023-10-04 22:08:13 +01:00
|
|
|
return;
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-03 00:14:36 +01:00
|
|
|
center_line = CENTER_LINE_CHARGE_DATA;
|
2023-10-08 12:39:30 +01:00
|
|
|
|
2023-10-02 01:44:33 +01:00
|
|
|
sprintf(String, "Charge %u.%02uV %u%%",
|
2023-10-08 20:23:37 +01:00
|
|
|
g_battery_voltage_average / 100, g_battery_voltage_average % 100,
|
|
|
|
BATTERY_VoltsToPercent(g_battery_voltage_average));
|
2023-09-29 09:58:32 +01:00
|
|
|
UI_PrintStringSmall(String, 2, 0, 3);
|
2023-09-23 12:07:46 +01:00
|
|
|
}
|
2023-09-29 09:58:32 +01:00
|
|
|
#endif
|
2023-09-24 01:58:03 +01:00
|
|
|
}
|
2023-09-19 10:23:50 +01:00
|
|
|
}
|
2023-09-17 15:36:23 +01:00
|
|
|
|
2023-09-09 08:03:56 +01:00
|
|
|
ST7565_BlitFullScreen();
|
|
|
|
}
|
2023-09-29 08:43:05 +01:00
|
|
|
|
|
|
|
// ***************************************************************************
|