41 lines
646 B
C++
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();
|
|
}
|
|
}
|