Changeset - e97303daddff
[Not reviewed]
default
0 0 2
ethanzonca@CL-SEC241-08.cedarville.edu - 12 years ago 2012-12-04 12:09:02
ethanzonca@CL-SEC241-08.cedarville.edu
Initial import of sensordata implementation
2 files changed with 70 insertions and 0 deletions:
0 comments (0 inline, 0 general)
master/master/lib/sensordata.c
Show inline comments
 
new file 100644
 
/*
 
 * Master Firmware: Sensor Data
 
 *
 
 * Wireless Observational Modular Aerial Network
 
 * 
 
 * Ethan Zonca
 
 * Matthew Kanning
 
 * Kyle Ripperger
 
 * Matthew Kroening
 
 *
 
 */
 

	
 
#include "../config.h"
 
#include "sensordata.h"
 

	
 
int16_t boardTemps[MAX_SLAVES];
 
uint16_t variousSensors[MAX_SLAVES * (MAX_SLAVE_SENSORS - 1)];
 

	
 
void sensordata_setup() 
 
{
 
	for(int i=0; i<MAX_SLAVES; i++)
 
	{
 
		boardTemps[i] = 0;
 
	}
 
}
 
 
void sensordata_set(uint8_t type, uint16_t value) 
 
{
 
	variousSensors[type] = value;
 
}
 
 
uint16_t sensordata_get(uint8_t type) 
 
{
 
	return variousSensors[type];
 
}
 
 
void sensordata_setBoardTemp(uint8_t slaveID, int16_t value) 
 
{
 
	boardTemps[slaveID] = value;
 
}
 
 
int16_t sensordata_getBoardTemp(uint8_t slaveID)
 
{
 
	return boardTemps[slaveID];
 
}
 
\ No newline at end of file
master/master/lib/sensordata.h
Show inline comments
 
new file 100644
 
/*
 
 * Master Firmware: Sensor Data
 
 *
 
 * Wireless Observational Modular Aerial Network
 
 * 
 
 * Ethan Zonca
 
 * Matthew Kanning
 
 * Kyle Ripperger
 
 * Matthew Kroening
 
 *
 
 */
 
 
 
#ifndef SENSORDATA_H_
 
#define SENSORDATA_H_
 
 
#include "slavesensors.h"
 
 
void sensordata_setup();
 
void sensordata_set(uint8_t type, uint16_t value);
 
uint16_t sensordata_get(uint8_t type);
 
void sensordata_setBoardTemp(uint8_t slaveID, int16_t value);
 
int16_t sensordata_getBoardTemp(uint8_t slaveID);
 
 
#endif /* SENSORDATA_H_ */
 
\ No newline at end of file
0 comments (0 inline, 0 general)