Final commit
This commit is contained in:
parent
6b20b75ef3
commit
6e04d90b7c
2 changed files with 2350859 additions and 0 deletions
|
|
@ -0,0 +1,55 @@
|
|||
#include <SD.h>
|
||||
#include <SPIFFS.h>
|
||||
|
||||
#include <M5GFX.h>
|
||||
|
||||
M5GFX display;
|
||||
|
||||
static constexpr const uint8_t PIN_SD_CS = GPIO_NUM_4;
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
display.init();
|
||||
display.print("SD wait.\n");
|
||||
|
||||
SPIFFS.begin();
|
||||
|
||||
if (!display.loadFont(SPIFFS, "/font.vlw"))
|
||||
{
|
||||
#if defined (_SD_H_)
|
||||
while (!SD.begin(PIN_SD_CS, SPI, 25000000))
|
||||
{
|
||||
ESP_LOGD("debug","SD begin failed");
|
||||
delay(500);
|
||||
}
|
||||
if (!display.loadFont(SD, "/font.vlw"))
|
||||
#endif
|
||||
{
|
||||
display.print("Font data not found...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void loop(void)
|
||||
{
|
||||
display.print("Hello World !");
|
||||
delay(500);
|
||||
}
|
||||
|
||||
#if !defined ( ARDUINO )
|
||||
extern "C" {
|
||||
void loopTask(void*)
|
||||
{
|
||||
setup();
|
||||
for (;;) {
|
||||
loop();
|
||||
}
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
void app_main()
|
||||
{
|
||||
xTaskCreatePinnedToCore(loopTask, "loopTask", 8192, NULL, 1, NULL, 1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Binary file not shown.
Loading…
Reference in a new issue