From 358379fd90c78b5d0b595a1707f2f8d75cec4680 Mon Sep 17 00:00:00 2001 From: devsaurus Date: Sun, 7 Oct 2018 12:33:40 +0200 Subject: [PATCH] Updated ESP-IDF to latest. --- components/modules/Kconfig | 1 + components/modules/bthci.c | 2 +- components/modules/ledc.c | 4 ++-- components/platform/flash_api.c | 4 ++-- components/platform/platform_partition.c | 9 +++++---- sdk/esp32-esp-idf | 2 +- sdkconfig.defaults | 10 ++++++++++ 7 files changed, 22 insertions(+), 10 deletions(-) diff --git a/components/modules/Kconfig b/components/modules/Kconfig index 0ad73643..6ebe68be 100644 --- a/components/modules/Kconfig +++ b/components/modules/Kconfig @@ -64,6 +64,7 @@ config LUA_MODULE_BIT config LUA_MODULE_BTHCI bool "BlueTooth HCI interface module" default "n" + select BT_ENABLED help Includes the simple BlueTooth HCI module. diff --git a/components/modules/bthci.c b/components/modules/bthci.c index c9c0d176..8fb79687 100644 --- a/components/modules/bthci.c +++ b/components/modules/bthci.c @@ -38,7 +38,7 @@ #include "lauxlib.h" #include "task/task.h" #include "platform.h" -#include "bt.h" +#include "esp_bt.h" #include #include diff --git a/components/modules/ledc.c b/components/modules/ledc.c index 2371b2e2..55876ba2 100644 --- a/components/modules/ledc.c +++ b/components/modules/ledc.c @@ -21,8 +21,8 @@ static int lledc_new_channel( lua_State *L ) ledc_timer_config_t ledc_timer; lua_getfield(L, t, "bits"); - ledc_timer.bit_num = luaL_optint (L, -1, LEDC_TIMER_13_BIT); - if(ledc_timer.bit_num < LEDC_TIMER_10_BIT || ledc_timer.bit_num > LEDC_TIMER_15_BIT) + ledc_timer.duty_resolution = luaL_optint (L, -1, LEDC_TIMER_13_BIT); + if(ledc_timer.duty_resolution < LEDC_TIMER_10_BIT || ledc_timer.duty_resolution > LEDC_TIMER_15_BIT) return luaL_error (L, "bits field out of range"); lua_getfield(L, t, "frequency"); diff --git a/components/platform/flash_api.c b/components/platform/flash_api.c index 9d3ec536..25260746 100644 --- a/components/platform/flash_api.c +++ b/components/platform/flash_api.c @@ -12,7 +12,7 @@ #include "platform_wdt.h" #include "esp_image_format.h" -#include "esp_flash_data_types.h" +#include "esp_flash_partitions.h" #define FLASH_HDR_ADDR 0x1000 @@ -47,7 +47,7 @@ static uint32_t __attribute__((section(".iram1"))) flash_detect_size_byte(void) uint8_t data_orig[DETECT_SZ] PLATFORM_ALIGNMENT = {0}; uint8_t data_new[DETECT_SZ] PLATFORM_ALIGNMENT = {0}; // Ensure we read something which isn't just 0xff... - const uint32_t offs = ESP_PARTITION_TABLE_ADDR; + const uint32_t offs = ESP_PARTITION_TABLE_OFFSET; // Detect read failure or wrap-around on flash read to find end of flash if (ESP_OK == spi_flash_read (offs, (uint32_t *)data_orig, DETECT_SZ)) { diff --git a/components/platform/platform_partition.c b/components/platform/platform_partition.c index 10fddd30..01b71c9b 100644 --- a/components/platform/platform_partition.c +++ b/components/platform/platform_partition.c @@ -36,6 +36,7 @@ #include #include #include "esp_flash_data_types.h" +#include "esp_flash_partitions.h" #include "esp_spi_flash.h" static inline bool possible_idx (uint8_t idx) @@ -51,7 +52,7 @@ bool platform_partition_info (uint8_t idx, platform_partition_t *info) esp_partition_info_t pi; esp_err_t err = spi_flash_read ( - ESP_PARTITION_TABLE_ADDR + idx * sizeof(pi), (uint32_t *)&pi, sizeof (pi)); + ESP_PARTITION_TABLE_OFFSET + idx * sizeof(pi), (uint32_t *)&pi, sizeof (pi)); if (err != ESP_OK) return false; @@ -75,7 +76,7 @@ bool platform_partition_add (const platform_partition_t *info) if (!part_table) return false; esp_err_t err = spi_flash_read ( - ESP_PARTITION_TABLE_ADDR, (uint32_t *)part_table, SPI_FLASH_SEC_SIZE); + ESP_PARTITION_TABLE_OFFSET, (uint32_t *)part_table, SPI_FLASH_SEC_SIZE); if (err != ESP_OK) goto out; @@ -95,10 +96,10 @@ bool platform_partition_add (const platform_partition_t *info) memcpy (slot->label, info->label, sizeof (slot->label)); slot->flags = 0; err = spi_flash_erase_sector ( - ESP_PARTITION_TABLE_ADDR / SPI_FLASH_SEC_SIZE); + ESP_PARTITION_TABLE_OFFSET / SPI_FLASH_SEC_SIZE); if (err == ESP_OK) err = spi_flash_write ( - ESP_PARTITION_TABLE_ADDR, (uint32_t *)part_table, SPI_FLASH_SEC_SIZE); + ESP_PARTITION_TABLE_OFFSET, (uint32_t *)part_table, SPI_FLASH_SEC_SIZE); } out: diff --git a/sdk/esp32-esp-idf b/sdk/esp32-esp-idf index da278163..7313e39f 160000 --- a/sdk/esp32-esp-idf +++ b/sdk/esp32-esp-idf @@ -1 +1 @@ -Subproject commit da2781631455b2c87c01704503f70443799a5187 +Subproject commit 7313e39fde0eb0a47a60f31adccd602c82a8d5ad diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 8878e7f9..dfecd6ba 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -21,3 +21,13 @@ CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED=y # Enable panic handler for task wdt to reset the firmware upon wdt timeout CONFIG_TASK_WDT_PANIC=y + +# Disable the MQTT client from esp-idf, we have our own implementation atm +CONFIG_MQTT_PROTOCOL_311=n +CONFIG_MQTT_TRANSPORT_SSL=n +CONFIG_MQTT_TRANSPORT_WEBSOCKET=n +CONFIG_MQTT_USE_CUSTOM_CONFIG=n + +# Disable esp-idf's bluetooth component by default. +# The bthci module is also disabled and will enable bt when selected +CONFIG_BT_ENABLED=n