Hiroh Satoh / keyboard Featured

Dependencies:   BLE_API mbed-dev nRF51822

Revision:
47:5bf2ae8cc710
Parent:
45:f4be69c936f6
Child:
48:d6938de02f62
--- a/main.cpp	Sun Aug 28 16:25:26 2016 +0000
+++ b/main.cpp	Mon Aug 29 12:38:32 2016 +0000
@@ -225,7 +225,7 @@
 						if (changed & (1<<row)) {
 							bool pressed = keysCurr[col] & (1<<row);
 							// DEBUG_KEYEVENT("changed: col=%d, row=%d / pressed=%d\r\n", col, row, pressed);
-							keymap.execute(col, row, pressed);
+							keymap.execute(row, col, pressed);
 						}
 					}
 				}
@@ -251,10 +251,9 @@
 
 				if (queue) HIDController::queueCurrentReportData();
 
-				// wait_ms(5); is busy loop
-				// use timer1 to use wait 5ms
+				// use timer to use wait 5ms
+				keyIntervalInterrupt = false;
 				timeout.attach_us(wakeupKeyIntervalSleep, 5000);
-				keyIntervalInterrupt = false;
 				while (!keyIntervalInterrupt) HIDController::waitForEvent();
 			}
 		} else {