Przeglądaj źródła

1、【完善】库对 RT-Thread 3.0.1 的支持。

Signed-off-by: armink <armink.ztl@gmail.com>
armink 8 lat temu
rodzic
commit
cf0f002819
2 zmienionych plików z 7 dodań i 24 usunięć
  1. 5 3
      mg_locals.h
  2. 2 21
      mg_port.c

+ 5 - 3
mg_locals.h

@@ -40,6 +40,8 @@
 #define CS_PLATFORM                              CS_P_STM32
 #define CS_DEFINE_DIRENT                         0
 
+#define MG_ENABLE_HTTP_SSI                       0
+
 #define MG_NET_IF                                MG_NET_IF_SOCKET
 #define MG_LWIP                                  1
 #define RTOS_SDK                                 1
@@ -49,6 +51,7 @@
 #define MG_REALLOC                               rt_realloc
 #define MG_FREE                                  rt_free
 #define MG_STRDUP                                rt_strdup
+#define WEAK                                     RT_WEAK
 
 #if defined(PKG_MONGOOSE_ENABLE_HTTP_WEBSOCKET)
     #define MG_ENABLE_HTTP_WEBSOCKET             1
@@ -82,10 +85,9 @@
 
 #define fcntl(s,cmd,val)                         lwip_fcntl(s,cmd,val)
 
-extern int gettimeofday(struct timeval *tp, void *ignore);
 /**
- * Mongoose ¿âÒÆÖ²¹¦Äܳõʼ»¯
+ * Mongoose Library port initialization
  */
-void mongoose_port_init();
+void mongoose_port_init(void);
 
 #endif /* _MONGOOSE_MG_LOCALS_H_ */

+ 2 - 21
mg_port.c

@@ -33,29 +33,10 @@
 
 static rt_mutex_t mg_locker = NULL;
 
-int gettimeofday(struct timeval *tp, void *ignore)
-{
-
-    time_t time;
-    rt_device_t device;
-
-    device = rt_device_find("rtc");
-    if (device != RT_NULL)
-    {
-        rt_device_control(device, RT_DEVICE_CTRL_RTC_GET_TIME, &time);
-        if (tp != RT_NULL)
-        {
-            tp->tv_sec = time;
-        }
-    }
-
-    return 0;
-}
-
 /**
- * Mongoose ¿âÒÆÖ²¹¦Äܳõʼ»¯
+ * Mongoose Library port initialization
  */
-void mongoose_port_init() {
+void mongoose_port_init(void) {
     if (!mg_locker) {
         mg_locker = rt_mutex_create("mg_lock", RT_IPC_FLAG_FIFO);
     }