diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 868c0b8..f93155d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,6 +12,7 @@ jobs: fail-fast: true matrix: targets: [esp32, esp32s3] + espidf: [v4.4, v5.0, v5.1, v5.2] runs-on: ubuntu-latest steps: - name: Checkout repo @@ -21,7 +22,7 @@ jobs: - name: esp-idf build uses: Fishwaldo/esp-idf-ci-action@v1.2 with: - esp_idf_version: v4.4.3 + esp_idf_version: ${{ matrix.espidf }} target: ${{ matrix.targets }} path: 'examples/esp_ghota_example' - name: Rename artifact diff --git a/README.md b/README.md index 3a462ae..410b256 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ You should be careful with your GitHub PAT and putting it in the source code. I ### esp-idf via Espressif Component Registry: ```bash -idf.py add-dependency Fishwaldo/ghota^0.0.1 +idf.py add-dependency Fishwaldo/ghota^1.0.0 ``` #### Platform IO Registry: @@ -34,7 +34,7 @@ add this to your platform.ini file: ```ini lib_deps = - Fishwaldo/ghota@^0.0.1 + fishwaldo/ghota@^1.0.0 ``` You also need to copy the contents of [Kconfig](Kconfig) into your project's Kconfig file, and run pio run -t menuconfig to configure the component. diff --git a/library.json b/library.json index f81a50e..e81816b 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "esp_ghota", - "version": "0.0.1", + "version": "1.0.0", "description": "a OTA library to upgrade your firmware via the Github Releases API", "keywords": "esp32 ota github", "repository": diff --git a/src/esp_ghota.c b/src/esp_ghota.c index 214b908..0ecda46 100644 --- a/src/esp_ghota.c +++ b/src/esp_ghota.c @@ -21,6 +21,11 @@ static const char *TAG = "GHOTA"; ESP_EVENT_DEFINE_BASE(GHOTA_EVENTS); +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) +#define PRICONTENT_LENGTH PRId64 +#else +#define PRICONTENT_LENGTH PRId32 +#endif typedef struct ghota_client_handle_t { ghota_config_t config; @@ -334,7 +339,7 @@ esp_err_t ghota_check(ghota_client_handle_t *handle) esp_err_t err = esp_http_client_perform(client); if (err == ESP_OK) { - ESP_LOGD(TAG, "HTTP GET Status = %d, content_length = %" PRId64 , + ESP_LOGD(TAG, "HTTP GET Status = %d, content_length = %" PRICONTENT_LENGTH , esp_http_client_get_status_code(client), esp_http_client_get_content_length(client)); } @@ -544,7 +549,7 @@ esp_err_t ghota_storage_update(ghota_client_handle_t *handle) esp_err_t err = esp_http_client_perform(client); if (err == ESP_OK) { - ESP_LOGD(TAG, "HTTP GET Status = %d, content_length = %" PRId64, + ESP_LOGD(TAG, "HTTP GET Status = %d, content_length = %" PRICONTENT_LENGTH, esp_http_client_get_status_code(client), esp_http_client_get_content_length(client)); uint8_t sha256[32] = {0};