#ifdef ENV_TEST_DISPLAY

#include <Arduino.h>
#include <SPI.h>
#include <LittleFS.h>
#include "config.h"
#include "epd.h"

void setup() {
    Serial.begin(115200);
    Serial.println("display test boot");

    epd_setup_pins();

    LittleFS.begin(true);

    File f = LittleFS.open("/img.bin", "r");
    if (!f) {
        Serial.println("ERROR: /img.bin not found — did you run uploadfs?");
        return;
    }
    Serial.printf("/img.bin: %u bytes\n", f.size());

    epd_init();
    epd_draw_image_from_file(f);
    f.close();
    epd_sleep();

    Serial.println("done");
}

void loop() {
    delay(60000);
}

#endif
