mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 20:47:08 +03:00
formating changes
This commit is contained in:
@@ -72,7 +72,13 @@ static void battery_svc(float value, int cells) {
|
|||||||
if (battery_handler_chain) battery_handler_chain(value, cells);
|
if (battery_handler_chain) battery_handler_chain(value, cells);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void led_vu_sleep(void) { led_vu_clear(led_display); }
|
/****************************************************************************************
|
||||||
|
* Suspend.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static void led_vu_sleep(void) {
|
||||||
|
led_vu_clear(led_display);
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* Initialize the led vu strip if configured.
|
* Initialize the led vu strip if configured.
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ static struct {
|
|||||||
struct arg_str *type;
|
struct arg_str *type;
|
||||||
struct arg_int *length;
|
struct arg_int *length;
|
||||||
struct arg_int *gpio;
|
struct arg_int *gpio;
|
||||||
struct arg_int * scale;
|
struct arg_int * scale;
|
||||||
struct arg_lit *clear;
|
struct arg_lit *clear;
|
||||||
struct arg_end *end;
|
struct arg_end *end;
|
||||||
} ledvu_args;
|
} ledvu_args;
|
||||||
@@ -686,7 +686,7 @@ static int do_ledvu_cmd(int argc, char **argv) {
|
|||||||
} else {
|
} else {
|
||||||
ledvu.length = ledvu_args.length->count > 0 ? ledvu_args.length->ival[0] : 0;
|
ledvu.length = ledvu_args.length->count > 0 ? ledvu_args.length->ival[0] : 0;
|
||||||
}
|
}
|
||||||
ledvu.scale = ledvu_args.scale->count>0?ledvu_args.scale->ival[0]:ledvu.scale;
|
ledvu.scale = ledvu_args.scale->count>0?ledvu_args.scale->ival[0]:ledvu.scale;
|
||||||
|
|
||||||
|
|
||||||
if (!nerrors) {
|
if (!nerrors) {
|
||||||
@@ -1318,7 +1318,7 @@ void register_ledvu_config(void) {
|
|||||||
ledvu_args.type = arg_str1(NULL, "type", "<none>|WS2812", "Led type (supports one rgb strip to display built in effects and allow remote control through 'dmx' messaging)");
|
ledvu_args.type = arg_str1(NULL, "type", "<none>|WS2812", "Led type (supports one rgb strip to display built in effects and allow remote control through 'dmx' messaging)");
|
||||||
ledvu_args.length = arg_int1(NULL, "length", "<1..255>", "Strip length (1-255 supported)");
|
ledvu_args.length = arg_int1(NULL, "length", "<1..255>", "Strip length (1-255 supported)");
|
||||||
ledvu_args.gpio = arg_int1(NULL, "gpio", "gpio", "Data pin");
|
ledvu_args.gpio = arg_int1(NULL, "gpio", "gpio", "Data pin");
|
||||||
ledvu_args.scale = arg_int0(NULL,"scale","<n>","Gain scale (precent)");
|
ledvu_args.scale = arg_int0(NULL,"scale","<n>","Gain scale (precent)");
|
||||||
ledvu_args.clear = arg_lit0(NULL, "clear", "Clear configuration");
|
ledvu_args.clear = arg_lit0(NULL, "clear", "Clear configuration");
|
||||||
ledvu_args.end = arg_end(4);
|
ledvu_args.end = arg_end(4);
|
||||||
|
|
||||||
|
|||||||
@@ -1277,9 +1277,9 @@ static void ledv_handler( u8_t *data, int len) {
|
|||||||
led_visu.mode = pkt->which;
|
led_visu.mode = pkt->which;
|
||||||
led_visu.style = pkt->style;
|
led_visu.style = pkt->style;
|
||||||
led_visu.max = pkt->bright;
|
led_visu.max = pkt->bright;
|
||||||
led_visu.gain = led_visu.max * led_vu_scale() / 100;
|
led_visu.gain = led_visu.max * led_vu_scale() / 100;
|
||||||
|
|
||||||
if (led_visu.mode) {
|
if (led_visu.mode) {
|
||||||
if (led_visu.mode == VISU_SPECTRUM) {
|
if (led_visu.mode == VISU_SPECTRUM) {
|
||||||
led_visu.n = (led_visu.config < MAX_BARS) ? led_visu.config : MAX_BARS;
|
led_visu.n = (led_visu.config < MAX_BARS) ? led_visu.config : MAX_BARS;
|
||||||
spectrum_limits(led_visu.bars, 0, led_visu.n, 0, 0.25);
|
spectrum_limits(led_visu.bars, 0, led_visu.n, 0, 0.25);
|
||||||
@@ -1295,7 +1295,7 @@ led_visu.gain = led_visu.max * led_vu_scale() / 100;
|
|||||||
|
|
||||||
LOG_INFO("LED Visualizer mode %u with bars:%u max:%u style:%d gain:%u", led_visu.mode, led_visu.n, led_visu.max, led_visu.style, led_visu.gain);
|
LOG_INFO("LED Visualizer mode %u with bars:%u max:%u style:%d gain:%u", led_visu.mode, led_visu.n, led_visu.max, led_visu.style, led_visu.gain);
|
||||||
} else {
|
} else {
|
||||||
led_vu_clear();
|
led_vu_clear();
|
||||||
|
|
||||||
LOG_INFO("Stopping led visualizer");
|
LOG_INFO("Stopping led visualizer");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user