m5stack / M5Stack

M5Stack Arduino Library
MIT License
1.19k stars 425 forks source link

Working with the painlessMesh library causes an error. #297

Closed jonkiszp closed 1 year ago

jonkiszp commented 1 year ago

Describe the bug

When I try to use these two libraries in one project I get an error.

https://gitlab.com/painlessMesh/painlessMesh

To reproduce

code: `#include

include

void setup() { Serial.begin(500000); M5.begin(true, true, false, true); M5.Lcd.fillScreen(BLACK); // put your setup code here, to run once: }

void loop() { // put your main code here, to run repeatedly: M5.Lcd.setCursor(10,10); if (M5.Power.canControl()) { M5.Lcd.print(M5.Power.getBatteryLevel()); } else { M5.Lcd.print("Can't control!"); } delay(5000); }`

ini [env:m5stack-core-esp32] platform = espressif32 board = m5stack-core-esp32 framework = arduino lib_deps = m5stack/M5Stack@^0.4.3 painlessmesh/painlessMesh@^1.5.0 monitor_speed = 500000

and build in Platformio 6.1.5

Expected behavior

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/m5stack-core-esp32.html PLATFORM: Espressif 32 (5.2.0) > M5Stack Core ESP32 HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa) PACKAGES:



Environment

Issue checklist

Tinyu-Zhao commented 1 year ago

Use this code and it will compile

#include <M5Stack.h>
#include <SPI.h>
#include <Update.h>

void setup() {
    Serial.begin(500000);
    M5.begin(true, true, false, true);
    M5.Lcd.fillScreen(BLACK);
    // put your setup code here, to run once:
}

void loop() {
    // put your main code here, to run repeatedly:
    M5.Lcd.setCursor(10, 10);
    if (M5.Power.canControl()) {
        M5.Lcd.print(M5.Power.getBatteryLevel());
    } else {
        M5.Lcd.print("Can't control!");
    }
    delay(5000);
}
image