aboutsummaryrefslogtreecommitdiff
path: root/keyboards/aeboards/ext65/rev2/rev2.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/aeboards/ext65/rev2/rev2.c')
-rw-r--r--keyboards/aeboards/ext65/rev2/rev2.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/keyboards/aeboards/ext65/rev2/rev2.c b/keyboards/aeboards/ext65/rev2/rev2.c
new file mode 100644
index 000000000..f303a122e
--- /dev/null
+++ b/keyboards/aeboards/ext65/rev2/rev2.c
@@ -0,0 +1,48 @@
1#include "rev2.h"
2
3// Tested and verified working on ext65rev2
4void matrix_io_delay(void) { __asm__ volatile("nop\nnop\nnop\n"); }
5
6#ifdef OLED_ENABLE
7void board_init(void) {
8 SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP;
9 SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP);
10}
11
12oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
13 return OLED_ROTATION_90; // rotates the display 90 degrees
14}
15
16#else
17
18void keyboard_pre_init_user(void) {
19 // Call the keyboard pre init code.
20 // Set our LED pins as output
21 setPinOutput(B4);
22 setPinOutput(B3);
23 setPinOutput(A15);
24 setPinOutput(A14);
25}
26
27bool led_update_kb(led_t led_state) {
28 bool res = led_update_user(led_state);
29 if(res) {
30 writePin(B4, led_state.num_lock);
31 writePin(B3, led_state.caps_lock);
32 writePin(A15, led_state.scroll_lock);
33 }
34 return res;
35}
36
37layer_state_t layer_state_set_kb(layer_state_t state) {
38 switch (get_highest_layer(state)) {
39 case 1:
40 writePinHigh(A14);
41 break;
42 default: // for any other layers, or the default layer
43 writePinLow(A14);
44 break;
45 }
46 return layer_state_set_user(state);
47}
48#endif