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 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