Renamed 'HAS_GPS' and 'HAS_RTC' to, respectively, 'GPS_PRESENT' and 'RTC_PRESENT'

pull/87/head
Silvano Seva 2022-06-28 11:19:50 +02:00
rodzic 6d10f52b5b
commit 2fc89bf583
11 zmienionych plików z 42 dodań i 42 usunięć

Wyświetl plik

@ -75,7 +75,7 @@ enum menuItems
M_BANK = 0,
M_CHANNEL,
M_CONTACTS,
#ifdef HAS_GPS
#ifdef GPS_PRESENT
M_GPS,
#endif
M_SETTINGS,
@ -87,10 +87,10 @@ enum menuItems
enum settingsItems
{
S_DISPLAY = 0
#ifdef HAS_RTC
#ifdef RTC_PRESENT
,S_TIMEDATE
#endif
#ifdef HAS_GPS
#ifdef GPS_PRESENT
,S_GPS
#endif
,S_M17
@ -112,7 +112,7 @@ enum displayItems
,D_TIMER
};
#ifdef HAS_GPS
#ifdef GPS_PRESENT
enum settingsGPSItems
{
G_ENABLED = 0,
@ -176,7 +176,7 @@ typedef struct ui_state_t
freq_t new_tx_frequency;
char new_rx_freq_buf[14];
char new_tx_freq_buf[14];
#ifdef HAS_RTC
#ifdef RTC_PRESENT
// Variables used for Time & Date input
datetime_t new_timedate;
char new_date_buf[9];

Wyświetl plik

@ -74,7 +74,7 @@ void state_init()
/*
* Initialise remaining fields
*/
#ifdef HAS_RTC
#ifdef RTC_PRESENT
state.time = rtc_getTime();
#endif
state.v_bat = platform_getVbat();
@ -118,7 +118,7 @@ void state_update()
state.charge = battery_getCharge(state.v_bat);
state.rssi = rtx_getRssi();
#ifdef HAS_RTC
#ifdef RTC_PRESENT
state.time = rtc_getTime();
#endif
}

Wyświetl plik

@ -36,7 +36,7 @@
#include <string.h>
#include <utils.h>
#include <input.h>
#ifdef HAS_GPS
#ifdef GPS_PRESENT
#include <interfaces/gps.h>
#include <gps.h>
#endif
@ -215,7 +215,7 @@ void *rtx_task(void *arg)
return NULL;
}
#if defined(HAS_GPS) && !defined(MD3x0_ENABLE_DBG)
#if defined(GPS_PRESENT) && !defined(MD3x0_ENABLE_DBG)
/**
* \internal Task function for parsing GPS data and updating radio state.
*/
@ -283,7 +283,7 @@ void create_threads()
pthread_attr_setstacksize(&kbd_attr, KBD_TASK_STKSIZE);
pthread_create(&kbd_thread, &kbd_attr, kbd_task, NULL);
#if defined(HAS_GPS) && !defined(MD3x0_ENABLE_DBG)
#if defined(GPS_PRESENT) && !defined(MD3x0_ENABLE_DBG)
// Create GPS thread
pthread_t gps_thread;
pthread_attr_t gps_attr;

Wyświetl plik

@ -68,7 +68,7 @@
#include <interfaces/platform.h>
#include <interfaces/cps_io.h>
#include <interfaces/nvmem.h>
#ifdef HAS_GPS
#ifdef GPS_PRESENT
#include <interfaces/gps.h>
#endif
#include <interfaces/delays.h>
@ -94,7 +94,7 @@ extern void _ui_drawMenuTop(ui_state_t* ui_state);
extern void _ui_drawMenuBank(ui_state_t* ui_state);
extern void _ui_drawMenuChannel(ui_state_t* ui_state);
extern void _ui_drawMenuContacts(ui_state_t* ui_state);
#ifdef HAS_GPS
#ifdef GPS_PRESENT
extern void _ui_drawMenuGPS();
extern void _ui_drawSettingsGPS(ui_state_t* ui_state);
#endif
@ -104,7 +104,7 @@ extern void _ui_drawMenuBackup(ui_state_t* ui_state);
extern void _ui_drawMenuRestore(ui_state_t* ui_state);
extern void _ui_drawMenuInfo(ui_state_t* ui_state);
extern void _ui_drawMenuAbout();
#ifdef HAS_RTC
#ifdef RTC_PRESENT
extern void _ui_drawSettingsTimeDate();
extern void _ui_drawSettingsTimeDateSet(ui_state_t* ui_state);
#endif
@ -118,7 +118,7 @@ const char *menu_items[] =
"Banks",
"Channels",
"Contacts",
#ifdef HAS_GPS
#ifdef GPS_PRESENT
"GPS",
#endif
"Settings",
@ -130,10 +130,10 @@ const char *menu_items[] =
const char *settings_items[] =
{
"Display",
#ifdef HAS_RTC
#ifdef RTC_PRESENT
"Time & Date",
#endif
#ifdef HAS_GPS
#ifdef GPS_PRESENT
"GPS",
#endif
"M17",
@ -149,7 +149,7 @@ const char *display_items[] =
"Timer"
};
#ifdef HAS_GPS
#ifdef GPS_PRESENT
const char *settings_gps_items[] =
{
"GPS Enabled",
@ -222,7 +222,7 @@ const char *symbols_ITU_T_E161_callsign[] =
const uint8_t menu_num = sizeof(menu_items)/sizeof(menu_items[0]);
const uint8_t settings_num = sizeof(settings_items)/sizeof(settings_items[0]);
const uint8_t display_num = sizeof(display_items)/sizeof(display_items[0]);
#ifdef HAS_GPS
#ifdef GPS_PRESENT
const uint8_t settings_gps_num = sizeof(settings_gps_items)/sizeof(settings_gps_items[0]);
#endif
const uint8_t backup_restore_num = sizeof(backup_restore_items)/sizeof(backup_restore_items[0]);
@ -461,7 +461,7 @@ freq_t _ui_freq_add_digit(freq_t freq, uint8_t pos, uint8_t number)
return freq += number * coefficient;
}
#ifdef HAS_RTC
#ifdef RTC_PRESENT
void _ui_timedate_add_digit(datetime_t *timedate, uint8_t pos, uint8_t number)
{
switch(pos)
@ -1272,7 +1272,7 @@ void ui_updateFSM(event_t event, bool *sync_rtx)
case M_CONTACTS:
state.ui_screen = MENU_CONTACTS;
break;
#ifdef HAS_GPS
#ifdef GPS_PRESENT
case M_GPS:
state.ui_screen = MENU_GPS;
break;
@ -1368,7 +1368,7 @@ void ui_updateFSM(event_t event, bool *sync_rtx)
else if(msg.keys & KEY_ESC)
_ui_menuBack(MENU_TOP);
break;
#ifdef HAS_GPS
#ifdef GPS_PRESENT
// GPS menu screen
case MENU_GPS:
if(msg.keys & KEY_ESC)
@ -1389,12 +1389,12 @@ void ui_updateFSM(event_t event, bool *sync_rtx)
case S_DISPLAY:
state.ui_screen = SETTINGS_DISPLAY;
break;
#ifdef HAS_RTC
#ifdef RTC_PRESENT
case S_TIMEDATE:
state.ui_screen = SETTINGS_TIMEDATE;
break;
#endif
#ifdef HAS_GPS
#ifdef GPS_PRESENT
case S_GPS:
state.ui_screen = SETTINGS_GPS;
break;
@ -1454,7 +1454,7 @@ void ui_updateFSM(event_t event, bool *sync_rtx)
if(msg.keys & KEY_ESC)
_ui_menuBack(MENU_TOP);
break;
#ifdef HAS_RTC
#ifdef RTC_PRESENT
// Time&Date settings screen
case SETTINGS_TIMEDATE:
if(msg.keys & KEY_ENTER)
@ -1547,7 +1547,7 @@ void ui_updateFSM(event_t event, bool *sync_rtx)
else if(msg.keys & KEY_ESC)
_ui_menuBack(MENU_SETTINGS);
break;
#ifdef HAS_GPS
#ifdef GPS_PRESENT
case SETTINGS_GPS:
if(msg.keys & KEY_LEFT || msg.keys & KEY_RIGHT ||
(ui_state.edit_mode &&
@ -1710,7 +1710,7 @@ void ui_updateGUI()
case MENU_CONTACTS:
_ui_drawMenuContacts(&ui_state);
break;
#ifdef HAS_GPS
#ifdef GPS_PRESENT
// GPS menu screen
case MENU_GPS:
_ui_drawMenuGPS();
@ -1740,7 +1740,7 @@ void ui_updateGUI()
case MENU_ABOUT:
_ui_drawMenuAbout();
break;
#ifdef HAS_RTC
#ifdef RTC_PRESENT
// Time&Date settings screen
case SETTINGS_TIMEDATE:
_ui_drawSettingsTimeDate();
@ -1754,7 +1754,7 @@ void ui_updateGUI()
case SETTINGS_DISPLAY:
_ui_drawSettingsDisplay(&ui_state);
break;
#ifdef HAS_GPS
#ifdef GPS_PRESENT
// GPS settings screen
case SETTINGS_GPS:
_ui_drawSettingsGPS(&ui_state);

Wyświetl plik

@ -35,7 +35,7 @@ void _ui_drawMainBackground()
void _ui_drawMainTop()
{
#ifdef HAS_RTC
#ifdef RTC_PRESENT
// Print clock on top bar
datetime_t local_time = utcToLocalTime(last_state.time,
last_state.settings.utc_timezone);

Wyświetl plik

@ -171,7 +171,7 @@ int _ui_getDisplayValueName(char *buf, uint8_t max_len, uint8_t index)
return 0;
}
#ifdef HAS_GPS
#ifdef GPS_PRESENT
int _ui_getSettingsGPSEntryName(char *buf, uint8_t max_len, uint8_t index)
{
if(index >= settings_gps_num) return -1;
@ -338,7 +338,7 @@ void _ui_drawMenuContacts(ui_state_t* ui_state)
_ui_drawMenuList(ui_state->menu_selected, _ui_getContactName);
}
#ifdef HAS_GPS
#ifdef GPS_PRESENT
void _ui_drawMenuGPS()
{
char *fix_buf, *type_buf;
@ -555,7 +555,7 @@ void _ui_drawSettingsDisplay(ui_state_t* ui_state)
_ui_getDisplayValueName);
}
#ifdef HAS_GPS
#ifdef GPS_PRESENT
void _ui_drawSettingsGPS(ui_state_t* ui_state)
{
gfx_clearScreen();
@ -569,7 +569,7 @@ void _ui_drawSettingsGPS(ui_state_t* ui_state)
}
#endif
#ifdef HAS_RTC
#ifdef RTC_PRESENT
void _ui_drawSettingsTimeDate()
{
gfx_clearScreen();

Wyświetl plik

@ -27,10 +27,10 @@ extern "C" {
#endif
/* Device has a working real time clock */
#define HAS_RTC
#define RTC_PRESENT
/* Device supports an optional GPS chip */
#define HAS_GPS
#define GPS_PRESENT
/* Device has a channel selection knob */
#define HAS_ABSOLUTE_KNOB

Wyświetl plik

@ -28,10 +28,10 @@ extern "C" {
#endif
/* Device has a working real time clock */
#define HAS_RTC
#define RTC_PRESENT
/* Device supports an optional GPS chip */
#define HAS_GPS
#define GPS_PRESENT
/* Screen dimensions */
#define SCREEN_WIDTH 128

Wyświetl plik

@ -27,10 +27,10 @@ extern "C" {
#endif
/* Device has a working real time clock */
#define HAS_RTC
#define RTC_PRESENT
/* Device supports an optional GPS chip */
#define HAS_GPS
#define GPS_PRESENT
/* Screen dimensions */
#define SCREEN_WIDTH 160

Wyświetl plik

@ -25,7 +25,7 @@
#include <stm32f4xx.h>
/* Device has a working real time clock */
#define HAS_RTC
#define RTC_PRESENT
/* Screen dimensions */
#define SCREEN_WIDTH 128

Wyświetl plik

@ -23,10 +23,10 @@ extern "C" {
#endif
/* Device has a working real time clock */
#define HAS_RTC
#define RTC_PRESENT
/* Device supports an optional GPS chip */
#define HAS_GPS
#define GPS_PRESENT
/* Battery type */
#define BAT_LIPO_2S