Changeset - 1614c3d5e9cd
[Not reviewed]
default
0 5 0
kripperger@CL-SEC241-09.cedarville.edu - 12 years ago 2013-01-10 14:45:18
kripperger@CL-SEC241-09.cedarville.edu
Optimizations and setting up loop timer
5 files changed with 8 insertions and 9 deletions:
0 comments (0 inline, 0 general)
slave/slave/lib/geiger.c
Show inline comments
 
@@ -44,6 +44,6 @@ uint16_t geiger_getCpm()
 
 
uint8_t geiger_getCount()	//DEBUG
 
{
 
	return seconds;
 
	return counts;
 
}
 
slave/slave/lib/loopTimer.c
Show inline comments
 
@@ -15,10 +15,9 @@
 
volatile uint32_t millis = 0; // Milliseconds since initialization
 

	
 

	
 

	
 
void time_setup()
 
{
 
	DDRA = 0xff;
 
	DDRA = 0xFF;
 
	
 
	// Generic microcontroller config options
 
	OCR0A = 173; // Approx 172.7969 ticks per ms with 64 prescaler
 
@@ -32,7 +31,7 @@ void time_setup()
 

	
 
ISR(TIMER0_OVF_vect)
 
{
 
	millis = millis + 1;
 
	millis = millis + 1;		
 
}
 

	
 
uint32_t time_millis()
slave/slave/lib/loopTimer.h
Show inline comments
 
@@ -10,10 +10,8 @@
 
#define LOOPTIMER_H_
 
 

	
 
void time_setup();
 

	
 
void time_setup();
 
uint32_t time_millis();
 
 
 
 
#endif /* LOOPTIMER_H_ */
 
\ No newline at end of file
slave/slave/lib/sensors.c
Show inline comments
 
@@ -48,7 +48,7 @@ void sensors_readBoardTemp()
 
{
 
	boardTemp = i2c_read(BOARDTEMP_ADDR, 0x00);		// Read only the first byte of data (we don't need the resolution here)
 
	boardTemp = ((boardTemp*18)/10) + (32);			// Converting Celsius to Fahrenheit
 
	boardTemp = boardTemp - 1;						// Linear offset
 
	boardTemp = boardTemp - 3;						// Linear offset
 
}
 

	
 
int16_t sensors_getSpiTemp(void)	// Gets spi temperature from variable
slave/slave/slave.c
Show inline comments
 
@@ -42,6 +42,7 @@ int main(void)
 
{
 
	// Initialize		
 
	micro_setup();			// Generic microcontroller config options
 
	time_setup();
 
	led_configure();		// Configure ports and registers for LED operation
 
	io_configure();			// Configure IO ports and registers
 
	
 
@@ -51,6 +52,7 @@ int main(void)
 
	uint8_t moduleID = io_getModuleId();	// Slave Module ID from rotary dip switch
 
	modules_setup(moduleID);				// Run setup functions for specific module
 
	
 
	uint32_t milliseconds;
 
	
 
	uint8_t test;	//Debug
 
	uint8_t test2;	//Debug	
 
@@ -99,7 +101,7 @@ int main(void)
 
		
 
		
 
		test2 = sensors_getBoardTemp();	//DEBUG///////////////////////////////////////////////////////////////////////////
 
 
		time_millis();
 
 
		sprintf(buff, "|ModuleID: %u |BoardTemp: %u |Seconds: %u\r\n",moduleID,test2,test); //DEBUG
 
		serial0_sendString(buff); //DEBUG
0 comments (0 inline, 0 general)