]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - keyboard/fc980c/fc980c.c
Add a qwerty layer
[max/tmk_keyboard.git] / keyboard / fc980c / fc980c.c
index f64ad8072dbb1bf82c283684ab962ae5f1e29e4c..6b8fa39b163cd727efb5975a265e5dc996414949 100644 (file)
@@ -46,16 +46,12 @@ void matrix_init(void)
     debug_keyboard = true;
     debug_matrix = true;
 #endif
-    debug_enable = true;
-    debug_matrix = true;
 
     KEY_INIT();
 
-    // LEDs on NumLock, CapsLock and ScrollLock(PD7, PB5, PB6)
-    DDRD  |= (1<<7);
-    PORTD |= (1<<7);
-    DDRB  |= (1<<5) | (1<<6);
-    PORTB |= (1<<5) | (1<<6);
+    // LEDs on NumLock, CapsLock and ScrollLock(PB4, PB5, PB6)
+    DDRB  |= (1<<4) | (1<<5) | (1<<6);
+    PORTB &= ~((1<<4) | (1<<5) | (1<<6));
 
     // initialize matrix state: all keys off
     for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix0[i] = 0x00;
@@ -115,7 +111,7 @@ uint8_t matrix_scan(void)
 
             // NOTE: KEY_STATE keep its state in 20us after KEY_ENABLE.
             // This takes 25us or more to make sure KEY_STATE returns to idle state.
-            _delay_us(75);
+            _delay_us(30);
         }
         if (matrix[row] ^ matrix_prev[row]) {
             matrix_last_modified = timer_read32();
@@ -133,9 +129,9 @@ matrix_row_t matrix_get_row(uint8_t row)
 void led_set(uint8_t usb_led)
 {
     if (usb_led & (1<<USB_LED_NUM_LOCK)) {
-        PORTD |=  (1<<7);
+        PORTB |=  (1<<4);
     } else {
-        PORTD &= ~(1<<7);
+        PORTB &= ~(1<<4);
     }
     if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
         PORTB |=  (1<<5);
@@ -158,7 +154,7 @@ const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
     { UNIMAP_LEFT, UNIMAP_RCTL, UNIMAP_RALT, UNIMAP_NO  , UNIMAP_DOWN, UNIMAP_PDOT, UNIMAP_RGHT, UNIMAP_P0  ,
       UNIMAP_X   , UNIMAP_LGUI, UNIMAP_GRV , UNIMAP_V   , UNIMAP_NO  , UNIMAP_ESC , UNIMAP_M   , UNIMAP_SPC   },
     { UNIMAP_RGUI, UNIMAP_DOT , UNIMAP_NO  , UNIMAP_NO  , UNIMAP_P1  , UNIMAP_PENT, UNIMAP_P2  , UNIMAP_P3  ,
-      UNIMAP_Z   , UNIMAP_LALT, UNIMAP_RCTL, UNIMAP_C   , UNIMAP_K   , UNIMAP_NO  , UNIMAP_N   , UNIMAP_B     },
+      UNIMAP_Z   , UNIMAP_LALT, UNIMAP_LCTL, UNIMAP_C   , UNIMAP_K   , UNIMAP_NO  , UNIMAP_N   , UNIMAP_B     },
     { UNIMAP_QUOT, UNIMAP_SLSH, UNIMAP_COMM, UNIMAP_NO  , UNIMAP_P4  , UNIMAP_PPLS, UNIMAP_P5  , UNIMAP_P6  ,
       UNIMAP_D   , UNIMAP_A   , UNIMAP_LSFT, UNIMAP_F   , UNIMAP_J   , UNIMAP_F1  , UNIMAP_H   , UNIMAP_G     },
     { UNIMAP_RSFT, UNIMAP_SCLN, UNIMAP_L   , UNIMAP_RBRC, UNIMAP_UP  , UNIMAP_NO  , UNIMAP_NO  , UNIMAP_NO  ,