]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - Scan/matrix/scan_loop.c
Adding the rest of the matrix scanning modes
[kiibohd-controller.git] / Scan / matrix / scan_loop.c
index 7e0121a8a1417dc106bb4fbd4b165ba07054c1af..731754e963389399aeec00f77d9d4a2b7ca76c5b 100644 (file)
@@ -76,10 +76,17 @@ inline void scan_setup()
 inline uint8_t scan_loop()
 {
        // Check count to see if the sample threshold may have been reached, otherwise collect more data
-       if ( scan_count++ < MAX_SAMPLES )
+       if ( scan_count < MAX_SAMPLES )
        {
                matrix_scan( (uint8_t*)matrix_pinout, KeyIndex_Array );
 
+               // scanDual requires 2 passes, and thus needs more memory per matrix_scan pass
+#if scanMode == scanDual
+               scan_count += 2;
+#else
+               scan_count++;
+#endif
+
                // Signal Main Detection Loop to continue scanning
                return 0;
        }