rename main file to inkpot
This commit is contained in:
parent
2cfba0c5c8
commit
ad99018809
5 changed files with 8709 additions and 12 deletions
|
|
@ -14,11 +14,7 @@
|
|||
#include "esp_littlefs.h"
|
||||
#include <dirent.h>
|
||||
|
||||
// epd
|
||||
//#include <epd_highlevel.h>
|
||||
#include <epdiy.h>
|
||||
|
||||
#define WAVEFORM EPD_BUILTIN_WAVEFORM
|
||||
#include "paper.h"
|
||||
|
||||
#define WIFI_SCAN_LIST_SIZE 10
|
||||
#define LUA_FILE_PATH "/assets"
|
||||
|
|
@ -110,6 +106,9 @@ void run_embedded_lua_test(const char *lua_script, const char *test_name) {
|
|||
luaL_openlibs(L);
|
||||
log_memory_usage("After luaL_openlibs");
|
||||
|
||||
luaopen_paper(L);
|
||||
log_memory_usage("After luaopen_paper");
|
||||
|
||||
if (luaL_dostring(L, lua_script) == LUA_OK) {
|
||||
lua_pop(L, lua_gettop(L));
|
||||
} else {
|
||||
|
|
@ -170,10 +169,8 @@ void scan_wifi_networks(void) {
|
|||
ESP_LOGI(TAG, "Wi-Fi scan completed.");
|
||||
}
|
||||
|
||||
EpdiyHighlevelState hl;
|
||||
uint8_t* fb;
|
||||
|
||||
void app_main(void) {
|
||||
/*
|
||||
epd_init(&epd_board_lilygo_t5_47, &ED097TC2, EPD_LUT_64K);
|
||||
// epd_set_vcom(1560);
|
||||
hl = epd_hl_init(WAVEFORM);
|
||||
|
|
@ -196,14 +193,37 @@ void app_main(void) {
|
|||
.width = 200,
|
||||
.height = 100
|
||||
};
|
||||
epd_fill_rect(some_rect, 0x0, fb);
|
||||
epd_draw_rect(some_rect, 0x0, fb);
|
||||
|
||||
// write a message
|
||||
int cursor_x = 100;
|
||||
int cursor_y = 300;
|
||||
epd_write_default(&DepartureMono22, "TODO 2025-10-04", &cursor_x, &cursor_y, fb);
|
||||
|
||||
int cursor_x_2 = 100;
|
||||
int cursor_y_2 = 344;
|
||||
epd_write_default(&DepartureMono11, "- [ ] Create epaper thingy", &cursor_x_2, &cursor_y_2, fb);
|
||||
|
||||
int cursor_x_3 = 100;
|
||||
int cursor_y_3 = 377;
|
||||
epd_write_default(&DepartureMono11, "- [ ] Be kind", &cursor_x_3, &cursor_y_3, fb);
|
||||
|
||||
int cursor_x_4 = 100;
|
||||
int cursor_y_4 = 410;
|
||||
epd_write_default(&DepartureMono11, "- [ ] Enjoy life", &cursor_x_4, &cursor_y_4, fb);
|
||||
|
||||
// draw a line pattern
|
||||
for (int i = 0; i < 20; i++) {
|
||||
epd_draw_line(400 + i * 20, 100, 400 + (i + 1) * 20, 300, 0x0, fb);
|
||||
epd_draw_line(401 + i * 20, 100, 401 + (i + 1) * 20, 300, 0x0, fb);
|
||||
}
|
||||
|
||||
// finally, update the display!
|
||||
int temperature = 25;
|
||||
epd_poweron();
|
||||
epd_hl_update_screen(&hl, MODE_GC16, temperature);
|
||||
epd_poweroff();
|
||||
|
||||
*/
|
||||
// Initialize and mount the filesystem
|
||||
init_filesystem();
|
||||
|
||||
|
|
@ -211,6 +231,9 @@ void app_main(void) {
|
|||
const char *simple_script = "answer = 42; print('The answer is: '..answer)";
|
||||
run_embedded_lua_test(simple_script, "Simple Embedded Script");
|
||||
|
||||
//const char *paper_script = "local paper = require('paper'); paper.init(); print('width: '..paper.get_width(), 'height: '..paper.get_height())";
|
||||
//run_embedded_lua_test(paper_script, "Paper Script");
|
||||
|
||||
// Test 2: Run Lua script from a file (e.g., fibonacci.lua)
|
||||
run_lua_file("fibonacci.lua", "Fibonacci Script from File");
|
||||
|
||||
|
|
@ -218,7 +241,7 @@ void app_main(void) {
|
|||
run_lua_file("qr_code.lua", "QR Code Script from File");
|
||||
|
||||
// Perform Wi-Fi scan
|
||||
scan_wifi_networks();
|
||||
// scan_wifi_networks();
|
||||
|
||||
ESP_LOGI(TAG, "End of testing application.");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue