Ejemplo n.º 1
0
/* Led3线程的主函数 */
static void ThreadLed3Entry(TArgument data)
{
    TState state;
    TError error;
    TLedMsg* pMsg;

    while (eTrue)
    {
        /* Led3线程以阻塞方式接收消息,如果发现消息队列FLUSH则熄灭Led3 */
        state = TclReceiveMessage(&LedMQ, (void**)(&pMsg),
                                  TCLO_IPC_WAIT, 0, &error);
        if ((state != eSuccess) && (error & TCLE_IPC_RESET))
        {
            EvbLedControl(LED3, LED_ON);
        }

        /* Led3线程以阻塞方式接收消息,如果发现消息队列FLUSH则点亮Led3 */
        state = TclReceiveMessage(&LedMQ, (void**)(&pMsg),
                                  TCLO_IPC_WAIT, 0, &error);
        if ((state != eSuccess) && (error & TCLE_IPC_RESET))
        {
            EvbLedControl(LED3, LED_OFF);
        }
    }
}
/* Led3线程的主函数 */
static void ThreadLed3Entry(TArgument data)
{
    TState state;
    TError error;
    TLedMsg* pMsg;

    while (eTrue)
    {
        /* Led3线程以阻塞方式接收消息,按照消息内容来点亮或者熄灭Led3 */
        state = TclReceiveMessage(&LedMQ, (void**)(&pMsg), TCLO_IPC_WAIT,
                                  0, &error);
        if (state == eSuccess)
        {
            EvbLedControl(LED3, pMsg->Value);
        }
    }
}