diff main.c @ 26:c06a5ebb4fca

Tandy 1000 Converter, basicly works, except for packet mismatches - Caused by too much processing in the converter... - Easy to fix if I remove the macro engine...
author Jacob Alexander <triplehaata@gmail.com>
date Sat, 01 Oct 2011 00:54:18 -0700
parents c2ef3daf39e1
children 8b8cad3db8db
line wrap: on
line diff
--- a/main.c	Fri Sep 30 01:30:34 2011 -0700
+++ b/main.c	Sat Oct 01 00:54:18 2011 -0700
@@ -102,10 +102,16 @@
 	uint8_t ledTimer = 15; // Enable LED for a short time
 	while ( 1 )
 	{
+		// Setup the scanning module
+		scan_setup();
+
 		while ( 1 )
 		{
 			// Acquire Key Indices
-			scan_loop();
+			// Loop continuously until scan_loop returns 0
+			cli();
+			while ( scan_loop() );
+			sei();
 
 			// Send keypresses over USB if the ISR has signalled that it's time
 			if ( !sendKeypresses )
@@ -122,6 +128,9 @@
 
 			// Indicate Error, if valid
 			errorLED( ledTimer );
+
+			if ( ledTimer > 0 )
+				ledTimer--;
 		}
 
 		// Loop should never get here (indicate error)