 
 void setup()
 {
-  pinMode(BOARD_PWR, OUTPUT);
+  pinMode(BOARD_RST, INPUT);
   pinMode(BOARD_DETECT, INPUT);
   pinMode(BOARD_BOOT, OUTPUT);
   
   digitalWrite(BOARD_BOOT, LOW);
-  digitalWrite(BOARD_PWR, LOW);
+  digitalWrite(BOARD_RST, LOW);
   
   Serial.begin(9600);
 }



#define BOARD_PWR    A4
#define BOARD_DETECT 7
#define BOARD_BOOT   A0

#define DEBOUNCE_TIME 250
#define DETECT_TIME 500


void board_power(boolean boot)
{
  pinMode(BOARD_BOOT, boot ? INPUT : OUTPUT);
  pinMode(BOARD_RST, OUTPUT);
  delay(100);
  pinMode(BOARD_RST, INPUT);
  
  board_detect(true);
}

boolean board_detect(boolean connect)
