Skip to content

Commit

Permalink
Bump Version and Fix content-length specifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Fishwaldo committed Feb 17, 2024
1 parent 12314d9 commit 4f8fa61
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -21,7 +22,7 @@ jobs:
- name: esp-idf build
uses: Fishwaldo/[email protected]
with:
esp_idf_version: v4.4.3
esp_idf_version: ${{ matrix.espidf }}
target: ${{ matrix.targets }}
path: 'examples/esp_ghota_example'
- name: Rename artifact
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -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":
Expand Down
9 changes: 7 additions & 2 deletions src/esp_ghota.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand Down Expand Up @@ -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};
Expand Down

0 comments on commit 4f8fa61

Please sign in to comment.