0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-18 22:29:50 +03:00

fix dual watch bug + other stuff

This commit is contained in:
OneOfEleven
2023-11-02 10:00:51 +00:00
parent b0f105572a
commit 2638d803c0
47 changed files with 1880 additions and 2385 deletions

View File

@ -17,11 +17,11 @@
#include "battery.h"
#include "driver/backlight.h"
#include "misc.h"
#include "settings.h"
#include "ui/battery.h"
#include "ui/menu.h"
#include "ui/ui.h"
uint16_t g_battery_calibration[6];
uint16_t g_usb_current_voltage;
uint16_t g_usb_current;
uint16_t g_battery_voltages[4];
@ -86,25 +86,25 @@ void BATTERY_GetReadings(const bool bDisplayBatteryLevel)
g_battery_display_level = 0;
if (g_battery_calibration[5] < Voltage)
if (g_eeprom.calib.battery[5] < Voltage)
g_battery_display_level = 6;
else
if (g_battery_calibration[4] < Voltage)
if (g_eeprom.calib.battery[4] < Voltage)
g_battery_display_level = 5;
else
if (g_battery_calibration[3] < Voltage)
if (g_eeprom.calib.battery[3] < Voltage)
g_battery_display_level = 4;
else
if (g_battery_calibration[2] < Voltage)
if (g_eeprom.calib.battery[2] < Voltage)
g_battery_display_level = 3;
else
if (g_battery_calibration[1] < Voltage)
if (g_eeprom.calib.battery[1] < Voltage)
g_battery_display_level = 2;
else
if (g_battery_calibration[0] < Voltage)
if (g_eeprom.calib.battery[0] < Voltage)
g_battery_display_level = 1;
g_battery_voltage_average = (Voltage * 760) / g_battery_calibration[3];
g_battery_voltage_average = (Voltage * 760) / g_eeprom.calib.battery[3];
if ((g_current_display_screen == DISPLAY_MENU) && g_menu_cursor == MENU_VOLTAGE)
g_update_display = true;

View File

@ -20,7 +20,6 @@
#include <stdbool.h>
#include <stdint.h>
extern uint16_t g_battery_calibration[6];
extern uint16_t g_usb_current_voltage;
extern uint16_t g_usb_current;
extern uint16_t g_battery_voltages[4];

View File

@ -66,17 +66,17 @@ void BOOT_ProcessMode(boot_mode_t Mode)
else
if (Mode == BOOT_MODE_AIRCOPY)
{
g_eeprom.dual_watch = DUAL_WATCH_OFF;
g_eeprom.battery_save = 0;
g_eeprom.config.setting.dual_watch = DUAL_WATCH_OFF;
g_eeprom.config.setting.battery_save_ratio = 0;
#ifdef ENABLE_VOX
g_eeprom.vox_switch = false;
g_eeprom.config.setting.vox_switch = false;
#endif
g_eeprom.cross_vfo_rx_tx = CROSS_BAND_OFF;
g_eeprom.auto_keypad_lock = false;
g_eeprom.key1_short_press_action = ACTION_OPT_NONE;
g_eeprom.key1_long_press_action = ACTION_OPT_NONE;
g_eeprom.key2_short_press_action = ACTION_OPT_NONE;
g_eeprom.key2_long_press_action = ACTION_OPT_NONE;
g_eeprom.config.setting.cross_vfo = CROSS_BAND_OFF;
g_eeprom.config.setting.auto_key_lock = 0;
g_eeprom.config.setting.key1_short = ACTION_OPT_NONE;
g_eeprom.config.setting.key1_long = ACTION_OPT_NONE;
g_eeprom.config.setting.key2_short = ACTION_OPT_NONE;
g_eeprom.config.setting.key2_long = ACTION_OPT_NONE;
RADIO_InitInfo(g_rx_vfo, FREQ_CHANNEL_LAST - 1, g_aircopy_freq);