qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

centromere.c (1455B)


      1 #include "centromere.h"
      2 
      3 void led_init(void) {
      4 #if MCU == atmega32u2
      5     gpio_set_pin_output(C4); // Set red LED pin as output
      6     gpio_set_pin_output(C5); // Set blue LED pin as output
      7     gpio_set_pin_output(D1); // Set green LED pin as output
      8 
      9     gpio_write_pin_high(C4); // Turn off red LED pin
     10     gpio_write_pin_high(C5); // Turn off blue LED pin
     11     gpio_write_pin_high(D1); // Turn off green LED pin
     12 
     13 #else
     14 
     15     gpio_set_pin_output(F4); // Set red LED pin as output
     16     gpio_set_pin_output(F5); // Set blue LED pin as output
     17     gpio_set_pin_output(D1); // Set green LED pin as output
     18 
     19     gpio_write_pin_high(F4); // Turn off red LED pin
     20     gpio_write_pin_high(F5); // Turn off blue LED pin
     21     gpio_write_pin_high(D1); // Turn off green LED pin
     22 
     23 #endif
     24 
     25 }
     26 
     27 void matrix_init_kb(void) {
     28 	// put your keyboard start-up code here
     29 	// runs once when the firmware starts up
     30 	matrix_init_user();
     31 	led_init();
     32 }
     33 
     34 #ifdef SWAP_HANDS_ENABLE
     35 __attribute__ ((weak))
     36 const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
     37 {{9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
     38 {{9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
     39 {{9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
     40 {{9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}},
     41 {{9, 4}, {8, 4}, {7, 4}, {6, 4}, {5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}},
     42 };
     43 #endif