MalekSediqi 9 年 前
コミット
c8e147fb88
2 ファイル変更5 行追加4 行削除
  1. 1 0
      keyboard.c
  2. 4 4
      main.c

+ 1 - 0
keyboard.c

@@ -156,6 +156,7 @@ void KbScan()
     KeyFound |= (KeyNibble1 & 0x00F0);          // b7..b4 in 'KeyNibble1' to b7...b4  in 'KeyFound' -- do nothing
     KeyFound |= ((KeyNibble2<<4) & 0x0F00);     // b7..b4 in 'KeyNibble2' to b11..b8  in 'KeyFound' << shift 4 left
     KeyFound |= ((KeyNibble3<<8) & 0xF000);     // b7..b4 in 'KeyNibble3' to b15..b12 in 'KeyFound' << shift 8 left
+    KbInjectKey(KbRemapKey(KeyFound));
 #endif  // USE_JTAG
 
 }

+ 4 - 4
main.c

@@ -211,7 +211,7 @@ int timer(time_t start){
 }
 
 int checkOffPressed(){
-    if (KbScan() < -1){
+    if (KbGetKey() > 1){
         LcdBackLight(LCD_BACKLIGHT_ON);
         return 1;
     } else {
@@ -293,7 +293,7 @@ int main(void)
         if(!isAlarmSyncing && X12RtcGetStatus(5) > 0)
         {
 			displayAlarm(0,1);
-			if (KbScan() < -1 || checkTime() == 1){
+			if (KbGetKey() < -1 || checkTime() == 1){
 				handleAlarm();
 				LcdBackLight(LCD_BACKLIGHT_OFF);
 			}
@@ -310,7 +310,7 @@ int main(void)
             }
 
 
-        if(KbScan() == -2049)
+        if(KbGetKey() == KEY_DOWN)
         {
             startVolumeTime = time(0);
             if(left > 1){
@@ -324,7 +324,7 @@ int main(void)
                 }
             rightSave = left;
         }
-        if(KbScan() == -1025)
+        if(KbGetKey() == KEY_UP)
         {
             startVolumeTime = time(0);
             if(left < 128) {