Skip to content

Commit

Permalink
Merge branch 'bugfix/idf_dep' into 'master'
Browse files Browse the repository at this point in the history
Minor fixes for compilation with various versions of esp idf

See merge request app-frameworks/esp-homekit-sdk!21
  • Loading branch information
shahpiyushv committed Jun 1, 2022
2 parents 09af637 + 8d2f35d commit 0a0ebf6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ build_homekit_examples:
script:
- git submodule update --init --recursive
# Cloning esp-idf
- git clone --recursive --branch ${IDF_GIT_BRANCH} --depth 1 ${IDF_GIT_PATH}/esp-idf.git
- git clone --recursive --single-branch --branch ${IDF_GIT_BRANCH} --depth 1 ${IDF_GIT_PATH}/esp-idf.git
- cd esp-idf
- ./install.sh
- . export.sh
Expand Down
2 changes: 1 addition & 1 deletion components/homekit/esp_hap_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ idf_component_register(SRCS ${srcs}
INCLUDE_DIRS "include"
PRIV_INCLUDE_DIRS ${priv_includes}
REQUIRES
PRIV_REQUIRES libsodium esp_http_server hkdf-sha mu_srp json_generator json_parser esp_hap_platform esp_hap_apple_profiles mdns)
PRIV_REQUIRES libsodium esp_http_server hkdf-sha mu_srp json_generator json_parser esp_hap_platform esp_hap_apple_profiles mdns esp_timer)
component_compile_options(-Wno-unused-function)
target_compile_definitions(${COMPONENT_TARGET} PRIVATE "-D MFI_VER=\"${MFI_VER}\"")
# Added just to automatically trigger re-runs of CMake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ extern "C"{
#define ESP_MFI_DEBUG_ASSERT 4
#define ESP_MFI_DEBUG_BLOCK 5

#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(4, 2, 2)
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0)
#include <esp_rom_sys.h>
#define esp_intr_printf esp_rom_printf
#else
#define esp_intr_printf ets_printf
Expand Down
11 changes: 10 additions & 1 deletion components/homekit/esp_hap_extras/src/hap_fw_upgrade.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <hap.h>
#include <hap_fw_upgrade.h>
#include <esp_https_ota.h>
#include <esp_idf_version.h>

#define FW_UPG_TASK_PRIORITY 1
#define FW_UPG_STACKSIZE 6 * 1024
Expand Down Expand Up @@ -59,7 +60,15 @@ static void fw_upgrade_thread_entry(void *data)
fw_upgrade_status = FW_UPG_STATUS_UPGRADING;
hap_val_t val = {.i = fw_upgrade_status};
hap_char_update_val(fw_upgrade_status_char, &val);
int ret = esp_https_ota(client_config);
esp_err_t ret;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
esp_https_ota_config_t ota_config = {
.http_config = client_config,
};
ret = esp_https_ota(&ota_config);
#else
ret = esp_https_ota(client_config);
#endif
if (ret == ESP_OK) {
ESP_LOGI(TAG, "FW Upgrade Successful");
fw_upgrade_status = FW_UPG_STATUS_SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion components/homekit/mu_srp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set(COMPONENT_ADD_INCLUDEDIRS .)

# Edit following two lines to set component requirements (see docs)
set(COMPONENT_REQUIRES )
set(COMPONENT_PRIV_REQUIRES hkdf-sha mbedtls esp_hw_support)
set(COMPONENT_PRIV_REQUIRES hkdf-sha mbedtls)

set(COMPONENT_SRCS ./mu_srp.c)

Expand Down

0 comments on commit 0a0ebf6

Please sign in to comment.