mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-12 22:47:15 +03:00
proper handling of target config between NVS and dedicated - release
This commit is contained in:
@@ -48,7 +48,7 @@ static void battery_svc(float value);
|
||||
static bool init(void);
|
||||
static void set_battery_led(float value);
|
||||
|
||||
const struct target_s target_muse = { "muse", init };
|
||||
const struct target_s target_muse = { .model = "muse", .init = init };
|
||||
|
||||
static bool init(void) {
|
||||
battery_handler_chain = battery_handler_svc;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
const struct target_s *target_set[] = { &target_muse, NULL };
|
||||
|
||||
void target_init(char *target) {
|
||||
for (int i = 0; target_set[i]; i++) if (strcasestr(target_set[i]->model, target)) {
|
||||
for (int i = 0; *target && target_set[i]; i++) if (strcasestr(target_set[i]->model, target)) {
|
||||
target_set[i]->init();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user