     wdt_reset();
   }
 
-  // TODO: fix this..
   // if user wants to operate on door or something.. Leave door open/close (for a fair while)
   if(pausedForUser){
     lcd.clear();

#include "RTClib.h"
#include "encoder.h"
//#define DEBUG_EN true
#define ERR_EN true
#include "main.h"

#define LATITUDE -42.9166667
#define LONGITUDE 147.3333282

#define TIMEOUT_MAX 220
#define DELAY_MS 10
#define MAX_DELAY_MINUTES 100


  /* Re-enable the peripherals. */
  power_all_enable();
}


// parse input from serial
void parseInput(char * input){
  DEBUGSLN("Entered: %s\n");
  
}

// check for user input via serial
// if user enters 'i' within allowed time, start accepting input commands
void waitForSerialConnection(){
  
  volatile long int serial_wait_c = SERIAL_WAIT;
  char * input_str = (char *) malloc(sizeof(char) * 32);
  bool read_line = false;
  bool accepting_input = false;
  
  Serial.print("Enter i to enter serial command mode.\n");
  
  while(serial_wait_c > 0 ){
    while(Serial.available() > 0){
      char in_c = Serial.read();
      if (in_c == 'i'){
	accepting_input = true;
      }
    }
    _delay_ms(10);
    serial_wait_c -= 10;
  }
  
  if(serial_wait_c == 0 || !accepting_input){
    Serial.print("Serial command mode timeout..\n");
  }
  
  // if user entered 'i'
  // TODO: add timeout for this, longer - eg 20-30 seconds
  if(accepting_input){
    while(!read_line){
      char in_c;
      while(Serial.available() > 0){
	in_c = Serial.read();
      }
      
      // if user pressed enter, finish up
      if(in_c == '\n' || in_c == '\r'){
	read_line = true;
	parseInput(input_str);
	break;
      } else {
	*(input_str)++ = Serial.read();
      }
    }
  }
}

// Draw a number on the lcd with a leding zero
