Browse Source

RT-Thread App auto initialization

wuhanstudio 3 years ago
parent
commit
ab7ed286f4
1 changed files with 10 additions and 0 deletions
  1. 10 0
      impl/random/rtthread.h

+ 10 - 0
impl/random/rtthread.h

@@ -5,6 +5,16 @@
 #define DBG_LVL DBG_LOG
 #include <rtdbg.h>
 
+static int
+hydrogen_init(void) {
+    if (hydro_init() != 0) {
+        abort();
+    }
+    LOG_I("libhydrogen initialized");
+    return 0;
+}
+INIT_APP_EXPORT(hydrogen_init);
+
 static int
 hydro_random_init(void)
 {