فهرست منبع

add: 先添加fota适配的骨架

Wendal Chen 2 سال پیش
والد
کامیت
27c5d6b805
2فایلهای تغییر یافته به همراه45 افزوده شده و 0 حذف شده
  1. 3 0
      app/port/luat_base_air101.c
  2. 42 0
      app/port/luat_fota_air101.c

+ 3 - 0
app/port/luat_base_air101.c

@@ -274,6 +274,9 @@ static const luaL_Reg loadedlibs[] = {
 #endif
 #ifdef LUAT_USE_XXTEA
   {"xxtea", luaopen_xxtea},
+#endif
+#ifdef LUAT_USE_FOTA
+  {"fota", luaopen_fota},
 #endif
   // {"opus", luaopen_opus},
   {NULL, NULL}

+ 42 - 0
app/port/luat_fota_air101.c

@@ -0,0 +1,42 @@
+
+#include "string.h"
+#include "wm_include.h"
+#include "wm_crypto_hard.h"
+#include "aes.h"
+#include "wm_osal.h"
+#include "wm_regs.h"
+#include "wm_debug.h"
+#include "wm_crypto_hard.h"
+#include "wm_internal_flash.h"
+#include "wm_pmu.h"
+#include "wm_fwup.h"
+
+#include "luat_base.h"
+#include "luat_crypto.h"
+#define LUAT_LOG_TAG "fota"
+#include "luat_log.h"
+
+#include "FreeRTOS.h"
+#include "task.h"
+
+#include "luat_fota.h"
+
+int luat_fota_init(uint32_t start_address, uint32_t len, luat_spi_device_t* spi_device, const char *path, uint32_t pathlen) {
+    return -1;
+}
+
+int luat_fota_write(uint8_t *data, uint32_t len) {
+    return -1;
+}
+
+int luat_fota_done(void) {
+    return -1;
+}
+
+int luat_fota_end(uint8_t is_ok) {
+    return -1;
+}
+
+uint8_t luat_fota_wait_ready(void) {
+    return 0;
+}