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

library fails with CORE_DEBUG_LEVEL=3 #50

Open
hpsaturn opened this issue Jul 28, 2022 · 1 comment
Open

library fails with CORE_DEBUG_LEVEL=3 #50

hpsaturn opened this issue Jul 28, 2022 · 1 comment

Comments

@hpsaturn
Copy link

hpsaturn commented Jul 28, 2022

Overview

The library fails when the debug level is increased, when you define CORE_DEBUG_LEVEL=3 for example, its necessary pass the TAG like this: '-D TAG_MHZ19="MHZ19"' on PlatformIO ini file for example.

.pio/libdeps/M5STICKCPLUS/MH-Z19/src/MHZ19.cpp: In member function 'void MHZ19::begin(Stream&)':
.pio/libdeps/M5STICKCPLUS/MH-Z19/src/MHZ19.cpp:37:18: error: 'TAG_MHZ19' was not declared in this scope
         ESP_LOGE(TAG_MHZ19, "Initial communication errorCode recieved");
hpsaturn added a commit to kike-canaries/canairio_firmware that referenced this issue Jul 28, 2022
@WifWaf
Copy link
Owner

WifWaf commented Jul 28, 2022

ESP_LOGX and the TAG_MHZ19 definition, both require the ESP32 definition to be set, so that's quite odd.

It might be worth moving the lines below to the top of the .cpp file, just in case they are being compiled differently.

MH-Z19/src/MHZ19.h

Lines 8 to 11 in 49658e5

#ifdef ESP32
#include "esp32-hal-log.h"
#define TAG_MHZ19 "MH-Z19"
#endif

I'll try and look at this soon if no luck, otherwise I'll push the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants