Exemplo n.º 1
0
/*
 *********************************************************
 *
 *! OS_QuePeek( os_queue_t *, q_type_t *)
 *!
 *! \param 		none.
 *!
 *!	extract an item, but leave it on the queue
 *!
 *! \return 	status.
 */
uint8_t
OS_QuePeek(os_queue_t *q, q_type_t *item)
{
    if(!OS_QueEmpty(q))
    {
        *item = q->buff[q->outptr];
        return (Q_SUCCESS);
    }
    else
    {
        return (Q_EMPTY);
    }
}
Exemplo n.º 2
0
/*
 *********************************************************
 *
 *! OS_QueRemove( os_queue_t *, q_type_t *)
 *!
 *! \param 		none.
 *!
 *!	This function will remove an item from a queue
 *!
 *! \return 	status.
 */
uint8_t
OS_QueRemove(os_queue_t *q, q_type_t *item)
{
    if(!OS_QueEmpty(q))
    {
        *item = q->buff[q->outptr++];
        if(q->outptr == q->qsize)
        {
            q->outptr = 0;
        }
        return (Q_SUCCESS);
    }
    else
    {
        return (Q_EMPTY);
    }
}
Exemplo n.º 3
0
__attribute__((interrupt, no_auto_psv)) _U4TXInterrupt(void)
{
    q_type_t temp;

    IFS5bits.U4TXIF = 0;
    #ifdef ENABLE_UART4_DRIVER
        if (!OS_QueEmpty(Tx4Que))
        {
            OS_QueGet(Tx4Que, temp);        
            U4TXREG = temp;
        }
        else
        {
		    IEC5bits.U4TXIE = 0;
	    }
    #else
	    IEC5bits.U4TXIE = 0;
    #endif    
}