Changeset - 37e2258751ea
[Not reviewed]
Merge default
0 4 0
ethanzonca@CL-ENS241-08.cedarville.edu - 12 years ago 2013-03-15 16:31:36
ethanzonca@CL-ENS241-08.cedarville.edu
merge
4 files changed with 21 insertions and 10 deletions:
0 comments (0 inline, 0 general)
slave/slave/lib/inputOutput.c
Show inline comments
 
@@ -57,10 +57,10 @@ int8_t	moduleID;	// Slave Module ID from
 
	moduleID = (moduleID & 0b0111);				//Mask bits
 
	*/
 
 
	while(moduleID==0)
 
	{
 
		moduleID = i2c_read(EEPROM_ADDR, 0x05);
 
	}
 
//	while(moduleID==0)           //UNCOMMENT ALL THIS
 
//	{
 
//		moduleID = i2c_read(EEPROM_ADDR, 0x05);
 
//	}
 
 }
 
 
 
 
slave/slave/modules.c
Show inline comments
 
@@ -100,8 +100,6 @@
 
	TCCR2B = 0x05;			// Set the prescaler to 128: 32.768kHz / 128 = 1Hz overflow
 
	TIFR2 = 0x01;			// Reset timer2 overflow interrupt flag
 
	TIMSK2 = 0x01;			// Enable interrupt on overflow
 
	
 
	sei();					// Enable all interrupts
 
 }
 
  
 
  
slave/slave/slave.c
Show inline comments
 
@@ -32,7 +32,7 @@
 
#include "lib/cameras.h"
 
#include "lib/loopTimer.h"
 
#include "lib/masterComm.h"
 

	
 
#include "lib/watchdog.h"
 

	
 

	
 
void micro_setup()
 
@@ -49,9 +49,13 @@ int main(void)
 
	// 0 is for generic setup, 1 is for sensors, 2 is for Geiger, 3 is for cameras
 
	//i2c_write(EEPROM_ADDR, 0x05, 0x03);
 
		
 
	// Initialize		
 
	// Power debounce
 
	_delay_ms(20);
 
		
 
	// Initialize	
 
	micro_setup();			// Generic microcontroller config options
 
	time_setup();			// Setup loop timer and interrupts (TIMER0)
 
	//watchdog_setup();		// Setup watchdog timer
 
	led_configure();		// Configure ports and registers for LED operation
 
	io_configure();			// Configure IO ports and registers
 
	i2c_init();				// Setup I2C
 
@@ -70,8 +74,11 @@ int main(void)
 
		
 
		// Master communication
 
		masterComm_checkParser();	//Checks parser for data requests from master
 
		
 
		
 
		led_on(0);
 
		led_on(1);
 
		led_on(2);
 
		led_on(3);
 
		io_heaterOn();
 
		// Main slave operations
 
		if ((time_millis() % SENSOR_LOOP) == 0)	// Uses program timer to run every so often. Time interval defined in config.h
 
		{
slave/slave/slave.cproj
Show inline comments
 
@@ -208,6 +208,12 @@
 
    <Compile Include="lib\spi.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\watchdog.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\watchdog.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="modules.c">
 
      <SubType>compile</SubType>
 
    </Compile>
0 comments (0 inline, 0 general)