Revision 1443 trunk/code/projects/libwireless/lib/xbee.c

View differences:

xbee.c
47 47

  
48 48
#include <serial.h>
49 49
#include <avr/interrupt.h>
50
#include <util/delay.h>
50 51

  
51 52
#endif
52 53

  
......
584 585
}
585 586

  
586 587
/**
588
 * Resets the XBee Modem (including baud rate when on robot)
589
 * 
590
 * Used for launching bootloader
591
 **/
592
int xbee_reset(void)
593
{
594
#ifdef ROBOT
595
	xbee_send_modify_at_command("BD", "3");
596
#endif
597
	xbee_send_read_at_command("FR");
598
    // delay 150 ms to wait for reset
599
#ifndef ROBOT
600
	usleep(150000);
601
#else
602
	_delay_ms(150);
603
#endif
604

  
605
	return 0;
606
}
607

  
608
/**
587 609
 * Sends an AT command to read a parameter.
588 610
 *
589 611
 * @param command the AT command to send. For exmaple,

Also available in: Unified diff