 
                               
   sleep_disable();  
-  //MCUSR = 0; // clear the reset register 
-  
-  watchdog_setup(); // watchdog back on
-  
-  detachInterrupt(0); // No wakeup interupt while awake
+  MCUSR = 0; // clear the reset register 
+  
+
+  if (sleep_flag == SLEEP_FLAG_DARK) {
+    detachInterrupt(0); // No wakeup interupt while awake
+    watchdog_setup(); // watchdog back on
+  }
   
   power_all_enable();    // power everything back on
   
   ADCSRA = (1 << ADEN); // ADC back on
   
   // Power up the periferals
-  digitalWrite(PIN_PERIF_POWER, HIGH); // high = 0n (NPN)
+  digitalWrite(PIN_PERIF_POWER, LOW); // (PNP)
 } 
 
 /**

byte ledState = HIGH;
byte msgId = 0;


Servo servo_horz;


        vw_send((uint8_t *)msg, strlen(msg));
        vw_wait_tx(); // Wait until the whole message is gone
        ++msgId;
        
        // Watchdog will wake us up in 8 seconds time.
        goToSleep(SLEEP_FLAG_IDLE);
    }
}

