Ejemplo n.º 1
0
void mbed_eth_prepare_output(uint32_t size)
{
    if (current_buffer.ptr != NULL)
    {
	MBED_DEBUG("Asking to send a new packet while previous not finished\r\n");
	return;
    }
    /* allocated memory for output buffer */
    while ((current_buffer.ptr = mbed_eth_get_tx_buffer()) == NULL){mbed_eth_garbage_tx_buffers();};
    current_buffer.size = 0;
}
Ejemplo n.º 2
0
RFLPC_IRQ_HANDLER _eth_irq_handler()
{
    rfEthDescriptor *d;
    rfEthRxStatus *s;
    int i = 0;

    if (rflpc_eth_irq_get_status() & RFLPC_ETH_IRQ_EN_RX_DONE) /* packet received */
    {
	/* Process all pending packets, but limit to the number of descriptor
	 * to avoid beeing stuck in handler because of packet flood */
    	while (rflpc_eth_get_current_rx_packet_descriptor(&d, &s) && i++ < TX_DESCRIPTORS)
    	{
            if (mbed_process_input(d->packet, rflpc_eth_get_packet_size(s->status_info)) == ETH_INPUT_FREE_PACKET)
		rflpc_eth_done_process_rx_packet();
	    else
		break;
	}
    }
    if (rflpc_eth_irq_get_status() & RFLPC_ETH_IRQ_EN_TX_DONE)
	mbed_eth_garbage_tx_buffers();
    rflpc_eth_irq_clear(rflpc_eth_irq_get_status());
}