Bläddra i källkod

change: 调整win32编译,默认去掉lwip的编译

Wendal Chen 4 år sedan
förälder
incheckning
1b72eebb30
3 ändrade filer med 25 tillägg och 13 borttagningar
  1. 10 6
      bsp/win32/CMakeLists.txt
  2. 7 0
      bsp/win32/port/luat_base_win32.c
  3. 8 7
      luat/packages/fatfs/diskio_spitf.c

+ 10 - 6
bsp/win32/CMakeLists.txt

@@ -116,18 +116,22 @@ add_subdirectory(${TOPROOT}/components/lvgl lvgl.out)
 
 #-----------------------
 # lwip
-include_directories(${TOPROOT}/components/network/lwip)
-add_subdirectory(${TOPROOT}/components/network/lwip lwip.out)
+# include_directories(${TOPROOT}/components/network/lwip)
+# add_subdirectory(${TOPROOT}/components/network/lwip lwip.out)
 #-----------------------
 
 IF (WIN32)
 # 指定生成目标
 add_executable(luatos src/main_win32.c)
-target_link_libraries(luat freertos10 winmm fatfs lvgl lwip)
+target_link_libraries(luat freertos10 winmm fatfs lvgl 
+                    # lwip
+)
 target_link_libraries(luatos freertos10 lua luatos_msys luat winmm cjson
-                      rock_lfs rock_librs232 mbedtls fatfs lvgl lwip
-                      lwipcontribexamples lwipcontribapps lwipcontribaddons 
-                      lwipallapps lwipcore lwipcontribportwindows lwipmbedtls)
+                      rock_lfs rock_librs232 mbedtls fatfs lvgl 
+                    #   lwip
+                    #   lwipcontribexamples lwipcontribapps lwipcontribaddons 
+                    #   lwipallapps lwipcore lwipcontribportwindows lwipmbedtls
+                      )
 ELSE ()
 add_executable(luatos src/main_posix.c)
 target_link_libraries(luat freertos10 pthread fatfs lvgl)

+ 7 - 0
bsp/win32/port/luat_base_win32.c

@@ -141,6 +141,13 @@ void luat_ota_reboot(int timeout_ms) {
   exit(0);
 }
 
+#include <unistd.h>
+
+void luat_timer_us_delay(size_t us) {
+    if (us)
+        usleep(us);
+    return;
+}
 
 //--------------------------------------------------------------------------------
 // for freertos

+ 8 - 7
luat/packages/fatfs/diskio_spitf.c

@@ -60,13 +60,14 @@ extern BYTE FATFS_DEBUG; // debug log, 0 -- disable , 1 -- enable
 extern BYTE FATFS_SPI_ID; // 0 -- SPI_1, 1 -- SPI_2
 extern BYTE FATFS_SPI_CS; // GPIO 3
 
-static void dly_us(BYTE us) {
-	if (us < 1) {
-		return;
-	}
-	us += 999;
-	luat_timer_mdelay(us/1000);
-}
+// static void dly_us(BYTE us) {
+// 	if (us < 1) {
+// 		return;
+// 	}
+// 	us += 999;
+// 	luat_timer_mdelay(us/1000);
+// }
+#define dly_us luat_timer_us_delay
 
 /*-----------------------------------------------------------------------*/
 /* Transmit bytes to the card (bitbanging)                               */