Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A fix for a new regression in stable v5.0 #16

Merged
merged 4 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: "0.9.8"
description: "A porting effort to the ESP-IDF framework for the e-Radionica InkPlate software."
dependencies:
idf:
version: ">=5.0"
2 changes: 1 addition & 1 deletion include/services/esp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ESP
mem = heap_caps_malloc(size, MALLOC_CAP_SPIRAM);
}
if (mem == nullptr) {
ESP_LOGE(TAG, "Not enough memory on PSRAM!!! (Asking %u bytes)", size);
ESP_LOGE(TAG, "Not enough memory on PSRAM!!! (Asking %lu bytes)", size);
}
return mem;
}
Expand Down
7 changes: 5 additions & 2 deletions src/drivers/mcp23017.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Distributed as-is; no warranty is given.
*/

#define __MCP__ 1

#include <cinttypes>

#include "mcp23017.hpp"
#include "esp_log.h"

Expand All @@ -32,7 +35,7 @@ Distributed as-is; no warranty is given.
bool
MCP23017::check_presence()
{
if (!present) ESP_LOGE(TAG, "The MCP at address 0x%X has not been detected.", mcp_address);
if (!present) ESP_LOGE(TAG, "The MCP at address 0x%" PRIX8 " has not been detected.", mcp_address);
return present;
}

Expand Down Expand Up @@ -69,7 +72,7 @@ MCP23017::setup()
wire.begin_transmission(mcp_address);
present = wire.end_transmission() == ESP_OK;

ESP_LOGI(TAG, "MCP at address 0x%X has%s been detected", mcp_address, present ? "" : " NOT");
ESP_LOGI(TAG, "MCP at address 0x%" PRIX8 " has%s been detected", mcp_address, present ? "" : " NOT");

read_all_registers();
registers[Reg::IODIRA] = 0xff;
Expand Down
7 changes: 4 additions & 3 deletions src/services/network_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Distributed as-is; no warranty is given.
#include "esp_log.h"

#include <string.h>
#include <cinttypes>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
Expand Down Expand Up @@ -60,7 +61,7 @@ static void sta_event_handler(void * arg,
int32_t event_id,
void * event_data)
{
ESP_LOGI(TAG, "STA Event, Base: %08x, Event: %d.", (unsigned int) event_base, event_id);
ESP_LOGI(TAG, "STA Event, Base: %08x, Event: %" PRIu32 ".", (unsigned int) event_base, event_id);

if (event_base == WIFI_EVENT) {
if (event_id == WIFI_EVENT_STA_START) {
Expand Down Expand Up @@ -212,7 +213,7 @@ static esp_err_t http_event_handler(esp_http_client_event_t * evt)
//ESP_LOGI(TAG, "key = %s, value = %s", evt->header_key, evt->header_value);
if (strcmp("Content-Length", evt->header_key) == 0) {
buffer_size = atoi(evt->header_value);
ESP_LOGI(TAG, "Donwload file size: %d", buffer_size);
ESP_LOGI(TAG, "Donwload file size: %" PRIi32, buffer_size);
}
break;
case HTTP_EVENT_ON_DATA:
Expand Down Expand Up @@ -276,7 +277,7 @@ NetworkClient::downloadFile(const char * url, int32_t * defaultLen)
esp_err_t err = esp_http_client_perform(client);

if (err == ESP_OK) {
ESP_LOGI(TAG, "Status = %d, content_length = %d",
ESP_LOGI(TAG, "Status = %d, content_length = %" PRIi64,
esp_http_client_get_status_code(client),
esp_http_client_get_content_length(client));
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/wire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Wire::begin_transmission(uint8_t addr)
{
if (!initialized) setup();

ESP_LOGD(TAG, "Begin Transmission to address %x", addr);
ESP_LOGD(TAG, "Begin Transmission to address %" PRIx8, addr);

if (initialized) {
address = addr;
Expand Down