From 7afdb4d53e6bc20c2b3024ed0a8d776a1efcd67a Mon Sep 17 00:00:00 2001 From: Midgard Date: Wed, 15 Sep 2021 19:39:57 +0200 Subject: [PATCH 1/3] Add README --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..045eb24 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +Get started: +``` +# Fetch/update submodules: +git submodule update --init --recursive + +# To set up a build in directory `build`: +cmake -B build +# To build in directory `build`: +cmake --build build +``` From be0372ed949ce553d58225eb2d9b0e086339c6a5 Mon Sep 17 00:00:00 2001 From: redfast00 Date: Wed, 15 Sep 2021 20:14:12 +0200 Subject: [PATCH 2/3] Fix atomic initialization --- main/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/main.cpp b/main/main.cpp index f97d6ae..7442294 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -26,7 +26,7 @@ int frametime = 1000 / FPS; std::unordered_map statemap; -std::atomic framecounter = 0; +std::atomic framecounter = {0}; ws2811_t ledstring = { From 4978e4942af9e179176105de643477c2f2b7d111 Mon Sep 17 00:00:00 2001 From: redfast00 Date: Wed, 15 Sep 2021 20:23:21 +0200 Subject: [PATCH 3/3] Better test code --- main/main.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 7442294..73cd838 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -211,10 +211,8 @@ int main(int argc, char** argv) .length = 10, .enabled = true }; - std::thread t = spawn_lua_tread("print(\"hi\")\nled(0, 0, 0, 0)\ndelay(0)\nled(0, 0, 0, 0)\nprint(\"hi\")", config); + std::thread t = spawn_lua_tread("while true do\nprint(\"begin\")\nled(1, 0, 0, 0)\ndelay(1000)\nled(1, 0, 255, 0)\ndelay(1000)\nprint(\"done\")\nend", config); - - t.join(); httplib::Server svr; svr.Get("/hi", [](const httplib::Request &, httplib::Response &res) {