targets/Xenomai/plc_Xenomai_main.c
changeset 1980 28a369bb2676
parent 1974 b3a110daa135
child 1981 d0718654d9b0
equal deleted inserted replaced
1979:dc9e6f97cd8c 1980:28a369bb2676
   169 
   169 
   170     PLC_shutdown = 0;
   170     PLC_shutdown = 0;
   171 
   171 
   172     /*** RT Pipes creation and opening ***/
   172     /*** RT Pipes creation and opening ***/
   173     /* create Debug_pipe */
   173     /* create Debug_pipe */
   174     if(rt_pipe_create(&Debug_pipe, "Debug_pipe", DEBUG_PIPE_MINOR, PIPE_SIZE)) 
       
   175         goto error;
   174         goto error;
       
   175     if(rt_pipe_create(&Debug_pipe, "Debug_pipe", DEBUG_PIPE_MINOR, PIPE_SIZE) < 0) 
   176     PLC_state |= PLC_STATE_DEBUG_PIPE_CREATED;
   176     PLC_state |= PLC_STATE_DEBUG_PIPE_CREATED;
   177 
   177 
   178     /* open Debug_pipe*/
   178     /* open Debug_pipe*/
   179     if((Debug_pipe_fd = open(DEBUG_PIPE_DEVICE, O_RDWR)) == -1) goto error;
   179     if((Debug_pipe_fd = open(DEBUG_PIPE_DEVICE, O_RDWR)) == -1) goto error;
   180     PLC_state |= PLC_STATE_DEBUG_FILE_OPENED;
   180     PLC_state |= PLC_STATE_DEBUG_FILE_OPENED;
   181 
   181 
   182     /* create Python_pipe */
   182     /* create Python_pipe */
   183     if(rt_pipe_create(&Python_pipe, "Python_pipe", PYTHON_PIPE_MINOR, PIPE_SIZE)) 
       
   184         goto error;
   183         goto error;
       
   184     if(rt_pipe_create(&Python_pipe, "Python_pipe", PYTHON_PIPE_MINOR, PIPE_SIZE) < 0) 
   185     PLC_state |= PLC_STATE_PYTHON_PIPE_CREATED;
   185     PLC_state |= PLC_STATE_PYTHON_PIPE_CREATED;
   186 
   186 
   187     /* open Python_pipe*/
   187     /* open Python_pipe*/
   188     if((Python_pipe_fd = open(PYTHON_PIPE_DEVICE, O_RDWR)) == -1) goto error;
   188     if((Python_pipe_fd = open(PYTHON_PIPE_DEVICE, O_RDWR)) == -1) goto error;
   189     PLC_state |= PLC_STATE_PYTHON_FILE_OPENED;
   189     PLC_state |= PLC_STATE_PYTHON_FILE_OPENED;
   190 
   190 
   191     /* create WaitDebug_pipe */
   191     /* create WaitDebug_pipe */
   192     if(rt_pipe_create(&WaitDebug_pipe, "WaitDebug_pipe", WAITDEBUG_PIPE_MINOR, PIPE_SIZE))
       
   193         goto error;
   192         goto error;
       
   193     if(rt_pipe_create(&WaitDebug_pipe, "WaitDebug_pipe", WAITDEBUG_PIPE_MINOR, PIPE_SIZE) < 0)
   194     PLC_state |= PLC_STATE_WAITDEBUG_PIPE_CREATED;
   194     PLC_state |= PLC_STATE_WAITDEBUG_PIPE_CREATED;
   195 
   195 
   196     /* open WaitDebug_pipe*/
   196     /* open WaitDebug_pipe*/
   197     if((WaitDebug_pipe_fd = open(WAITDEBUG_PIPE_DEVICE, O_RDWR)) == -1) goto error;
   197     if((WaitDebug_pipe_fd = open(WAITDEBUG_PIPE_DEVICE, O_RDWR)) == -1) goto error;
   198     PLC_state |= PLC_STATE_WAITDEBUG_FILE_OPENED;
   198     PLC_state |= PLC_STATE_WAITDEBUG_FILE_OPENED;
   199 
   199 
   200     /* create WaitPython_pipe */
   200     /* create WaitPython_pipe */
   201     if(rt_pipe_create(&WaitPython_pipe, "WaitPython_pipe", WAITPYTHON_PIPE_MINOR, PIPE_SIZE))
       
   202         goto error;
   201         goto error;
       
   202     if(rt_pipe_create(&WaitPython_pipe, "WaitPython_pipe", WAITPYTHON_PIPE_MINOR, PIPE_SIZE) < 0)
   203     PLC_state |= PLC_STATE_WAITPYTHON_PIPE_CREATED;
   203     PLC_state |= PLC_STATE_WAITPYTHON_PIPE_CREATED;
   204 
   204 
   205     /* open WaitPython_pipe*/
   205     /* open WaitPython_pipe*/
   206     if((WaitPython_pipe_fd = open(WAITPYTHON_PIPE_DEVICE, O_RDWR)) == -1) goto error;
   206     if((WaitPython_pipe_fd = open(WAITPYTHON_PIPE_DEVICE, O_RDWR)) == -1) goto error;
   207     PLC_state |= PLC_STATE_WAITPYTHON_FILE_OPENED;
   207     PLC_state |= PLC_STATE_WAITPYTHON_FILE_OPENED;