Bence Balint 3 anni fa
parent
commit
582eaa2c08
7 ha cambiato i file con 30 aggiunte e 8 eliminazioni
  1. 1 0
      .gitignore
  2. 3 0
      .gitmodules
  3. 1 0
      .idea/misc.xml
  4. 1 0
      components/kbf
  5. 8 2
      main/CMakeLists.txt
  6. 0 6
      main/doorkeeper_dev.c
  7. 16 0
      main/doorkeeper_dev.cpp

+ 1 - 0
.gitignore

@@ -1,2 +1,3 @@
 /build/
 /cmake-build-debug/
+components/kbf

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "components/kbf"]
+	path = components/kbf
+	url = https://git.kraxor.net/kraxor/kbf.git

+ 1 - 0
.idea/misc.xml

@@ -4,6 +4,7 @@
   <component name="CidrRootsConfiguration">
     <libraryRoots>
       <file path="$USER_HOME$/esp/esp-idf" />
+      <file path="$PROJECT_DIR$/components/kbf" />
     </libraryRoots>
   </component>
 </project>

+ 1 - 0
components/kbf

@@ -0,0 +1 @@
+Subproject commit 2591cd7d37f9908fc10c95d6f56cdeec0e15a935

+ 8 - 2
main/CMakeLists.txt

@@ -1,2 +1,8 @@
-idf_component_register(SRCS "doorkeeper_dev.c"
-                    INCLUDE_DIRS ".")
+idf_component_register(
+        SRCS
+        "doorkeeper_dev.cpp"
+
+        REQUIRES "kbf"
+
+        INCLUDE_DIRS "."
+)

+ 0 - 6
main/doorkeeper_dev.c

@@ -1,6 +0,0 @@
-#include <esp_log.h>
-
-void app_main(void)
-{
-  ESP_LOGI("app_main", "hello CLion");
-}

+ 16 - 0
main/doorkeeper_dev.cpp

@@ -0,0 +1,16 @@
+#include <esp_log.h>
+
+#include <kbf.h>
+
+using namespace kbf;
+
+extern "C" [[noreturn]] void app_main();
+
+[[noreturn]] void app_main() {
+    ESP_LOGI("app_main", "hello KBF");
+
+    while (true) {
+        kbf::sleep(1000);
+        ESP_LOGI("app_main", "boo");
+    }
+}