 
 #else // Arduino Pro Mini
 
+#if F_CPU == 16000000
+const int SCANLINE_OFFSET = 110;
+const int MAX_SCANLINES = 70;
+typedef uint16_t image_t; // 1 word = 16 bits
+#define SIZE_OF_IMAGE_T 2
+// overclocked Arduino Pro Mini
+// GoPro needs 3.3V logic. Running 16MHz on ATmega 328P is not recommended at 3.3V.
+// (Note: ATmega 328P can run 20MHz but it is not supported by Arduino IDE)
+const int WORD_PER_LINE = 1; // 2^1 words = 32 bits
+#else // F_CPU == 8000000
 const int SCANLINE_OFFSET = 94;
 const int MAX_SCANLINES = 100;
 typedef uint16_t image_t; // 1 word = 16 bits
 #define SIZE_OF_IMAGE_T 2
 const int WORD_PER_LINE = 0; // 2^0 words = 16 bits
+#endif
 
 // set brightnessThreshold between 23: very sensitive and 77: not sensitive.
 const int brightnessThreshold = 50; // CHANGE ME!!

// In order to use D4 as an interrupt pin we need to do it low level. (sigh..)
// "How To Do It" documents about GR-KURUMI should be prepared...

#else // Arduino Pro Mini

// The part of code utilizes the following library. Please download and install.
//   https://github.com/leomil72/analogComp
//#include "analogComp.h" // *** please comment out this line if Teensy 3.1 or GR-KURUMI ***

#endif

// Bulk motion detection:
// volatile variables
volatile uint16_t interlace;
volatile uint16_t currentLine;
volatile uint16_t lastHsyncTime;

    // AIN+ < AIN-
    line[0] |= (1 << (x | 1));    // store B10
  }
#endif
}

void _resetCMP()
