kopia lustrzana https://github.com/OpenRTX/OpenRTX
Merge branch 'master' into m17-rssi-duty-cycle
commit
038ad7e346
|
@ -32,10 +32,6 @@
|
|||
typedef struct history
|
||||
{
|
||||
char callsign[10];
|
||||
<<<<<<< Updated upstream
|
||||
char module[10];
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
datetime_t time;
|
||||
struct history * next;
|
||||
struct history * prev;
|
||||
|
@ -53,26 +49,12 @@ typedef struct history_list
|
|||
history_list_t;
|
||||
|
||||
// extern pthread_mutex_t history_mutex;
|
||||
<<<<<<< Updated upstream
|
||||
// extern history_list_t *history_list;
|
||||
=======
|
||||
extern history_list_t *history_list;
|
||||
>>>>>>> Stashed changes
|
||||
|
||||
/**
|
||||
* Initialise radio state mutex and radio state variable, reading the
|
||||
* informations from device drivers.
|
||||
*/
|
||||
<<<<<<< Updated upstream
|
||||
// history_list_t *history_init();
|
||||
void history_init();
|
||||
// void history_add(history_list_t *list, const char* callsign, const char* module, datetime_t state_time);
|
||||
// void history_test(history_list_t *list, const char* src, const char* dest, const char* refl, const char *link , datetime_t state_time);
|
||||
// int read_history(history_list_t *list, history_t *history, uint8_t pos);
|
||||
// history_t* find_callsign(history_list_t *list, const char* callsign);
|
||||
// uint8_t history_size(history_list_t *list);
|
||||
void history_add(const char* callsign, const char* module, datetime_t state_time);
|
||||
=======
|
||||
//history_list_t *history_init();
|
||||
//void history_add(history_list_t *list, const char* callsign, const char* module, datetime_t state_time);
|
||||
//void history_test(history_list_t *list, const char* src, const char* dest, const char* refl, const char *link , datetime_t state_time);
|
||||
|
@ -80,15 +62,11 @@ void history_add(const char* callsign, const char* module, datetime_t state_time
|
|||
//history_t* find_callsign(history_list_t *list, const char* callsign);
|
||||
void history_init();
|
||||
void history_add(const char* callsign, datetime_t state_time);
|
||||
>>>>>>> Stashed changes
|
||||
void history_test(const char* src, const char* dest, const char* refl, const char *link , datetime_t state_time);
|
||||
int read_history(history_t *history, uint8_t pos);
|
||||
history_t* find_callsign(const char* callsign);
|
||||
uint8_t history_size();
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
char history_status();
|
||||
>>>>>>> Stashed changes
|
||||
void format_history_value(char *buf, int max_len, history_t history);
|
||||
bool is_new_history();
|
||||
void reset_new_history();
|
||||
|
|
|
@ -55,13 +55,9 @@ typedef struct
|
|||
bool gps_enabled; // GPS active
|
||||
bool history_enabled;
|
||||
bool notifications_enabled;
|
||||
<<<<<<< Updated upstream
|
||||
bool showSMeter;
|
||||
=======
|
||||
bool display_battery; // true:icon, false: percent
|
||||
bool showSMeter;
|
||||
bool night_mode;
|
||||
>>>>>>> Stashed changes
|
||||
char callsign[10]; // Plaintext callsign
|
||||
uint8_t display_timer : 4, // Standby timer
|
||||
m17_can : 4; // M17 CAN
|
||||
|
@ -88,17 +84,12 @@ static const settings_t default_settings =
|
|||
0, // UTC Timezone
|
||||
false, // GPS enabled
|
||||
true, // History enabled
|
||||
<<<<<<< Updated upstream
|
||||
true, // Notifications indicator enabled
|
||||
true,
|
||||
=======
|
||||
true, // Notifications enabled
|
||||
false, // Display battery icon
|
||||
true, // ShowSMeter enabled
|
||||
true, // Night mode enabled
|
||||
>>>>>>> Stashed changes
|
||||
"", // Empty callsign
|
||||
TIMER_30S, // 30 seconds
|
||||
TIMER_30S, // 30 seconds
|
||||
0, // M17 CAN
|
||||
0, // Voice prompts off
|
||||
0, // Phonetic spell off
|
||||
|
|
|
@ -64,10 +64,7 @@ typedef struct
|
|||
bool txDisable;
|
||||
uint8_t step_index;
|
||||
bool pauseNotifications;
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
bool night_mode;
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
state_t;
|
||||
|
||||
|
|
|
@ -148,7 +148,6 @@ private:
|
|||
bool blinkOn; ///< Flag for LED blinking state
|
||||
bool rfSqlOpen; ///< Flag for RF squelch status (analog squelch).
|
||||
bool samplingActive; ///< True when baseband sampling is active
|
||||
|
||||
/**
|
||||
* Time (ms) to keep squelch open after physical closure,
|
||||
* preventing dropouts during speech gaps.
|
||||
|
|
|
@ -66,24 +66,15 @@ typedef struct
|
|||
char M17_src[10]; /** M17 LSF source */
|
||||
char M17_link[10]; /** M17 LSF traffic originator */
|
||||
char M17_refl[10]; /** M17 LSF reflector module */
|
||||
<<<<<<< Updated upstream
|
||||
char logMessage[10];
|
||||
|
||||
// bool historyEnabled;
|
||||
bool notificationsEnabled;
|
||||
bool pauseNotifications;
|
||||
bool menuActive;
|
||||
bool showSMeter;
|
||||
=======
|
||||
char logMessage[10];
|
||||
bool historyEnabled;
|
||||
bool notificationsEnabled;
|
||||
bool display_battery;
|
||||
bool pauseNotifications;
|
||||
bool menuActive;
|
||||
bool showSMeter;
|
||||
bool display_battery;
|
||||
bool nightMode;
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
rtxStatus_t;
|
||||
|
||||
|
@ -114,12 +105,8 @@ enum opstatus
|
|||
{
|
||||
OFF = 0, /**< OFF */
|
||||
RX = 1, /**< Receiving */
|
||||
<<<<<<< Updated upstream
|
||||
TX = 2, /**< Transmitting */
|
||||
LOG = 3 /**< Logging */
|
||||
=======
|
||||
TX = 2 /**< Transmitting */
|
||||
>>>>>>> Stashed changes
|
||||
};
|
||||
|
||||
|
||||
|
@ -173,11 +160,8 @@ void rtx_setHistory(bool);
|
|||
|
||||
void rtx_setMenuActive(bool);
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
void rtx_setShowSMeter(bool);
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -33,12 +33,8 @@ const stringsTable_t englishStrings =
|
|||
.contacts = "Contacts",
|
||||
.history = "History",
|
||||
.notifications = "Notifications",
|
||||
<<<<<<< Updated upstream
|
||||
.batteryIcon = "Battery icon",
|
||||
=======
|
||||
.batteryIcon = "Battery Icon",
|
||||
.displaySMeter = "SMeter",
|
||||
>>>>>>> Stashed changes
|
||||
.gps = "GPS",
|
||||
.settings = "Settings",
|
||||
.backupAndRestore = "Backup & Restore",
|
||||
|
|
|
@ -34,12 +34,8 @@ const stringsTable_t spanishStrings =
|
|||
.contacts = "Contactos",
|
||||
.history = "Historico",
|
||||
.notifications = "Notificacion",
|
||||
<<<<<<< Updated upstream
|
||||
.batteryIcon = "Bat. icon",
|
||||
=======
|
||||
.batteryIcon = "Icon de batteria",
|
||||
.displaySMeter = "SMeter",
|
||||
>>>>>>> Stashed changes
|
||||
.gps = "GPS",
|
||||
.settings = "Ajustes",
|
||||
.backupAndRestore = "Backup & Restaurar",
|
||||
|
|
|
@ -217,7 +217,7 @@ typedef struct ui_state_t
|
|||
// If true we can change a menu entry value with UP/DOWN
|
||||
bool edit_mode;
|
||||
bool input_locked;
|
||||
// Variables used for VFO input
|
||||
// Variables used for VFO input
|
||||
uint8_t input_number;
|
||||
uint8_t input_position;
|
||||
uint8_t input_set;
|
||||
|
@ -271,12 +271,9 @@ extern const color_t color_grey;
|
|||
extern const color_t color_white;
|
||||
extern const color_t yellow_fab413;
|
||||
extern const color_t color_blue;
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
extern const color_t color_cyan;
|
||||
extern const color_t color_darkRed;
|
||||
extern const color_t color_list;
|
||||
extern const color_t color_listSelected;
|
||||
>>>>>>> Stashed changes
|
||||
|
||||
#endif /* UI_DEFAULT_H */
|
||||
|
|
|
@ -38,10 +38,7 @@ typedef struct
|
|||
const char* history;
|
||||
const char* notifications;
|
||||
const char* batteryIcon;
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
const char* displaySMeter;
|
||||
>>>>>>> Stashed changes
|
||||
const char* gps;
|
||||
const char* settings;
|
||||
const char* backupAndRestore;
|
||||
|
|
|
@ -29,19 +29,12 @@ history_list_t *history_list;
|
|||
void history_init()
|
||||
{
|
||||
history_list = (history_list_t *)malloc(sizeof(history_list_t));
|
||||
<<<<<<< Updated upstream
|
||||
if(history_list==NULL) return NULL;
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
if(history_list==NULL) return;
|
||||
history_list->head = NULL;
|
||||
history_list->tail = NULL;
|
||||
history_list->length = 0;
|
||||
history_list->new_history = false;
|
||||
<<<<<<< Updated upstream
|
||||
// return list;
|
||||
=======
|
||||
history_list->status = ' ';
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
|
||||
int findCallsignLength(const char* callsign) {
|
||||
|
@ -53,27 +46,13 @@ int findCallsignLength(const char* callsign) {
|
|||
// history_t *history_find(history_list_t *list, const char* callsign)
|
||||
history_t *history_find(const char* callsign)
|
||||
{
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
history_list->status='L';
|
||||
>>>>>>> Stashed changes
|
||||
if(history_list == NULL) return NULL;
|
||||
|
||||
history_t *current = history_list->head;
|
||||
while(current != NULL)
|
||||
{
|
||||
int i = findCallsignLength(callsign);
|
||||
<<<<<<< Updated upstream
|
||||
if(strncmp(current->callsign, callsign, i) == 0)
|
||||
return current;
|
||||
current = current->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
history_t *history_create(const char* callsign, const char* module, datetime_t state_time)
|
||||
{
|
||||
=======
|
||||
if(strncmp(current->callsign, callsign, i) == 0) {
|
||||
history_list->status='F';
|
||||
return current;
|
||||
|
@ -86,7 +65,6 @@ history_t *history_create(const char* callsign, const char* module, datetime_t s
|
|||
|
||||
history_t *history_create(const char* callsign, datetime_t state_time)
|
||||
{
|
||||
>>>>>>> Stashed changes
|
||||
history_t *node = (history_t *) malloc(sizeof(history_t));
|
||||
if(node==NULL)
|
||||
return NULL;
|
||||
|
@ -117,17 +95,6 @@ void history_prune(history_t *this)
|
|||
free(current);
|
||||
}
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
// void history_push(history_list_t *list, const char* callsign, const char* module, datetime_t state_time)
|
||||
void history_push(const char* callsign, const char* module, datetime_t state_time)
|
||||
{
|
||||
if(history_list->length > HISTORY_MAX)
|
||||
history_prune(history_list->tail);
|
||||
history_t *node = history_create(callsign, module, state_time);
|
||||
if(node==NULL)
|
||||
return;
|
||||
node->next = history_list->head;
|
||||
=======
|
||||
void history_push(const char* callsign, datetime_t state_time)
|
||||
{
|
||||
if(history_list->length > HISTORY_MAX)
|
||||
|
@ -137,7 +104,6 @@ void history_push(const char* callsign, datetime_t state_time)
|
|||
return;
|
||||
if(history_list->head != NULL)
|
||||
node->next = history_list->head;
|
||||
>>>>>>> Stashed changes
|
||||
if(node->next != NULL) {
|
||||
node->next->prev = node;
|
||||
}
|
||||
|
@ -149,18 +115,9 @@ void history_push(const char* callsign, datetime_t state_time)
|
|||
history_list->new_history = true;
|
||||
}
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
// void history_update(history_list_t *list, history_t* node, const char* module, datetime_t state_time)
|
||||
void history_update(history_t* node, const char* module, datetime_t state_time)
|
||||
{
|
||||
if(node!=NULL) {
|
||||
// if((module!=NULL) && (module[0]!='\0'))
|
||||
// strncpy(node->module, module, 9);
|
||||
=======
|
||||
void history_update(history_t* node, datetime_t state_time)
|
||||
{
|
||||
if(node!=NULL) {
|
||||
>>>>>>> Stashed changes
|
||||
node->time = state_time;
|
||||
|
||||
if (history_list->head == node) {
|
||||
|
@ -194,16 +151,6 @@ void history_test(history_list_t *list, const char* src, const char* dest, const
|
|||
}
|
||||
#endif
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
// void history_add(history_list_t *list, const char* callsign, const char* module, datetime_t state_time)
|
||||
void history_add(const char* callsign, const char* module, datetime_t state_time)
|
||||
{
|
||||
history_t *node = history_find(callsign);
|
||||
// if(node != NULL)
|
||||
// history_update(node, module, state_time);
|
||||
// else
|
||||
history_push(callsign, module, state_time);
|
||||
=======
|
||||
void history_add(const char* callsign, datetime_t state_time)
|
||||
{
|
||||
if(callsign == NULL) return;
|
||||
|
@ -212,7 +159,6 @@ void history_add(const char* callsign, datetime_t state_time)
|
|||
history_update(node, state_time);
|
||||
else
|
||||
history_push(callsign, state_time);
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
|
||||
// int read_history(history_list_t *list, history_t *history, uint8_t pos)
|
||||
|
@ -230,11 +176,7 @@ int read_history(history_t *history, uint8_t pos)
|
|||
index++;
|
||||
}
|
||||
memcpy(history, current, sizeof(history_t));
|
||||
<<<<<<< Updated upstream
|
||||
return index;
|
||||
=======
|
||||
return 0;
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
|
||||
// uint8_t history_size(history_list_t *list)
|
||||
|
@ -243,15 +185,6 @@ uint8_t history_size()
|
|||
return history_list->length;
|
||||
}
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
void format_history_value(char *buf, int max_len, history_t history) {
|
||||
int gap = max_len - 10;
|
||||
gap -= strlen(history.callsign);
|
||||
char spaces[gap + 1]; // Create a buffer for the spaces
|
||||
memset(spaces, ' ', gap); // Fill the buffer with spaces
|
||||
spaces[gap] = '\0'; // Null-terminate the string
|
||||
sniprintf(buf, max_len, "%s%s%02d:%02d:%02d", history.callsign, spaces, history.time.hour, history.time.minute, history.time.second);
|
||||
=======
|
||||
char history_status()
|
||||
{
|
||||
return history_list->status;
|
||||
|
@ -265,7 +198,6 @@ void format_history_value(char *buf, int max_len, history_t history) {
|
|||
// spaces[gap] = '\0'; // Null-terminate the string
|
||||
// sniprintf(buf, max_len, "%s%s%02d:%02d:%02d", history.callsign, spaces, history.time.hour, history.time.minute, history.time.second);
|
||||
sniprintf(buf, max_len, "%s %02d:%02d:%02d", history.callsign, history.time.hour, history.time.minute, history.time.second);
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
|
||||
bool is_new_history() {
|
||||
|
@ -275,7 +207,3 @@ bool is_new_history() {
|
|||
void reset_new_history() {
|
||||
history_list->new_history = false;
|
||||
}
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
|
|
|
@ -43,12 +43,7 @@ void openrtx_init()
|
|||
|
||||
platform_init(); // Initialize low-level platform drivers
|
||||
state_init(); // Initialize radio state
|
||||
<<<<<<< Updated upstream
|
||||
history_init(); // Initialize callsign history
|
||||
|
||||
=======
|
||||
history_init();
|
||||
>>>>>>> Stashed changes
|
||||
gfx_init(); // Initialize display and graphics driver
|
||||
kbd_init(); // Initialize keyboard driver
|
||||
ui_init(); // Initialize user interface
|
||||
|
|
|
@ -103,17 +103,10 @@ void *ui_threadFunc(void *arg)
|
|||
rtx_cfg.txToneEn = state.channel.fm.txToneEn;
|
||||
rtx_cfg.txTone = ctcss_tone[state.channel.fm.txTone];
|
||||
rtx_cfg.toneEn = state.tone_enabled;
|
||||
<<<<<<< Updated upstream
|
||||
rtx_cfg.historyEnabled = state.settings.history_enabled;
|
||||
rtx_cfg.notificationsEnabled = state.settings.notifications_enabled;
|
||||
rtx_cfg.pauseNotifications = state.pauseNotifications;
|
||||
rtx_cfg.showSMeter = state.settings.showSMeter;
|
||||
=======
|
||||
rtx_cfg.historyEnabled = state.settings.history_enabled;
|
||||
rtx_cfg.notificationsEnabled = state.settings.notifications_enabled;
|
||||
rtx_cfg.pauseNotifications = state.pauseNotifications;
|
||||
rtx_cfg.showSMeter = state.settings.showSMeter;
|
||||
>>>>>>> Stashed changes
|
||||
|
||||
// Enable Tx if channel allows it and we are in UI main screen
|
||||
rtx_cfg.txDisable = state.channel.rx_only || state.txDisable;
|
||||
|
|
|
@ -85,11 +85,7 @@ void OpMode_M17::disable()
|
|||
|
||||
void OpMode_M17::blinkLed(rtxStatus_t *const status)
|
||||
{
|
||||
<<<<<<< Updated upstream
|
||||
if (status->pauseNotifications) || !status->historyEnabled || !status->notificationsEnabled || status->menuActive)
|
||||
=======
|
||||
if (status->pauseNotifications || !status->historyEnabled || !status->notificationsEnabled || status->menuActive)
|
||||
>>>>>>> Stashed changes
|
||||
{
|
||||
platform_ledOff(GREEN);
|
||||
platform_ledOff(RED);
|
||||
|
@ -113,7 +109,6 @@ void OpMode_M17::blinkLed(rtxStatus_t *const status)
|
|||
|
||||
void OpMode_M17::update(rtxStatus_t *const status, const bool newCfg)
|
||||
{
|
||||
#define PLATFORM_MDUV3x0
|
||||
(void) newCfg;
|
||||
#if defined(PLATFORM_MD3x0) || defined(PLATFORM_MDUV3x0)
|
||||
//
|
||||
|
@ -149,15 +144,9 @@ void OpMode_M17::update(rtxStatus_t *const status, const bool newCfg)
|
|||
txState(status);
|
||||
break;
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
case LOG:
|
||||
txLog(status);
|
||||
break;
|
||||
=======
|
||||
// case LOG:
|
||||
// txLog(status);
|
||||
// break;
|
||||
>>>>>>> Stashed changes
|
||||
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -68,10 +68,7 @@ void rtx_init(pthread_mutex_t *m)
|
|||
rtxStatus.M17_refl[0] = '\0';
|
||||
rtxStatus.historyEnabled = false;
|
||||
rtxStatus.notificationsEnabled = true;
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
rtxStatus.nightMode = true;
|
||||
>>>>>>> Stashed changes
|
||||
currMode = &noMode;
|
||||
|
||||
/*
|
||||
|
@ -211,13 +208,10 @@ void rtx_task()
|
|||
}
|
||||
}
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
if(rtxStatus.logMessage != '\0')
|
||||
{
|
||||
rtxStatus.opMode = OPMODE_LOG;
|
||||
}
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
// if(rtxStatus.logMessage != '\0')
|
||||
// {
|
||||
// rtxStatus.opMode = OPMODE_LOG;
|
||||
// }
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -243,21 +237,11 @@ bool rtx_rxSquelchOpen()
|
|||
return currMode->rxSquelchOpen();
|
||||
}
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
void rtx_setHistory(bool value)
|
||||
=======
|
||||
void rtx_setHistory(bool value)
|
||||
>>>>>>> Stashed changes
|
||||
{
|
||||
rtxStatus.historyEnabled = value;
|
||||
}
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
void rtx_setMenuActive(bool value)
|
||||
{
|
||||
rtxStatus.menuActive = value;
|
||||
}
|
||||
=======
|
||||
void rtx_setNightMode(bool value)
|
||||
{
|
||||
rtxStatus.nightMode = value;
|
||||
|
@ -272,4 +256,3 @@ void rtx_setMenuActive(bool value)
|
|||
{
|
||||
rtxStatus.menuActive = value;
|
||||
}
|
||||
>>>>>>> Stashed changes
|
||||
|
|
|
@ -161,13 +161,9 @@ const char *display_items[] =
|
|||
"Contrast",
|
||||
#endif
|
||||
"Timer",
|
||||
<<<<<<< Updated upstream
|
||||
"Notifications"
|
||||
=======
|
||||
"Notifications",
|
||||
"Battery Icon",
|
||||
"SMeter"
|
||||
>>>>>>> Stashed changes
|
||||
};
|
||||
|
||||
#ifdef CONFIG_GPS
|
||||
|
@ -289,15 +285,10 @@ const color_t color_white = {255, 255, 255, 255};
|
|||
const color_t yellow_fab413 = {250, 180, 19, 255};
|
||||
const color_t color_blue = {39, 60, 98, 255};
|
||||
const color_t color_cyan = {0, 253, 255, 255};
|
||||
<<<<<<< Updated upstream
|
||||
const color_t color_cyan = {0, 253, 255, 255};
|
||||
const color_t color_darkRed = {166, 25, 0, 255};
|
||||
=======
|
||||
const color_t color_darkRed = {166, 25, 0, 255};
|
||||
|
||||
const color_t color_list = color_cyan;
|
||||
const color_t color_listSelected = color_black;
|
||||
>>>>>>> Stashed changes
|
||||
|
||||
layout_t layout;
|
||||
state_t last_state;
|
||||
|
@ -1297,22 +1288,11 @@ void ui_drawSplashScreen()
|
|||
|
||||
gfx_print(logo_orig, logo_font, TEXT_ALIGN_CENTER, yellow_fab413, "O P N\nR T X");
|
||||
gfx_print(call_orig, call_font, TEXT_ALIGN_CENTER, color_white, state.settings.callsign);
|
||||
<<<<<<< Updated upstream
|
||||
point_t orig_v = {0, 12};
|
||||
gfx_print(orig_v, call_font, TEXT_ALIGN_CENTER, color_blue, "202503271257");
|
||||
orig_v.y = 24;
|
||||
gfx_print(orig_v, logo_font, TEXT_ALIGN_CENTER, color_blue, "M0VVA mod");
|
||||
orig_v.x = 96;
|
||||
orig_v.y = 0;
|
||||
gfx_print(orig_v, logo_font, TEXT_ALIGN_LEFT, color_blue, "X");
|
||||
=======
|
||||
|
||||
point_t orig_v = {0, 12};
|
||||
gfx_print(orig_v, FONT_SIZE_6PT, TEXT_ALIGN_CENTER, color_blue, "20250523");
|
||||
point_t orig_a = {0, 24};
|
||||
gfx_print(orig_a, FONT_SIZE_8PT, TEXT_ALIGN_CENTER, color_blue, "M0VVA mod");
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
vp_announceSplashScreen();
|
||||
}
|
||||
|
||||
|
@ -1937,10 +1917,6 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
else if(msg.keys & KEY_ESC)
|
||||
_ui_menuBack(MENU_TOP);
|
||||
break;
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
#ifdef CONFIG_M17
|
||||
// History menu screen
|
||||
// M0VVA - implement history displays
|
||||
|
@ -1951,21 +1927,13 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
else if(msg.keys & KEY_DOWN || msg.keys & KNOB_RIGHT)
|
||||
{
|
||||
history_t history;
|
||||
<<<<<<< Updated upstream
|
||||
if(read_history(history_list, &history, ui_state.menu_selected + 1) != -1)
|
||||
=======
|
||||
if(read_history(&history, ui_state.menu_selected + 1) != -1)
|
||||
>>>>>>> Stashed changes
|
||||
ui_state.menu_selected += 1;
|
||||
}
|
||||
else if(msg.long_press && msg.keys & KEY_ENTER)
|
||||
{
|
||||
history_t history;
|
||||
<<<<<<< Updated upstream
|
||||
read_history(history_list, &history, ui_state.menu_selected);
|
||||
=======
|
||||
read_history(&history, ui_state.menu_selected);
|
||||
>>>>>>> Stashed changes
|
||||
strncpy(state.settings.m17_dest, history.callsign, 10);
|
||||
*sync_rtx = true;
|
||||
}
|
||||
|
@ -1973,10 +1941,6 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
_ui_menuBack(MENU_TOP);
|
||||
break;
|
||||
#endif
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
#ifdef CONFIG_GPS
|
||||
// GPS menu screen
|
||||
case MENU_GPS:
|
||||
|
@ -2161,12 +2125,6 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
_ui_changeTimer(-1);
|
||||
vp_announceDisplayTimer();
|
||||
break;
|
||||
<<<<<<< Updated upstream
|
||||
case D_NOTIFICATIONS:
|
||||
state.settings.notifications_enabled = !state.settings.notifications_enabled;
|
||||
*sync_rtx = true;
|
||||
break;
|
||||
=======
|
||||
|
||||
case D_NOTIFICATIONS:
|
||||
state.settings.notifications_enabled = !state.settings.notifications_enabled;
|
||||
|
@ -2182,7 +2140,6 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
state.settings.display_battery = !state.settings.display_battery;
|
||||
break;
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
default:
|
||||
state.ui_screen = SETTINGS_DISPLAY;
|
||||
}
|
||||
|
@ -2210,12 +2167,6 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
_ui_changeTimer(+1);
|
||||
vp_announceDisplayTimer();
|
||||
break;
|
||||
<<<<<<< Updated upstream
|
||||
case D_NOTIFICATIONS:
|
||||
state.settings.notifications_enabled = !state.settings.notifications_enabled;
|
||||
*sync_rtx = true;
|
||||
break;
|
||||
=======
|
||||
|
||||
case D_NOTIFICATIONS:
|
||||
state.settings.notifications_enabled = !state.settings.notifications_enabled;
|
||||
|
@ -2227,7 +2178,6 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
*sync_rtx = true;
|
||||
break;
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
default:
|
||||
state.ui_screen = SETTINGS_DISPLAY;
|
||||
}
|
||||
|
@ -2452,13 +2402,8 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
ui_state.edit_mode = !ui_state.edit_mode;
|
||||
else if(msg.keys & KEY_ESC)
|
||||
ui_state.edit_mode = false;
|
||||
<<<<<<< Updated upstream
|
||||
break;
|
||||
case M17_HISTORY:
|
||||
=======
|
||||
break;
|
||||
case M17_HISTORY:
|
||||
>>>>>>> Stashed changes
|
||||
if(msg.keys & KEY_LEFT || msg.keys & KEY_RIGHT ||
|
||||
(ui_state.edit_mode &&
|
||||
(msg.keys & KEY_DOWN || msg.keys & KNOB_LEFT ||
|
||||
|
@ -2466,11 +2411,7 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
{
|
||||
state.settings.history_enabled =
|
||||
!state.settings.history_enabled;
|
||||
<<<<<<< Updated upstream
|
||||
rtx_setNotifications(state.settings.history_enabled);
|
||||
=======
|
||||
// rtx_setNotifications(state.settings.history_enabled);
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
else if(msg.keys & KEY_ENTER)
|
||||
ui_state.edit_mode = !ui_state.edit_mode;
|
||||
|
@ -2625,12 +2566,9 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
}
|
||||
#endif // CONFIG_GPS
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
if (((txOngoing || rtx_rxSquelchOpen()) && !last_state.settings.notifications_enabled) || last_state.volume_changed)
|
||||
=======
|
||||
//OH if (((txOngoing || rtx_rxSquelchOpen()) && !last_state.settings.notifications_enabled) || last_state.volume_changed)
|
||||
if ((!last_state.settings.notifications_enabled && (txOngoing || rtx_rxSquelchOpen())) || (!last_state.settings.night_mode && (abs((int)state.volume - (int)last_state.volume) > 2)))
|
||||
// if ((!last_state.settings.notifications_enabled && (txOngoing || rtx_rxSquelchOpen())) )
|
||||
>>>>>>> Stashed changes
|
||||
{
|
||||
_ui_exitStandby(now);
|
||||
if(last_state.volume_changed) state.volume_changed = false;
|
||||
|
@ -2656,11 +2594,6 @@ bool ui_updateGUI()
|
|||
}
|
||||
|
||||
rtx_setMenuActive(!(last_state.ui_screen == MAIN_VFO || last_state.ui_screen == MAIN_VFO_INPUT));
|
||||
<<<<<<< Updated upstream
|
||||
|
||||
=======
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
// Draw current GUI page
|
||||
switch(last_state.ui_screen)
|
||||
{
|
||||
|
@ -2692,11 +2625,8 @@ bool ui_updateGUI()
|
|||
case MENU_CONTACTS:
|
||||
_ui_drawMenuContacts(&ui_state);
|
||||
break;
|
||||
<<<<<<< Updated upstream
|
||||
// Contacts menu screen
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
pul case MENU_HISTORY:
|
||||
case MENU_HISTORY:
|
||||
if(state.settings.history_enabled)
|
||||
_ui_drawMenuHistory(&ui_state); // fixed
|
||||
break;
|
||||
|
|
|
@ -62,43 +62,20 @@ void _ui_drawMainTop(ui_state_t * ui_state)
|
|||
gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_RIGHT,
|
||||
color_white,"%.1fV", last_state.v_bat);
|
||||
#else
|
||||
<<<<<<< Updated upstream
|
||||
switch(last_state.settings.display_battery) {
|
||||
case 1:
|
||||
=======
|
||||
if(last_state.settings.display_battery) {
|
||||
>>>>>>> Stashed changes
|
||||
// Otherwise print battery icon on top bar, use 4 px padding
|
||||
uint16_t bat_width = CONFIG_SCREEN_WIDTH / 9;
|
||||
uint16_t bat_height = layout.top_h - (layout.status_v_pad * 2);
|
||||
point_t bat_pos = {CONFIG_SCREEN_WIDTH - bat_width - layout.horizontal_pad,
|
||||
layout.status_v_pad};
|
||||
gfx_drawBattery(bat_pos, bat_width, bat_height, last_state.charge);
|
||||
<<<<<<< Updated upstream
|
||||
break;
|
||||
case 2:
|
||||
point_t charge_pos = {CONFIG_SCREEN_WIDTH - 24 - layout.horizontal_pad,
|
||||
layout.status_v_pad};
|
||||
gfx_print(charge_pos , layout.line1_font, TEXT_ALIGN_LEFT,
|
||||
color_white,"%02d", last_state.charge);
|
||||
break;
|
||||
=======
|
||||
} else {
|
||||
point_t bat_pos = {layout.top_pos.x, layout.top_pos.y - 2};
|
||||
gfx_print(bat_pos , FONT_SIZE_6PT, TEXT_ALIGN_RIGHT,
|
||||
color_white,"%d%%", last_state.charge);
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
#endif
|
||||
|
||||
point_t list_pos = {layout.top_pos.x + 24, layout.top_pos.y};
|
||||
if (last_state.settings.history_enabled)
|
||||
{
|
||||
gfx_print(list_pos , layout.line1_font, TEXT_ALIGN_LEFT,
|
||||
is_new_history() ? yellow_fab413 : color_black, "H%d", history_size(history_list));
|
||||
rtx_setHistory(is_new_history());
|
||||
}
|
||||
|
||||
if (ui_state->input_locked == true)
|
||||
gfx_drawSymbol(layout.top_pos, layout.top_symbol_size, TEXT_ALIGN_LEFT,
|
||||
color_white, SYMBOL_LOCK);
|
||||
|
@ -219,52 +196,6 @@ void _ui_drawModeInfo(ui_state_t* ui_state)
|
|||
gfx_print(layout.line3_pos, layout.line2_font, TEXT_ALIGN_CENTER,
|
||||
color_white, "%s", rtxStatus.M17_refl);
|
||||
}
|
||||
<<<<<<< Updated upstream
|
||||
// if ( (strncmp(rtxStatus.M17_dst, "INFO",4)!=0) &&
|
||||
// (strncmp(rtxStatus.M17_dst, "ECHO",4)!=0) &&
|
||||
// (strncmp(rtxStatus.M17_src, last_state.settings.callsign, 8)!=0) )
|
||||
// history_add(history_list, rtxStatus.M17_src, rtxStatus.M17_refl,
|
||||
// utcToLocalTime(last_state.time, last_state.settings.utc_timezone));
|
||||
|
||||
if (rtxStatus.M17_dst == NULL || rtxStatus.M17_src == NULL || rtxStatus.M17_refl == NULL) {
|
||||
printf("Error: Invalid M17 status fields\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (last_state.settings.callsign == NULL) {
|
||||
printf("Error: Invalid callsign in settings\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (history_list == NULL) {
|
||||
printf("Error: history_list is NULL\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (strnlen(rtxStatus.M17_dst, 4) < 4 || strnlen(rtxStatus.M17_src, 8) < 8) {
|
||||
printf("Error: M17_dst or M17_src string is too short\n");
|
||||
return;
|
||||
}
|
||||
|
||||
datetime_t local_time = utcToLocalTime(last_state.time, last_state.settings.utc_timezone);
|
||||
if (local_time.hour < 0 || local_time.hour > 23 ||
|
||||
local_time.minute < 0 || local_time.minute > 59 ||
|
||||
local_time.second < 0 || local_time.second > 59) {
|
||||
printf("Error: Invalid local time\n");
|
||||
return;
|
||||
}
|
||||
|
||||
bool isInfo = (strncmp(rtxStatus.M17_dst, "INFO", 4) == 0);
|
||||
bool isEcho = (strncmp(rtxStatus.M17_dst, "ECHO", 4) == 0);
|
||||
bool isSelf = (strncmp(rtxStatus.M17_src, last_state.settings.callsign, 8) == 0);
|
||||
|
||||
if (!isInfo && !isEcho && !isSelf) {
|
||||
if (!history_add(history_list, rtxStatus.M17_src, rtxStatus.M17_refl, local_time)) {
|
||||
printf("Error: Failed to add to history\n");
|
||||
}
|
||||
}
|
||||
|
||||
=======
|
||||
|
||||
// NEW VERSION
|
||||
if ( rtxStatus.M17_dst != NULL &&
|
||||
|
@ -283,7 +214,6 @@ void _ui_drawModeInfo(ui_state_t* ui_state)
|
|||
}
|
||||
}
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -286,18 +286,12 @@ int _ui_getDisplayValueName(char *buf, uint8_t max_len, uint8_t index)
|
|||
sniprintf(buf, max_len, "%s",
|
||||
display_timer_values[last_state.settings.display_timer]);
|
||||
return 0;
|
||||
<<<<<<< Updated upstream
|
||||
case D_NOTIFICATIONS:
|
||||
=======
|
||||
case D_NOTIFICATIONS:
|
||||
>>>>>>> Stashed changes
|
||||
sniprintf(buf, max_len, "%s",
|
||||
(last_state.settings.notifications_enabled) ?
|
||||
currentLanguage->on :
|
||||
currentLanguage->off);
|
||||
return 0;
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
case D_BATTERY:
|
||||
sniprintf(buf, max_len, "%s",
|
||||
(last_state.settings.display_battery) ?
|
||||
|
@ -310,7 +304,6 @@ int _ui_getDisplayValueName(char *buf, uint8_t max_len, uint8_t index)
|
|||
currentLanguage->on :
|
||||
currentLanguage->off);
|
||||
return 0;
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
sniprintf(buf, max_len, "%d", value);
|
||||
return 0;
|
||||
|
@ -461,11 +454,7 @@ int _ui_getM17ValueName(char *buf, uint8_t max_len, uint8_t index)
|
|||
currentLanguage->on :
|
||||
currentLanguage->off);
|
||||
break;
|
||||
<<<<<<< Updated upstream
|
||||
case M17_HISTORY_ENABLED:
|
||||
=======
|
||||
case M17_HISTORY:
|
||||
>>>>>>> Stashed changes
|
||||
sniprintf(buf, max_len, "%s", (last_state.settings.history_enabled) ?
|
||||
currentLanguage->on :
|
||||
currentLanguage->off);
|
||||
|
@ -681,11 +670,7 @@ void _ui_drawHistoryList(uint8_t selected, int (*getCurrentEntry)(char *buf, uin
|
|||
uint8_t entries_in_screen = (CONFIG_SCREEN_HEIGHT - 1 - pos.y) / layout.menu_h + 1;
|
||||
uint8_t scroll = 0;
|
||||
char entry_buf[MAX_ENTRY_LEN] = "";
|
||||
<<<<<<< Updated upstream
|
||||
color_t text_color = color_white;
|
||||
=======
|
||||
color_t text_color = color_cyan;
|
||||
>>>>>>> Stashed changes
|
||||
for(int item=0, result=0; (result == 0) && (pos.y < CONFIG_SCREEN_HEIGHT); item++)
|
||||
{
|
||||
// If selection is off the screen, scroll screen
|
||||
|
@ -716,16 +701,6 @@ void _ui_drawHistoryList(uint8_t selected, int (*getCurrentEntry)(char *buf, uin
|
|||
// If no space is found, treat the entire entry as the left part
|
||||
strncpy(left_part, entry_buf, sizeof(left_part) - 1);
|
||||
left_part[sizeof(left_part) - 1] = '\0';
|
||||
<<<<<<< Updated upstream
|
||||
}
|
||||
text_color = color_white;
|
||||
if(item + scroll == selected)
|
||||
{
|
||||
text_color = color_black;
|
||||
// Draw rectangle under selected item, compensating for text height
|
||||
point_t rect_pos = {0, pos.y - layout.menu_h + 3};
|
||||
gfx_drawRect(rect_pos, CONFIG_SCREEN_WIDTH, layout.menu_h, color_white, true);
|
||||
=======
|
||||
}
|
||||
text_color = color_cyan;
|
||||
if(item + scroll == selected)
|
||||
|
@ -734,16 +709,11 @@ void _ui_drawHistoryList(uint8_t selected, int (*getCurrentEntry)(char *buf, uin
|
|||
// Draw rectangle under selected item, compensating for text height
|
||||
point_t rect_pos = {0, pos.y - layout.menu_h + 3};
|
||||
gfx_drawRect(rect_pos, CONFIG_SCREEN_WIDTH, layout.menu_h, color_cyan, true);
|
||||
>>>>>>> Stashed changes
|
||||
announceMenuItemIfNeeded(entry_buf, NULL, false);
|
||||
}
|
||||
pos.x = 0;
|
||||
gfx_print(pos, layout.menu_font, TEXT_ALIGN_LEFT, text_color, left_part);
|
||||
<<<<<<< Updated upstream
|
||||
pos.x = CONFIG_SCREEN_WIDTH;
|
||||
=======
|
||||
// pos.x = 64;
|
||||
>>>>>>> Stashed changes
|
||||
gfx_print(pos, layout.menu_font, TEXT_ALIGN_RIGHT, text_color, right_part);
|
||||
pos.y += layout.menu_h;
|
||||
}
|
||||
|
@ -753,11 +723,7 @@ void _ui_drawHistoryList(uint8_t selected, int (*getCurrentEntry)(char *buf, uin
|
|||
void _ui_drawMenuHistory(ui_state_t* ui_state)
|
||||
{
|
||||
gfx_clearScreen();
|
||||
<<<<<<< Updated upstream
|
||||
// Print "Contacts" on top bar
|
||||
=======
|
||||
// Print "History" on top bar
|
||||
>>>>>>> Stashed changes
|
||||
gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_CENTER,
|
||||
color_white, currentLanguage->history);
|
||||
// Print contact entries
|
||||
|
|
Ładowanie…
Reference in New Issue