The code compiles OK, but the Eclipse edit window has every ESP_LOGI() statement underlined in red, saying that it has invalid arguments.
Eg
static const char* TAG = "wt_comms";
ESP_LOGI(TAG, "Reconnecting to WiFi");
When you hover over it, the popup gives:
"Invalid arguments '
Candidates are:
void esp_log_write(enum {/wt_starter_esp_idf/components/arduino-esp32/tools/sdk/include/log/esp_log.h:822}, const char *, const char *, ...)
'"
All my includes appear to be OK. Everything else gets reported correctly.
It's just the ESP_LOG macros.
What am I missing?
Eclipse generating 'Invalid Args' for ESP_LOG() macros
-
- Posts: 107
- Joined: Wed Jan 02, 2019 8:55 am
Re: Eclipse generating 'Invalid Args' for ESP_LOG() macros
If you use F3 to "go to" the source file represented by the "#include esp_log.h" line, does it go to the correct source file? Are that header file's recursive includes properly referenced?
-
- Posts: 107
- Joined: Wed Jan 02, 2019 8:55 am
Re: Eclipse generating 'Invalid Args' for ESP_LOG() macros
Yes, it goes to esp-idf/components/log/include/esp_log.h
esp_log.h is found twice in my include path.
Once in esp-idf and once in arduino-esp32.
Is that likely the problem?
William
I think so. When I look at the includes they are not marked as being incorrect.Are that header file's recursive includes properly referenced?
esp_log.h is found twice in my include path.
Once in esp-idf and once in arduino-esp32.
Is that likely the problem?
William
Re: Eclipse generating 'Invalid Args' for ESP_LOG() macros
It might be because esp_log_level_t is an anonymous enum, and Eclipse builds an identifier for it out of file path:Once in esp-idf and once in arduino-esp32.
Is that likely the problem?
enum {/wt_starter_esp_idf/components/arduino-esp32/tools/sdk/include/log/esp_log.h:822}
Hypothetically, changing enum declaration from
typedef enum { } esp_log_level_t;
to
typedef enum esp_log_level_t { } esp_log_level_t;
in both header files should fix the issue.
-
- Posts: 107
- Joined: Wed Jan 02, 2019 8:55 am
Re: Eclipse generating 'Invalid Args' for ESP_LOG() macros
Thank you !!! That worked.
It now let's me see the other warnings that Eclipse has brought up.
All of them because of duplicate includes from components/arduino-esp32/tools/sdk/include
What is the standard way of ensuring that components/arduino-esp32/tools/sdk/include isn't picked up?
It now let's me see the other warnings that Eclipse has brought up.
All of them because of duplicate includes from components/arduino-esp32/tools/sdk/include
What is the standard way of ensuring that components/arduino-esp32/tools/sdk/include isn't picked up?
-
- Posts: 107
- Joined: Wed Jan 02, 2019 8:55 am
Re: Eclipse generating 'Invalid Args' for ESP_LOG() macros
I have also raised this as an issue at arduino-esp32 https://github.com/espressif/arduino-esp32/issues/2426
As I suspect it needs to be fixed in the arduino-esp32/component.mk
As I suspect it needs to be fixed in the arduino-esp32/component.mk
Who is online
Users browsing this forum: No registered users and 138 guests