Files
tide-display/ePaper-ESP-IDF/main/main.cpp
Peter Siegmund 41492c07c9 latest map style
Signed-off-by: Peter Siegmund <peter@rdkr.com>
2024-06-06 10:10:18 +02:00

41 lines
646 B
C++

#include <esp_task_wdt.h>
#include <stdio.h>
#include <string.h>
#include "epd_driver.h"
#include "smartconfig.h"
#include "utilities.h"
uint8_t* framebuffer;
void setup(void) {
epd_init();
epd_poweron();
epd_clear();
epd_poweroff();
framebuffer =
(uint8_t*)heap_caps_malloc(EPD_WIDTH * EPD_HEIGHT / 2, MALLOC_CAP_SPIRAM);
if (!framebuffer) {
printf("alloc memory failed !!!");
while (1) {
}
}
memset(framebuffer, 0xFF, EPD_WIDTH * EPD_HEIGHT / 2);
init_smartconfig();
}
void loop(void) {
vTaskDelay(pdMS_TO_TICKS(100));
}
extern "C" void app_main(void) {
setup();
while (1) {
loop();
}
}