From 0f7de058b483ada42ffdcfb53c2f74c540a75622 Mon Sep 17 00:00:00 2001 From: sharandac Date: Thu, 7 Oct 2021 21:19:06 +0200 Subject: [PATCH] fix no bluetooth define --- src/config.h | 5 +++++ src/gui/gui.cpp | 12 ++++++++---- src/hardware/hardware.cpp | 11 ++++++----- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/config.h b/src/config.h index 53524620f..e17a53be9 100644 --- a/src/config.h +++ b/src/config.h @@ -59,18 +59,23 @@ #define RES_Y_MAX 240 #define ONLY_ESSENTIAL #define ROUND_DISPLAY + #define NO_BLUETOOTH + #define NO_WATCHFACE + #define NO_UPDATES #elif defined( M5PAPER ) #define HARDWARE_NAME "m5stack-fire" #define RES_X_MAX 540 #define RES_Y_MAX 960 #define ENABLE_WEBSERVER /** @brief To disable built-in webserver, comment this line */ #define ENABLE_FTPSERVER /** @brief To disable built-in ftpserver, comment this line */ + #define NO_WATCHFACE #elif defined( M5CORE2 ) #define HARDWARE_NAME "m5stack-core2" #define RES_X_MAX 320 #define RES_Y_MAX 240 #define ENABLE_WEBSERVER /** @brief To disable built-in webserver, comment this line */ #define ENABLE_FTPSERVER /** @brief To disable built-in ftpserver, comment this line */ + #define NO_BLUETOOTH #else #error "no destination hardware version defined" #endif diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index b1857b633..80d8ebf39 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -124,17 +124,21 @@ void gui_setup( void ) { gps_settings_tile_setup(); utilities_tile_setup(); sound_settings_tile_setup(); - #if defined( M5CORE2 ) || defined( LILYGO_WATCH_2021 ) - log_i("bluetooth and watchface disabled"); - #else - bluetooth_settings_tile_setup(); + #ifndef NO_UPDATES update_tile_setup(); + #endif + #ifndef NO_BLUETOOTH + bluetooth_settings_tile_setup(); + #endif + #ifndef NO_WATCHFACE watchface_manager_setup(); watchface_expr_setup(); #endif + #if defined( LILYGO_WATCH_HAS_SDCARD ) sdcard_settings_tile_setup(); #endif + /* * trigger an activity */ diff --git a/src/hardware/hardware.cpp b/src/hardware/hardware.cpp index 918004525..aa3442845 100644 --- a/src/hardware/hardware.cpp +++ b/src/hardware/hardware.cpp @@ -221,10 +221,13 @@ void hardware_setup( void ) { rtcctl_setup(); timesync_setup(); sensor_setup(); - blectl_read_config(); sound_read_config(); fakegps_setup(); + #ifndef NO_BLUETOOTH + blectl_read_config(); + #endif + splash_screen_stage_update( "init gui", 80 ); splash_screen_stage_finish(); @@ -250,10 +253,8 @@ void hardware_post_setup( void ) { sound_setup(); gpsctl_setup(); powermgm_set_event( POWERMGM_WAKEUP ); - - #if defined( M5CORE2 ) || defined( LILYGO_WATCH_2021 ) - log_i("Bluetooth disabled"); - #else + + #ifndef NO_BLUETOOTH blectl_setup(); #endif