Bläddra i källkod

Fixed finsh thread preemption issue

kurisaw 1 år sedan
förälder
incheckning
2c448fbcb0
3 ändrade filer med 11 tillägg och 10 borttagningar
  1. 3 3
      .gitmodules
  2. 2 2
      src/ports/rtthread/options.h
  3. 6 5
      src/ports/rtthread/pn_dev/sampleapp_main.c

+ 3 - 3
.gitmodules

@@ -1,3 +1,3 @@
-[submodule "cmake/tools"]
-	path = cmake/tools
-	url = https://github.com/rtlabs-com/cmake-tools
+# [submodule "cmake/tools"]
+# 	path = cmake/tools
+# 	url = https://github.com/rtlabs-com/cmake-tools

+ 2 - 2
src/ports/rtthread/options.h

@@ -94,7 +94,7 @@
 
 #if !defined (PNET_MAX_AR)
 /** Number of connections. Must be > 0. "Automated RT Tester" uses 2 */
-#define PNET_MAX_AR               1
+#define PNET_MAX_AR               2
 #endif
 
 #if !defined (PNET_MAX_API)
@@ -196,7 +196,7 @@
  */
 
 #ifndef LOG_LEVEL
-#define LOG_LEVEL               (LOG_LEVEL_WARNING)
+#define LOG_LEVEL               (LOG_LEVEL_FATAL)
 #endif
 
 #ifndef PF_ETH_LOG

+ 6 - 5
src/ports/rtthread/pn_dev/sampleapp_main.c

@@ -42,7 +42,7 @@
 
 #define APP_LOG_LEVEL                  APP_LOG_LEVEL_DEBUG
 
-#define APP_BG_WORKER_THREAD_PRIORITY  26
+#define APP_BG_WORKER_THREAD_PRIORITY  19
 #define APP_BG_WORKER_THREAD_STACKSIZE 4096 /* bytes */
 
 /********************************** Globals ***********************************/
@@ -57,7 +57,7 @@ static bool app_status = 0;
 
 static void pnet_app(void);
 
-static void netdev_status_callback(struct netdev *netdev, rt_bool_t up)
+static void netdev_status_callback(struct netdev *netdev, enum netdev_cb_type up)
 {
     if (up)
     {
@@ -69,7 +69,7 @@ static void netdev_status_callback(struct netdev *netdev, rt_bool_t up)
     }
 }
 
-void netdev_monitor_init(void *param)
+int netdev_monitor_init(void)
 {
     struct netdev *netdev = netdev_get_by_name("e0");
     if (netdev == RT_NULL)
@@ -78,10 +78,11 @@ void netdev_monitor_init(void *param)
     }
 
     netdev_set_status_callback(netdev, netdev_status_callback);
+    return RT_EOK;
 }
 INIT_APP_EXPORT(netdev_monitor_init);
 
-void pnet_main ()
+static void pnet_main (void *parameter)
 {
    int ret;
    app_utils_netif_namelist_t netif_name_list;
@@ -165,7 +166,7 @@ static void pnet_app(void)
        }
 #endif
 
-        rt_thread_t pnet_thread = rt_thread_create("pnet", pnet_main, RT_NULL, 5124, 25, 10);
+        rt_thread_t pnet_thread = rt_thread_create("pnet", pnet_main, RT_NULL, 5124, 19, 10);
         rt_thread_startup(pnet_thread);
         app_status = 1;
         return;