Changeset - 887fa9c3d968
[Not reviewed]
default
0 2 0
ethanzonca@CL-ENS241-08.cedarville.edu - 12 years ago 2013-02-11 16:18:28
ethanzonca@CL-ENS241-08.cedarville.edu
More timeout fixes
2 files changed with 5 insertions and 7 deletions:
0 comments (0 inline, 0 general)
master/master/lib/slavesensors.c
Show inline comments
 
@@ -124,7 +124,7 @@ void slavesensors_network_scan()
 
		while(1) 
 
		{
 
			// Wait for scan to complete. If we timeout, return.
 
			if(waitTimeout()) 
 
			if(waitTimeout(7000)) 
 
			{
 
				return;
 
			}
 
@@ -312,9 +312,8 @@ void slavesensors_exitAT()
 
	// Exit AT
 
	serial0_sendString("ATCN");
 
	serial0_sendChar(0x0D);
 
	_delay_ms(2);
 
 
	if(waitTimeout()) 
 
	if(waitTimeout(2000)) 
 
	{
 
		return;
 
	}
 
@@ -322,12 +321,12 @@ void slavesensors_exitAT()
 
	xbeeIsOk();
 
}
 
 
bool waitTimeout() {
 
bool waitTimeout(uint32_t timeout) {
 
	uint32_t scanStart = time_millis();
 
	uint32_t lastBlink = 0;
 
	while(!serial0_hasChar())
 
	{
 
		if(time_millis() - scanStart > 7000)
 
		if(time_millis() - scanStart > timeout)
 
		{
 
			led_errorcode(ERROR_XBEETIMEOUT);
 
			return true;
 
@@ -355,7 +354,6 @@ int slavesensors_enterAT()
 
	serial0_sendChar('+'); // Enter AT mode
 
	serial0_sendChar('+');
 
	serial0_sendChar('+');
 
	_delay_ms(2);
 
 
	return xbeeIsOk();
 
}
master/master/lib/slavesensors.h
Show inline comments
 
@@ -30,7 +30,7 @@ enum sensorTypes // CMD ID#
 
	CAMERA,
 
};
 
 
bool waitTimeout();
 
bool waitTimeout(uint32_t timeout);
 
char* slavesensors_getLabel(uint8_t sensorID);
 
char* slavesensors_slavename(uint8_t id);
 
bool slavesensors_dataReady();
0 comments (0 inline, 0 general)