Skip to content

Commit

Permalink
fix no bluetooth define
Browse files Browse the repository at this point in the history
  • Loading branch information
sharandac committed Oct 7, 2021
1 parent f7e585e commit 0f7de05
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
5 changes: 5 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions src/gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
11 changes: 6 additions & 5 deletions src/hardware/hardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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

Expand Down

0 comments on commit 0f7de05

Please sign in to comment.