Skip to content

Commit

Permalink
feat: adding a few ESP-IDF error codes
Browse files Browse the repository at this point in the history
Copy/paste from IDF 5.3.1

#58
  • Loading branch information
malachib committed Dec 9, 2024
1 parent 285f6ab commit f284b05
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/estd/internal/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ void esp_log_write(esp_log_level_t level, const char* tag, const char* format, .
{
if(level <= LOG_LOCAL_LEVEL)
{
// TODO: Write out tag
esp_log_write_header(level, tag);

va_list args;
Expand Down
6 changes: 6 additions & 0 deletions src/estd/port/esp-idf/fake/esp_err.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ extern "C" {
typedef int esp_err_t;

#define ESP_OK 0
#define ESP_FAIL -1 /*!< Generic esp_err_t code indicating failure */

#define ESP_ERR_NO_MEM 0x101 /*!< Out of memory */
#define ESP_ERR_INVALID_ARG 0x102 /*!< Invalid argument */
#define ESP_ERR_INVALID_STATE 0x103 /*!< Invalid state */
#define ESP_ERR_INVALID_SIZE 0x104 /*!< Invalid size */

#ifdef __cplusplus
}
Expand Down
2 changes: 2 additions & 0 deletions src/estd/port/esp-idf/fake/esp_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ extern "C" {

#include <stdio.h>

#include "esp_err.h"

enum esp_log_level_t
{
ESP_LOG_NONE,
Expand Down
2 changes: 2 additions & 0 deletions test/catch/port-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ TEST_CASE("port (cross plat specific) tests")
ESP_LOGE("Tag2", "uh oh! %d", 5);

REQUIRE(fake_log_out == "E Tag2: uh oh! 5\n");

ESP_LOGW("Tag2", "Goodbye");
}
}

0 comments on commit f284b05

Please sign in to comment.