Browse Source

Fixed a potential issue that caused the event set (xMasterOsEvent) to be fetched before it was sent

kurisaw 2 years ago
parent
commit
c8b60dd892
2 changed files with 4 additions and 1 deletions
  1. 3 0
      modbus/mb_m.c
  2. 1 1
      samples/sample_mb_master.c

+ 3 - 0
modbus/mb_m.c

@@ -226,6 +226,9 @@ eMBMasterEnable( void )
     {
         eStatus = MB_EILLSTATE;
     }
+
+    xMBMasterPortEventPost( EV_MASTER_FRAME_RECEIVED );
+
     return eStatus;
 }
 

+ 1 - 1
samples/sample_mb_master.c

@@ -90,7 +90,7 @@ static int mb_master_sample(int argc, char **argv)
         goto __exit;
     }
 
-    tid2 = rt_thread_create("md_m_send", send_thread_entry, RT_NULL, 512, MB_SEND_THREAD_PRIORITY, 10);
+    tid2 = rt_thread_create("md_m_send", send_thread_entry, RT_NULL, 512, MB_SEND_THREAD_PRIORITY - 2, 10);
     if (tid2 != RT_NULL)
     {
         rt_thread_startup(tid2);