Merge pull request #48 from FintasticMan/no_blue_light_when_connected

Don't flash blue LED when connected to bluetooth
This commit is contained in:
Ben V. Brown 2023-05-20 15:06:49 +10:00 committed by GitHub
commit 53f77ed9d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 5 deletions

View File

@ -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/<custom_sounds>/` directory and building with `AUDIO=<custom_sounds> ./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.

View File

@ -173,6 +173,18 @@ 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;
cfg0.startlevel = 0;
cfg0.periodic = false;
app_pwl_setup(APP_PWL_ID_0, &cfg0);
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;
@ -192,6 +204,7 @@ int app_status_indication_set(APP_STATUS_INDICATION_T status) {
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;

View File

@ -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
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^