From 0b58ae6cb2baa594e42e7bc61531300b9341b134 Mon Sep 17 00:00:00 2001 From: Finlay Davidson Date: Sun, 19 Feb 2023 19:48:11 +0100 Subject: [PATCH 1/3] Don't flash blue LED when connected to bluetooth --- config/_default_cfg_src_/app_status_ind.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/config/_default_cfg_src_/app_status_ind.c b/config/_default_cfg_src_/app_status_ind.c index 6b6d2e2..fd7c97d 100644 --- a/config/_default_cfg_src_/app_status_ind.c +++ b/config/_default_cfg_src_/app_status_ind.c @@ -173,24 +173,15 @@ int app_status_indication_set(APP_STATUS_INDICATION_T status) { app_pwl_start(APP_PWL_ID_1); break; case APP_STATUS_INDICATION_CONNECTED: - cfg0.part[0].level = 1; + cfg0.part[0].level = 0; cfg0.part[0].time = (500); - cfg0.part[1].level = 0; - cfg0.part[1].time = (3000); - cfg0.parttotal = 2; - cfg0.startlevel = 1; - cfg0.periodic = true; + cfg0.parttotal = 1; + cfg0.startlevel = 0; + cfg0.periodic = false; - 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_setup(APP_PWL_ID_1, &cfg0); app_pwl_start(APP_PWL_ID_1); break; case APP_STATUS_INDICATION_CHARGING: From e5d98d072ff0d39b1148b08247ba0bdee13745d3 Mon Sep 17 00:00:00 2001 From: Finlay Davidson Date: Mon, 20 Feb 2023 11:30:10 +0100 Subject: [PATCH 2/3] 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 # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 380da2a74d824e1fa8795adce7622d614e8a0419 Mon Sep 17 00:00:00 2001 From: Finlay Davidson Date: Wed, 1 Mar 2023 01:13:35 +0100 Subject: [PATCH 3/3] Add note in README about blue LED when connected --- README.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7dcf95f..53371cb 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,8 @@ bestool write-image out/open_source/open_source.bin --port /dev/ttyACM1 - Quad tap : Volume Down ## Changing audio alerts -The default audio alerts are stored in: + +The default audio alerts are stored in: `config/_default_cfg_src_/res/en/` @@ -82,9 +83,15 @@ name (ie `config/_default_cfg_src_/res/en/SOUND_POWER_ON.mp3`) and recompile wit ### Language support The `AUDIO` environment variable can be set when running the `build.sh` script to load sound files -for languages other than the default English. For example, running `AUDIO=cn ./build.sh` will load sounds files from -`config/_default_cfg_src_/res/cn/` instead of the default `en/` folder. +for languages other than the default English. For example, running `AUDIO=cn ./build.sh` will load sounds files from +`config/_default_cfg_src_/res/cn/` instead of the default `en/` folder. -The current languages supported with sound files are English (`en`) and Chinese (`cn`). Other languages -(or other sets of custom sounds) may be added by adding all the correct sound files into a +The current languages supported with sound files are English (`en`) and Chinese (`cn`). Other languages +(or other sets of custom sounds) may be added by adding all the correct sound files into a `config/_default_cfg_src_/res//` directory and building with `AUDIO= ./build.sh`. + +### Blue light when connected + +The firmware can be configured to either have a blinking blue light when connected or not. +Build with `CONNECTED_BLUE_LIGHT=1 ./build.sh` to enable blinking when connected, +or `CONNECTED_BLUE_LIGHT=0 ./build.sh` (or just the default `./build.sh`) to keep the LEDs off when connected.