mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 04:57:06 +03:00
tweaks
This commit is contained in:
@@ -509,11 +509,8 @@ static esp_err_t actrls_init_json(const char *profile_name, bool create) {
|
|||||||
const cJSON *button;
|
const cJSON *button;
|
||||||
|
|
||||||
if (!profile_name) return ESP_OK;
|
if (!profile_name) return ESP_OK;
|
||||||
|
if ((config = config_alloc_get_str(profile_name, NULL, CONFIG_AUDIO_CONTROLS)) == NULL) return ESP_FAIL;
|
||||||
config = config_alloc_get_str(profile_name, NULL, CONFIG_AUDIO_CONTROLS);
|
if (!*config) goto exit;
|
||||||
|
|
||||||
if (!config) return ESP_FAIL;
|
|
||||||
else if (!*config) return ESP_OK;
|
|
||||||
|
|
||||||
ESP_LOGD(TAG,"Parsing JSON structure %s", config);
|
ESP_LOGD(TAG,"Parsing JSON structure %s", config);
|
||||||
cJSON *buttons = cJSON_Parse(config);
|
cJSON *buttons = cJSON_Parse(config);
|
||||||
@@ -528,8 +525,8 @@ static esp_err_t actrls_init_json(const char *profile_name, bool create) {
|
|||||||
if(!cur_config) {
|
if(!cur_config) {
|
||||||
ESP_LOGE(TAG,"Config buffer was empty. ");
|
ESP_LOGE(TAG,"Config buffer was empty. ");
|
||||||
cJSON_Delete(buttons);
|
cJSON_Delete(buttons);
|
||||||
free(config);
|
err = ESP_FAIL;
|
||||||
return ESP_FAIL;
|
goto exit;
|
||||||
}
|
}
|
||||||
ESP_LOGD(TAG,"Processing button definitions. ");
|
ESP_LOGD(TAG,"Processing button definitions. ");
|
||||||
cJSON_ArrayForEach(button, buttons){
|
cJSON_ArrayForEach(button, buttons){
|
||||||
@@ -560,6 +557,7 @@ static esp_err_t actrls_init_json(const char *profile_name, bool create) {
|
|||||||
// the last init that completes will assigh the first json config object found, which will match
|
// the last init that completes will assigh the first json config object found, which will match
|
||||||
// the default config from nvs.
|
// the default config from nvs.
|
||||||
json_config = config_root;
|
json_config = config_root;
|
||||||
|
exit:
|
||||||
free(config);
|
free(config);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ static __inline Word64 xSAR64(Word64 x, int n)
|
|||||||
}
|
}
|
||||||
//mw
|
//mw
|
||||||
|
|
||||||
#elif defined(__APPLE__) || defined(ESP_PLATFORM) || defined(__x86_64__)
|
#elif defined(__APPLE__) || defined(ESP_PLATFORM) || defined(__amd64__)
|
||||||
|
|
||||||
static __inline int FASTABS(int x)
|
static __inline int FASTABS(int x)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -67,7 +67,9 @@
|
|||||||
#
|
#
|
||||||
#elif defined(__GNUC__) && defined(__thumb__)
|
#elif defined(__GNUC__) && defined(__thumb__)
|
||||||
#
|
#
|
||||||
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
#elif defined(__GNUC__) && defined(__i386__)
|
||||||
|
#
|
||||||
|
#elif defined(__amd64__)
|
||||||
#
|
#
|
||||||
#elif defined(_OPENWAVE_SIMULATOR) || defined(_OPENWAVE_ARMULATOR)
|
#elif defined(_OPENWAVE_SIMULATOR) || defined(_OPENWAVE_ARMULATOR)
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ static void battery_svc(float value);
|
|||||||
static bool init(void);
|
static bool init(void);
|
||||||
static void set_battery_led(float value);
|
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) {
|
static bool init(void) {
|
||||||
battery_handler_chain = battery_handler_svc;
|
battery_handler_chain = battery_handler_svc;
|
||||||
|
|||||||
Reference in New Issue
Block a user