From e5d98d072ff0d39b1148b08247ba0bdee13745d3 Mon Sep 17 00:00:00 2001 From: Finlay Davidson Date: Mon, 20 Feb 2023 11:30:10 +0100 Subject: [PATCH] Add compile option for blue light when connected --- config/_default_cfg_src_/app_status_ind.c | 22 ++++++++++++++++++++++ config/common.mk | 7 +++++++ 2 files changed, 29 insertions(+) diff --git a/config/_default_cfg_src_/app_status_ind.c b/config/_default_cfg_src_/app_status_ind.c index fd7c97d..96b1e3b 100644 --- a/config/_default_cfg_src_/app_status_ind.c +++ b/config/_default_cfg_src_/app_status_ind.c @@ -173,6 +173,7 @@ int app_status_indication_set(APP_STATUS_INDICATION_T status) { app_pwl_start(APP_PWL_ID_1); break; case APP_STATUS_INDICATION_CONNECTED: +#ifdef DISABLE_CONNECTED_BLUE_LIGHT cfg0.part[0].level = 0; cfg0.part[0].time = (500); cfg0.parttotal = 1; @@ -183,6 +184,27 @@ int app_status_indication_set(APP_STATUS_INDICATION_T status) { app_pwl_start(APP_PWL_ID_0); app_pwl_setup(APP_PWL_ID_1, &cfg0); app_pwl_start(APP_PWL_ID_1); +#else + cfg0.part[0].level = 1; + cfg0.part[0].time = (500); + cfg0.part[1].level = 0; + cfg0.part[1].time = (3000); + cfg0.parttotal = 2; + cfg0.startlevel = 1; + cfg0.periodic = true; + + cfg1.part[0].level = 0; + cfg1.part[0].time = (500); + cfg1.part[1].level = 0; + cfg1.part[1].time = (3000); + cfg1.parttotal = 2; + cfg1.startlevel = 0; + cfg1.periodic = true; + app_pwl_setup(APP_PWL_ID_0, &cfg0); + app_pwl_start(APP_PWL_ID_0); + app_pwl_setup(APP_PWL_ID_1, &cfg1); + app_pwl_start(APP_PWL_ID_1); +#endif break; case APP_STATUS_INDICATION_CHARGING: cfg1.part[0].level = 1; diff --git a/config/common.mk b/config/common.mk index 85a60eb..07545f2 100644 --- a/config/common.mk +++ b/config/common.mk @@ -87,6 +87,9 @@ export VOICE_DETECTOR_EN ?= 0 # 1 to use 8K sample rate for VAD, 0 to use 16K sample rate for VAD VAD_USE_8K_SAMPLE_RATE ?= 0 +# 1 to enable the blue flashing light when connected, 0 to disable +CONNECTED_BLUE_LIGHT ?= 0 + # ------------------------------------------- # Root Option Dependencies # ------------------------------------------- @@ -190,6 +193,10 @@ export BT_APP ?= 1 FULL_APP_PROJECT ?= 1 endif +ifeq ($(strip $(CONNECTED_BLUE_LIGHT)),0) +KBUILD_CPPFLAGS += -DDISABLE_CONNECTED_BLUE_LIGHT +endif + # vvvvvvvvvvvvvvvvvvvvvvvvvvvvv # OTA features # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^