diff --git a/openrtx/include/core/ui.h b/openrtx/include/core/ui.h index 1d6fcb8c..f122c080 100644 --- a/openrtx/include/core/ui.h +++ b/openrtx/include/core/ui.h @@ -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]; diff --git a/openrtx/src/core/state.c b/openrtx/src/core/state.c index 6c0602b1..53e9e5b5 100644 --- a/openrtx/src/core/state.c +++ b/openrtx/src/core/state.c @@ -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 } diff --git a/openrtx/src/core/threads.c b/openrtx/src/core/threads.c index e1796712..a1171d37 100644 --- a/openrtx/src/core/threads.c +++ b/openrtx/src/core/threads.c @@ -36,7 +36,7 @@ #include #include #include -#ifdef HAS_GPS +#ifdef GPS_PRESENT #include #include #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; diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index 645f2c55..6b4946b5 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -68,7 +68,7 @@ #include #include #include -#ifdef HAS_GPS +#ifdef GPS_PRESENT #include #endif #include @@ -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); diff --git a/openrtx/src/ui/ui_main.c b/openrtx/src/ui/ui_main.c index 62c53f7d..81a0f73a 100644 --- a/openrtx/src/ui/ui_main.c +++ b/openrtx/src/ui/ui_main.c @@ -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); diff --git a/openrtx/src/ui/ui_menu.c b/openrtx/src/ui/ui_menu.c index 8c8a2ef4..2ac42f79 100644 --- a/openrtx/src/ui/ui_menu.c +++ b/openrtx/src/ui/ui_menu.c @@ -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(); diff --git a/platform/targets/MD-3x0/hwconfig.h b/platform/targets/MD-3x0/hwconfig.h index 5ff812e6..290356e4 100644 --- a/platform/targets/MD-3x0/hwconfig.h +++ b/platform/targets/MD-3x0/hwconfig.h @@ -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 diff --git a/platform/targets/MD-9600/hwconfig.h b/platform/targets/MD-9600/hwconfig.h index 26620252..4dfbe643 100644 --- a/platform/targets/MD-9600/hwconfig.h +++ b/platform/targets/MD-9600/hwconfig.h @@ -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 diff --git a/platform/targets/MD-UV3x0/hwconfig.h b/platform/targets/MD-UV3x0/hwconfig.h index a9ca5b60..cdad860e 100644 --- a/platform/targets/MD-UV3x0/hwconfig.h +++ b/platform/targets/MD-UV3x0/hwconfig.h @@ -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 diff --git a/platform/targets/Module17/hwconfig.h b/platform/targets/Module17/hwconfig.h index 26ad7b34..135c06fd 100644 --- a/platform/targets/Module17/hwconfig.h +++ b/platform/targets/Module17/hwconfig.h @@ -25,7 +25,7 @@ #include /* Device has a working real time clock */ -#define HAS_RTC +#define RTC_PRESENT /* Screen dimensions */ #define SCREEN_WIDTH 128 diff --git a/platform/targets/linux/hwconfig.h b/platform/targets/linux/hwconfig.h index a5558160..e6f0ff4d 100644 --- a/platform/targets/linux/hwconfig.h +++ b/platform/targets/linux/hwconfig.h @@ -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