]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Correcting debounce issues.
authorJacob Alexander <triplehaata@gmail.com>
Wed, 6 Apr 2011 19:30:32 +0000 (12:30 -0700)
committerJacob Alexander <triplehaata@gmail.com>
Wed, 6 Apr 2011 19:30:32 +0000 (12:30 -0700)
main.c

diff --git a/main.c b/main.c
index 3271b5461634fcc503d8f92af80c3d30a9d151c2..7c0c1957dede0b7489e9d4160dd2823df84641f3 100644 (file)
--- a/main.c
+++ b/main.c
 
 
 // Drive Macros (Generally don't need to be changed), except for maybe DRIVE_DETECT
+// Sleep is for signal debouncing
 #define DRIVE_DETECT(reg,pin,group) \
                        reg &= ~(1 << pin); \
                        detection(group); \
-                       reg |= (1 << pin);
+                       reg |= (1 << pin); \
+                       _delay_us(1);
 
 #define DD_CASE(number) \
                        case number:\
@@ -376,14 +378,6 @@ int main( void )
                if ( !sendKeypresses )
                        continue;
 
-
-               // XXX TODO HACK REMOVEME KILL_WITH_FIRE
-               // Too lazy to find (electrical?) issue, so I'm adding a software fix (case is impossible anyways without moar diodes)
-               if ( keyDetectArray[20] & (1 << 7) && keyDetectArray[21] & (1 << 7) && keyDetectArray[38] & (1 << 7) ) {
-                       keyDetectArray[20] &= ~(1 << 7);
-                       print("HACK!! - Fixme sometime");
-               }
-
                // Detect Valid Keypresses - TODO
                uint8_t validKeys = 0;