targets/Xenomai/plc_Xenomai_main.c
changeset 446 1edde533db19
parent 397 6a7ff66a811d
child 615 72bc3e53a1fa
equal deleted inserted replaced
441:379c66468cf6 446:1edde533db19
   203     rt_mutex_release(&debug_mutex);
   203     rt_mutex_release(&debug_mutex);
   204 }
   204 }
   205 
   205 
   206 extern unsigned long __tick;
   206 extern unsigned long __tick;
   207 /* from plc_debugger.c */
   207 /* from plc_debugger.c */
   208 unsigned long WaitDebugData()
   208 int WaitDebugData(unsigned long *tick)
   209 {
   209 {
   210     char message;
   210     char message;
   211     int res;
   211     int res;
       
   212     *tick = __debug_tick;
   212     /* Wait signal from PLC thread */
   213     /* Wait signal from PLC thread */
   213     if (PLC_state & PLC_STATE_DEBUG_FILE_OPENED) {
   214     if (PLC_state & PLC_STATE_DEBUG_FILE_OPENED) {
   214         res = read(WaitDebug_pipe_fd, &message, sizeof(char));
   215         res = read(WaitDebug_pipe_fd, &message, sizeof(char));
   215         if (res == sizeof(char))
   216         if (res == sizeof(char))
   216             return __debug_tick;
   217             return 0;
   217     }
   218     }
   218     return -1;
   219     return -1;
   219 }
   220 }
   220 
   221 
   221 /* Called by PLC thread when debug_publish finished
   222 /* Called by PLC thread when debug_publish finished