Ejemplo n.º 1
0
int main(void) 
{
	rflpc_eth_init () ;
	rflpc_led_init () ;

	rflpc_eth_irq_enable_set (~0) ;
	rflpc_eth_irq_enable (~0) ;
	rflpc_eth_irq_trigger(~0);
	rflpc_irq_handler_t led = pinpon ;
	rflpc_eth_set_irq_handler (led) ;





	/*
	rflpc_rit_enable() ;
	rflpc_irq_handler_t check_led = pinpon ;
	rflpc_rit_set_callback(period, ~period, 1, check_led) ;
*/
	while (1)
	{
	}

	return 0 ;
}
int main()
{
  rflpc_eth_init();
  rflpc_led_init();
  rflpc_irq_init ();
  rflpc_eth_irq_enable_set(0x30ff);
  rflpc_eth_set_irq_handler(enableled);
  rflpc_eth_irq_trigger(1);
  while(1);  
return 0;
}
Ejemplo n.º 3
0
int16_t mbed_eth_get_byte()
{
    uint8_t byte;
    if (current_rx_frame == NULL)
    {
	MBED_DEBUG("SMEWS Required a byte but none available!\r\n");
	return -1;
    }

    byte = current_rx_frame[current_rx_frame_idx++];
    ++byte_count;
    if (current_rx_frame_idx >= current_rx_frame_size)
    {
	current_rx_frame = NULL;
	current_rx_frame_size = 0;
	current_rx_frame_idx = 0;
	rflpc_eth_done_process_rx_packet();
	byte_count = 0;
	if (rflpc_eth_rx_available()) /* If packet have been received but not yet handled, force IRQ generation */
	    rflpc_eth_irq_trigger(RFLPC_ETH_IRQ_EN_RX_DONE);
    }
    return byte;
}
Ejemplo n.º 4
0
int mbed_eth_byte_available()
{
    if (current_rx_frame == NULL && rflpc_eth_rx_available()) /* No frame but something has been received */
	rflpc_eth_irq_trigger(RFLPC_ETH_IRQ_EN_RX_DONE);
    return current_rx_frame != NULL;
}