1
0
mirror of https://github.com/Dejvino/lilybook.git synced 2024-09-28 01:43:37 +00:00
lilybook/main/main.cpp

53 lines
1.1 KiB
C++
Raw Normal View History

#include <time.h>
#include <errno.h>
#include <sys/fcntl.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include "esp_system.h"
#include "driver/gpio.h"
#include "esp_system.h"
#include "esp_heap_alloc_caps.h"
2020-01-31 19:54:19 +00:00
#include "esp_log.h"
static const char *TAG = "main";
#include "core/common.h"
2020-01-31 19:54:19 +00:00
#include "config.h"
#include "core/buttons.h"
#include "core/storage.h"
#include "core/display.h"
#include "modes/ModeRunner.h"
#include "modes/BootMode.h"
2020-01-29 22:50:03 +00:00
static struct tm* tm_info;
static char tmp_buff[128];
static time_t time_now, time_last = 0;
static const char *file_fonts[3] = {"/spiffs/fonts/DotMatrix_M.fon", "/spiffs/fonts/Ubuntu.fon", "/spiffs/fonts/Grotesk24x48.fon"};
static const char tag[] = "[LilyBook]";
esp_err_t ret;
extern "C" void app_main()
{
2020-01-31 19:54:19 +00:00
printf("\n LilyBook v%s\n\n", APP_VERSION);
2020-01-29 22:50:03 +00:00
2020-01-31 19:54:19 +00:00
storage_init();
buttons_init();
display_init();
spi_init();
delay(500);
display_connect();
printf("==== START ====\r\n\n");
getModeRunner()->init();
getModeRunner()->startMainMode(new BootMode());
while (1) {
getModeRunner()->loop();
}
}