   digitalWrite(GENTH, LOW);
 
   // Wait for clock
-  timeout = 255;
   while(!digitalRead(GENTL))
   {
-    if(!digitalRead(GENTR) || !timeout--) {
+    if(!digitalRead(GENTR)) {
       // Genesis quit send mode
+      digitalWrite(GENTH, HIGH);
       pinMode(GENTH, INPUT); // Reset TH to input mode
       return 0;
-    }
-    else
-    {
-#if F_CPU >= 20000000L
-      delayMicroseconds(1);
-#endif
     }
   }
 


uint8_t GenPort::genRead() {
  uint8_t v = 0;
  uint8_t timeout = 255;

  while(!digitalRead(GENTR))
  {
    if(!timeout--) {
      return 0;
    } 
    else {
#if F_CPU >= 20000000L
      delayMicroseconds(1);
#endif
    }
  }

  timeout = 255;
  // Wait for clock
  while(digitalRead(GENTL))
  {
    if(!timeout--) {
      return 0;
    } 
    else {
#if F_CPU >= 20000000L
      delayMicroseconds(1);
#endif
    }
  }

  // Read high nybble
#ifdef GEN_AVRPORT

{
  uint8_t packet[BLSM_PACKET_MAX];

  // Read header and compute packet length
  uint8_t header = in->read();
  uint8_t packetLen = computePacketLen(header);
