rev2.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include "rev2.h"
  2. // Tested and verified working on ext65rev2
  3. void matrix_io_delay(void) { __asm__ volatile("nop\nnop\nnop\n"); }
  4. #ifdef OLED_DRIVER_ENABLE
  5. void board_init(void) {
  6. SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP;
  7. SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP);
  8. }
  9. oled_rotation_t oled_init_user(oled_rotation_t rotation) {
  10. return OLED_ROTATION_90; // rotates the display 90 degrees
  11. }
  12. #else
  13. void keyboard_pre_init_user(void) {
  14. // Call the keyboard pre init code.
  15. // Set our LED pins as output
  16. setPinOutput(B4);
  17. setPinOutput(B3);
  18. setPinOutput(A15);
  19. setPinOutput(A14);
  20. }
  21. bool led_update_kb(led_t led_state) {
  22. bool res = led_update_user(led_state);
  23. if(res) {
  24. writePin(B4, led_state.num_lock);
  25. writePin(B3, led_state.caps_lock);
  26. writePin(A15, led_state.scroll_lock);
  27. }
  28. return res;
  29. }
  30. layer_state_t layer_state_set_kb(layer_state_t state) {
  31. switch (get_highest_layer(state)) {
  32. case 1:
  33. writePinHigh(A14);
  34. break;
  35. default: // for any other layers, or the default layer
  36. writePinLow(A14);
  37. break;
  38. }
  39. return layer_state_set_user(state);
  40. }
  41. #endif