static void
lwIPInterruptTask(void *pvArg)
{
    //
    // Loop forever.
    //
    while(1)
    {
        //
        // Wait until the semaphore has been signaled.
        //
        while(xQueueReceive(g_pInterrupt, &pvArg, portMAX_DELAY) != pdPASS)
        {
        }

        //
        // Processes any packets waiting to be sent or received.
        //
        tivaif_interrupt(&g_sNetIF, (uint32_t)pvArg);

        //
        // Re-enable the Ethernet interrupts.
        //
        MAP_EMACIntEnable(EMAC0_BASE, (EMAC_INT_RECEIVE | EMAC_INT_TRANSMIT |
                                       EMAC_INT_TX_STOPPED |
                                       EMAC_INT_RX_NO_BUFFER |
                                       EMAC_INT_RX_STOPPED | EMAC_INT_PHY));
    }
}
示例#2
0
文件: lwip_eth.c 项目: GMUCERG/xbh
/**
 * Task for feeding packets from ISR to lwIP
 * Loops forever blocking on queue waiting for next status from ISR
 * @param arg Unused
 */
static void eth_int_task(void* arg){/*{{{*/
    uint32_t status;
    while(1){

        //Loop waiting max time between loops until queue item received
        while(xQueueReceive(eth_int_q_handle, &status, portMAX_DELAY)!=pdPASS);

        tivaif_interrupt(&lwip_netif, status);
        // Reenable interrupts disabled in lwIP_eth_isr()
        MAP_EMACIntEnable(EMAC0_BASE, (EMAC_INT_PHY|
                    EMAC_INT_RECEIVE|
                    EMAC_INT_RX_NO_BUFFER|
                    EMAC_INT_RX_STOPPED|
                    EMAC_INT_TRANSMIT|
                    EMAC_INT_TX_STOPPED));

#if DEBUG_STACK
        DEBUG_OUT("Stack Usage: %s: %d\n", __PRETTY_FUNCTION__, uxTaskGetStackHighWaterMark(NULL));
#endif
    }
}/*}}}*/