diff --git a/slave/slave/lib/inputOutput.c b/slave/slave/lib/inputOutput.c --- a/slave/slave/lib/inputOutput.c +++ b/slave/slave/lib/inputOutput.c @@ -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); +// } } diff --git a/slave/slave/modules.c b/slave/slave/modules.c --- a/slave/slave/modules.c +++ b/slave/slave/modules.c @@ -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 } diff --git a/slave/slave/slave.c b/slave/slave/slave.c --- a/slave/slave/slave.c +++ b/slave/slave/slave.c @@ -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 { diff --git a/slave/slave/slave.cproj b/slave/slave/slave.cproj --- a/slave/slave/slave.cproj +++ b/slave/slave/slave.cproj @@ -208,6 +208,12 @@ compile + + compile + + + compile + compile