 
 void board_power(boolean boot)
 {
-  digitalWrite(BOARD_PWR, LOW);
-  digitalWrite(BOARD_BOOT, boot ? HIGH : LOW);
-  delay(1000);
-  digitalWrite(BOARD_PWR, HIGH);
+  pinMode(BOARD_BOOT, boot ? INPUT : OUTPUT);
+  pinMode(BOARD_RST, OUTPUT);
+  delay(100);
+  pinMode(BOARD_RST, INPUT);
   
-  if (!board_detect(true))
-    digitalWrite(BOARD_PWR, LOW);
+  board_detect(true);
 }
 
 boolean board_detect(boolean connect)



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

#define DEBOUNCE_TIME 250
#define DETECT_TIME 500


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