Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions components/services/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ void monitor_svc_init(void) {
// re-use button management for jack handler, it's a GPIO after all
if (jack.gpio != -1) {
ESP_LOGI(TAG,"Adding jack (%s) detection GPIO %d", jack.active ? "high" : "low", jack.gpio);
button_create(NULL, jack.gpio, jack.active ? BUTTON_HIGH : BUTTON_LOW, false, 250, jack_handler_default, 0, -1);
// Use GPIO pull so the line does not float (Muse jack detect is active-low and needs pull-up)
button_create(NULL, jack.gpio, jack.active ? BUTTON_HIGH : BUTTON_LOW, true, 250, jack_handler_default, 0, -1);
}

#ifdef CONFIG_SPKFAULT_GPIO_LEVEL
Expand Down Expand Up @@ -297,4 +298,4 @@ void monitor_svc_init(void) {
*/
monitor_gpio_t * get_jack_insertion_gpio(){
return &jack;
}
}
7 changes: 4 additions & 3 deletions main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ menu "Squeezelite-ESP32"
config DAC_CONTROLSET
string
default "{ \"init\": [ {\"reg\":41, \"val\":128}, {\"reg\":18, \"val\":255} ], \"poweron\": [ {\"reg\":18, \"val\":64, \"mode\":\"or\"} ], \"poweroff\": [ {\"reg\":18, \"val\":191, \"mode\":\"and\"} ] }" if TWATCH2020
default "{\"init\":[ {\"reg\":0,\"val\":128}, {\"reg\":0,\"val\":0}, {\"reg\":25,\"val\":4}, {\"reg\":1,\"val\":80}, {\"reg\":2,\"val\":0}, {\"reg\":8,\"val\":0}, {\"reg\":4,\"val\":192}, {\"reg\":0,\"val\":18}, {\"reg\":1,\"val\":0}, {\"reg\":23,\"val\":24}, {\"reg\":24,\"val\":2}, {\"reg\":38,\"val\":9}, {\"reg\":39,\"val\":144}, {\"reg\":42,\"val\":144}, {\"reg\":43,\"val\":128}, {\"reg\":45,\"val\":128}, {\"reg\":27,\"val\":0}, {\"reg\":26,\"val\":0}, {\"reg\":2,\"val\":240}, {\"reg\":2,\"val\":0}, {\"reg\":29,\"val\":28}, {\"reg\":4,\"val\":48}, {\"reg\":25,\"val\":0}, {\"reg\":46,\"val\":33}, {\"reg\":47,\"val\":33} ]}" if MUSE
default "{\"init\":[ {\"reg\":0,\"val\":128}, {\"reg\":0,\"val\":0}, {\"reg\":25,\"val\":4}, {\"reg\":1,\"val\":80}, {\"reg\":2,\"val\":0}, {\"reg\":8,\"val\":0}, {\"reg\":4,\"val\":192}, {\"reg\":0,\"val\":18}, {\"reg\":1,\"val\":0}, {\"reg\":23,\"val\":24}, {\"reg\":24,\"val\":2}, {\"reg\":38,\"val\":9}, {\"reg\":39,\"val\":144}, {\"reg\":42,\"val\":144}, {\"reg\":43,\"val\":128}, {\"reg\":45,\"val\":128}, {\"reg\":27,\"val\":0}, {\"reg\":26,\"val\":0}, {\"reg\":2,\"val\":240}, {\"reg\":2,\"val\":0}, {\"reg\":29,\"val\":28}, {\"reg\":4,\"val\":60}, {\"reg\":25,\"val\":0}, {\"reg\":46,\"val\":33}, {\"reg\":47,\"val\":33} , {\"reg\":48,\"val\":33}, {\"reg\":49,\"val\":33}]}" if MUSE

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This long line of configuration is difficult to read and maintain. For better readability and to make future changes easier to review, please consider reformatting it to span multiple lines using line continuations. I've also noticed and fixed some inconsistent spacing (extra space before a comma, and tabs) in the suggested change.

Using a multi-line format for long strings is a common practice in Kconfig files and greatly improves code clarity.

			default "{\"init\":[{\"reg\":0,\"val\":128}, {\"reg\":0,\"val\":0}, {\"reg\":25,\"val\":4}, {\"reg\":1,\"val\":80}, {\"reg\":2,\"val\":0}, " \
			        "{\"reg\":8,\"val\":0}, {\"reg\":4,\"val\":192}, {\"reg\":0,\"val\":18}, {\"reg\":1,\"val\":0}, {\"reg\":23,\"val\":24}, " \
			        "{\"reg\":24,\"val\":2}, {\"reg\":38,\"val\":9}, {\"reg\":39,\"val\":144}, {\"reg\":42,\"val\":144}, {\"reg\":43,\"val\":128}, " \
			        "{\"reg\":45,\"val\":128}, {\"reg\":27,\"val\":0}, {\"reg\":26,\"val\":0}, {\"reg\":2,\"val\":240}, {\"reg\":2,\"val\":0}, " \
			        "{\"reg\":29,\"val\":28}, {\"reg\":4,\"val\":60}, {\"reg\":25,\"val\":0}, {\"reg\":46,\"val\":33}, {\"reg\":47,\"val\":33}, " \
			        "{\"reg\":48,\"val\":33}, {\"reg\":49,\"val\":33}]}" if MUSE

default ""
config AUDIO_CONTROLS
string
Expand All @@ -153,7 +153,8 @@ menu "Squeezelite-ESP32"
default -1
config JACK_GPIO
int
default 34 if SQUEEZEAMP || MUSE
default 27 if MUSE
default 34 if SQUEEZEAMP
default -1
config SPKFAULT_GPIO
int
Expand Down Expand Up @@ -463,4 +464,4 @@ menu "Squeezelite-ESP32"
default "squeezelite -o I2S -b 500:2000 -d all=info -C 30"
help
This is the command to run when starting the device
endmenu
endmenu