Changeset - 38ae355005d8
[Not reviewed]
default
0 2 0
ethanzonca@CL-ENS241-08.cedarville.edu - 12 years ago 2013-01-29 16:52:00
ethanzonca@CL-ENS241-08.cedarville.edu
Reduced delays, debug output now optional
2 files changed with 11 insertions and 4 deletions:
0 comments (0 inline, 0 general)
master/master/lib/slavesensors.c
Show inline comments
 
@@ -168,14 +168,18 @@ void slavesensors_network_scan() {
 
	serial0_ion();
 
}
 
 
// #define DEBUG_SELECTNODE
 
void slavesensors_selectnode(uint8_t nodeIndex)
 
{
 
	serial0_ioff();
 
	
 
	serial0_ioff();
 
	#ifdef DEBUG_SELECTNODE
 
	serial0_sendString("Switch to node ");
 
	serial0_sendChar(nodeIndex + 0x30);
 
	serial0_sendString("\r\n");
 
	_delay_ms(30);
 
	#endif
 
	
 
	_delay_ms(20);
 
	char tmpBuf[23];
 
	
 
	// If we can get into AT mode
 
@@ -201,9 +205,12 @@ void slavesensors_selectnode(uint8_t nod
 
	}
 
	_delay_ms(2);
 
	
 
	#ifdef DEBUG_SELECTNODE
 
	serial0_sendString("Selected ");
 
	serial0_sendChar(nodeIndex + 0x30);
 
	serial0_sendString("\r\n");
 
	#endif
 
	
 
	serial0_ion();
 
	return;
 
}
 
@@ -296,6 +303,7 @@ void slavesensors_request()
 
{
 
	slavesensors_selectnode(currentSlave);
 
	serial_sendCommand("@"); // Request data!
 
	slavesensors_selectlogger();
 
}
 
 
master/master/master.c
Show inline comments
 
@@ -143,8 +143,7 @@ int main(void)
 
				}
 
		
 
				logbuf[0] = 0x00;
 
				snprintf(logbuf, 128, "%lu,%d,%u,%s,%s,%s,%s,%s\r\n", time_millis(), sensors_getBoardTemp(),get_timestamp(),get_latitude(),get_longitude(),get_speedKnots(),get_hdop(), get_course());
 
				serial0_sendString(logbuf);
 
				snprintf(logbuf, 128, "%lu,%d,%u,%s,%s,%s,%s,%s", time_millis(), sensors_getBoardTemp(),get_timestamp(),get_latitude(),get_longitude(),get_speedKnots(),get_hdop(), get_course());
 
				for(int i=0; i<MAX_NUM_SLAVES; i++) {
 
					for(int j=0; j<MAX_NUM_SENSORS; j++) {
 
						int16_t tmp = sensordata_get(i, j);
0 comments (0 inline, 0 general)