m5stack / M5Core-Ink

M5Stack CoreInk Arduino Library
MIT License
44 stars 33 forks source link

[PlatformIO] Quick start fails: error: 'class M5CoreInk' has no member named 'PowerDown' #5

Closed hpsaturn closed 2 years ago

hpsaturn commented 3 years ago

Target:

Hi, I'm trying to build the FactoryTest project with PlatformIO, my steps:

Board selection:

pio init -b m5stack-core-esp32 --ide vscode

it because don't exists m5stack-coreink board yet.

Library selection:

In platformio.ini I put the next library that I found with library search command:

lib_deps =
    m5stack/M5-CoreInk

Project directory preparation:

cp -r .pio/libdeps/m5stack-core-esp32/M5-CoreInk/examples/FactoryTest/* src/

Build and errors:

m5stack-coreink$ pio run
Processing m5stack-core-esp32 (platform: espressif32; board: m5stack-core-esp32; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/m5stack-core-esp32.html
PLATFORM: Espressif 32 (2.0.0) > M5Stack Core ESP32
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (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: 
 - framework-arduinoespressif32 3.10004.201016 (1.0.4) 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - toolchain-xtensa32 2.50200.80 (5.2.0)
Converting FactoryTest.ino
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Library Manager: Installing m5stack/M5-CoreInk
Library Manager: M5-CoreInk @ 0.0.2 has been installed!
Found 27 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <M5-CoreInk> 0.0.2
|   |-- <Wire> 1.0.1
|   |-- <SPI> 1.0
|-- <WiFi> 1.0
Building in release mode
Compiling .pio/build/m5stack-core-esp32/src/CoreInk.c.o
Compiling .pio/build/m5stack-core-esp32/src/FactoryTest.ino.cpp.o
Compiling .pio/build/m5stack-core-esp32/src/Num18x29.cpp.o
Compiling .pio/build/m5stack-core-esp32/src/Num_55x40.cpp.o
Compiling .pio/build/m5stack-core-esp32/src/icon.cpp.o
Generating partitions .pio/build/m5stack-core-esp32/partitions.bin
Compiling .pio/build/m5stack-core-esp32/lib7de/Wire/Wire.cpp.o
Compiling .pio/build/m5stack-core-esp32/lib02b/SPI/SPI.cpp.o
Compiling .pio/build/m5stack-core-esp32/libfa3/M5-CoreInk/M5CoreInk.cpp.o
Compiling .pio/build/m5stack-core-esp32/libfa3/M5-CoreInk/utility/Ascii24x48.cpp.o
Archiving .pio/build/m5stack-core-esp32/lib02b/libSPI.a
Indexing .pio/build/m5stack-core-esp32/lib02b/libSPI.a
Compiling .pio/build/m5stack-core-esp32/libfa3/M5-CoreInk/utility/Ascii8x16.cpp.o
/home/avp/sketchbook/pio/m5stack-coreink/src/FactoryTest.ino: In function 'void WifiScanPage()':
/home/avp/sketchbook/pio/m5stack-coreink/src/FactoryTest.ino:375:16: error: 'class M5CoreInk' has no member named 'PowerDown'
             M5.PowerDown();
                ^
/home/avp/sketchbook/pio/m5stack-coreink/src/FactoryTest.ino: In function 'void flushTimePage()':
/home/avp/sketchbook/pio/m5stack-coreink/src/FactoryTest.ino:412:16: error: 'class M5CoreInk' has no member named 'PowerDown'
             M5.PowerDown();
                ^
/home/avp/sketchbook/pio/m5stack-coreink/src/FactoryTest.ino: In function 'void checkBatteryVoltage(bool)':
/home/avp/sketchbook/pio/m5stack-coreink/src/FactoryTest.ino:430:13: error: 'class M5CoreInk' has no member named 'PowerDown'
          M5.PowerDown();
             ^
/home/avp/sketchbook/pio/m5stack-coreink/src/FactoryTest.ino: In function 'void loop()':
/home/avp/sketchbook/pio/m5stack-coreink/src/FactoryTest.ino:510:12: error: 'class M5CoreInk' has no member named 'PowerDown'
         M5.PowerDown();
            ^
*** [.pio/build/m5stack-core-esp32/src/FactoryTest.ino.cpp.o] Error 1
.pio/libdeps/m5stack-core-esp32/M5-CoreInk/src/M5CoreInk.cpp: In member function 'int M5CoreInk::shutdown(int)':
.pio/libdeps/m5stack-core-esp32/M5-CoreInk/src/M5CoreInk.cpp:67:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
.pio/libdeps/m5stack-core-esp32/M5-CoreInk/src/M5CoreInk.cpp: In member function 'int M5CoreInk::shutdown(const RTC_TimeTypeDef&)':
.pio/libdeps/m5stack-core-esp32/M5-CoreInk/src/M5CoreInk.cpp:73:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
.pio/libdeps/m5stack-core-esp32/M5-CoreInk/src/M5CoreInk.cpp: In member function 'int M5CoreInk::shutdown(const RTC_DateTypeDef&, const RTC_TimeTypeDef&)':
.pio/libdeps/m5stack-core-esp32/M5-CoreInk/src/M5CoreInk.cpp:79:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
========================================================= [FAILED] Took 1.56 seconds =========================================================
hpsaturn commented 3 years ago

Ok, I understand, the library on the platformio library registry is outdated now. A provisional workaround is:

lib_deps =
    ; m5stack/M5-CoreInk
    https://github.com/m5stack/M5-CoreInk.git
Tinyu-Zhao commented 2 years ago

Platform will now be updated with the Github Releases