From 29737f720e89a3758ced4ee530f7b3c817e8e853 Mon Sep 17 00:00:00 2001 From: Sebastien Date: Fri, 17 Apr 2020 14:18:39 -0400 Subject: [PATCH] merge Equalizer - release --- components/audio/CMakeLists.txt | 5 +++++ components/audio/link_helper.c | 3 +++ components/platform_console/cmd_i2ctools.c | 21 ++++++++----------- .../platform_console/platform_console.c | 2 +- components/squeezelite/CMakeLists.txt | 1 + components/wifi-manager/code.js | 14 +++++++++++++ 6 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 components/audio/CMakeLists.txt create mode 100644 components/audio/link_helper.c diff --git a/components/audio/CMakeLists.txt b/components/audio/CMakeLists.txt new file mode 100644 index 00000000..e636f198 --- /dev/null +++ b/components/audio/CMakeLists.txt @@ -0,0 +1,5 @@ +idf_component_register( SRC_DIRS . + INCLUDE_DIRS . inc + ) +add_prebuilt_library(esp_processing lib/libesp_processing.a) +target_link_libraries(${COMPONENT_LIB} PRIVATE esp_processing) diff --git a/components/audio/link_helper.c b/components/audio/link_helper.c new file mode 100644 index 00000000..1a3df177 --- /dev/null +++ b/components/audio/link_helper.c @@ -0,0 +1,3 @@ +void dummy_obj() { + return; +} diff --git a/components/platform_console/cmd_i2ctools.c b/components/platform_console/cmd_i2ctools.c index dacfed2d..14544dcc 100644 --- a/components/platform_console/cmd_i2ctools.c +++ b/components/platform_console/cmd_i2ctools.c @@ -383,9 +383,6 @@ static int do_i2c_set_display(int argc, char **argv) return 0; } - - - /* Check "--address" option */ if (i2cdisp_args.address->count) { address=i2cdisp_args.address->ival[0]; @@ -778,10 +775,10 @@ static void register_i2c_set_display(){ i2cdisp_args.height = arg_int0("h", "height", "", "Set the display height"); i2cdisp_args.name = arg_str0("t", "type", "", "Set the display type. default I2C"); i2cdisp_args.driver = arg_str0("d", "driver", "", "Set the display driver name. Default SSD1306"); - i2cdisp_args.clear = arg_litn(NULL, "clear", 0, 1, "clear configuration and return"); - i2cdisp_args.hflip = arg_litn(NULL, "hf", 0, 1, "Flip picture horizontally"); - i2cdisp_args.vflip = arg_litn(NULL, "vf", 0, 1, "Flip picture vertically"); - i2cdisp_args.rotate = arg_litn("r", "rotate", 0, 1, "Rotate the picture 180 deg"); + i2cdisp_args.clear = arg_lit0(NULL, "clear", "clear configuration and return"); + i2cdisp_args.hflip = arg_lit0(NULL, "hf", "Flip picture horizontally"); + i2cdisp_args.vflip = arg_lit0(NULL, "vf", "Flip picture vertically"); + i2cdisp_args.rotate = arg_lit0("r", "rotate", "Rotate the picture 180 deg"); i2cdisp_args.end = arg_end(8); const esp_console_cmd_t i2c_set_display= { .command = "setdisplay", @@ -903,11 +900,11 @@ static void register_i2cstop(){ static void register_i2cconfig(void) { - i2cconfig_args.port = arg_int0("p", "port", "<0|1>", "Set the I2C bus port number"); - i2cconfig_args.freq = arg_int0("f", "freq", "", "Set the frequency(Hz) of I2C bus. e.g. 100000"); - i2cconfig_args.sda = arg_int0("d", "sda", "", "Set the gpio for I2C SDA. e.g. 19"); - i2cconfig_args.scl = arg_int0("c", "scl", "", "Set the gpio for I2C SCL. e.g. 18"); - i2cconfig_args.load = arg_litn("l", "load", 0, 1, "load existing configuration and return"); + i2cconfig_args.port = arg_int0("p", "port", "0|1", "Set the I2C bus port number"); + i2cconfig_args.freq = arg_int0("f", "freq", "int", "Set the frequency(Hz) of I2C bus. e.g. 100000"); + i2cconfig_args.sda = arg_int0("d", "sda", "int", "Set the gpio for I2C SDA. e.g. 19"); + i2cconfig_args.scl = arg_int0("c", "scl", "int", "Set the gpio for I2C SCL. e.g. 18"); + i2cconfig_args.load = arg_lit0("l", "load", "load existing configuration and return"); i2cconfig_args.end = arg_end(4); const esp_console_cmd_t i2cconfig_cmd = { .command = "i2cconfig", diff --git a/components/platform_console/platform_console.c b/components/platform_console/platform_console.c index 7d9931a8..ed5fe125 100644 --- a/components/platform_console/platform_console.c +++ b/components/platform_console/platform_console.c @@ -71,7 +71,7 @@ cJSON * ParmsToJSON(struct arg_hdr * * argtable){ ADD_TO_JSON(entry,table[tabindex],glossary); ADD_TO_JSON(entry,table[tabindex],longopts); ADD_TO_JSON(entry,table[tabindex],shortopts); - cJSON_AddBoolToObject(entry, "isoptional", table[tabindex]->flag & ARG_HASOPTVALUE); + cJSON_AddBoolToObject(entry, "checkbox", (table[tabindex]->flag & ARG_HASOPTVALUE)==0 && (table[tabindex]->flag & ARG_HASVALUE)==0); cJSON_AddBoolToObject(entry, "hasvalue", table[tabindex]->flag & ARG_HASVALUE); cJSON_AddItemToArray(arg_list, entry); tabindex++; diff --git a/components/squeezelite/CMakeLists.txt b/components/squeezelite/CMakeLists.txt index cd70f6cb..cc61e71f 100644 --- a/components/squeezelite/CMakeLists.txt +++ b/components/squeezelite/CMakeLists.txt @@ -13,6 +13,7 @@ idf_component_register( SRC_DIRS . external a1s tas57xx raop display tools + audio EMBED_FILES vu.data ) diff --git a/components/wifi-manager/code.js b/components/wifi-manager/code.js index 6b54a4f4..3d736245 100644 --- a/components/wifi-manager/code.js +++ b/components/wifi-manager/code.js @@ -539,6 +539,7 @@ $(document).ready(function(){ //first time the page loads: attempt to get the connection status and start the wifi scan refreshAP(false); getConfig(); + getCommands(); //start timers startCheckStatusInterval(); @@ -894,6 +895,19 @@ function checkStatus(){ }); } + +function getCommands() { + $.getJSON("/commands.json", function(data) { + console.log(data); + }) + .fail(function(xhr, ajaxOptions, thrownError) { + console.log(xhr.status); + console.log(thrownError); + if (thrownError != '') showMessage(thrownError, 'MESSAGING_ERROR'); + blockAjax = false; + }); +} + function getConfig() { $.getJSON("/config.json", function(data) { Object.keys(data).sort().forEach(function(key, i) {