aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarshit Goel <harshitgoel96@yahoo.com>2021-09-29 00:30:34 +0530
committerGitHub <noreply@github.com>2021-09-28 12:00:34 -0700
commitac1d48cbf550322c88b51d6ade56eebfb46969fa (patch)
treecee724d18c35939bdd348fa811df0368600906dd
parentadc7cc5981561a537a2d83647bd84df3d4447ded (diff)
downloadqmk_firmware-ac1d48cbf550322c88b51d6ade56eebfb46969fa.tar.gz
qmk_firmware-ac1d48cbf550322c88b51d6ade56eebfb46969fa.zip
[Keyboard] Pteron36 (#13475)
Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Harshti Goel <harshitgoel@licious.com>
-rw-r--r--keyboards/pteron36/config.h14
-rw-r--r--keyboards/pteron36/keymaps/default/keymap.c2
-rw-r--r--keyboards/pteron36/keymaps/via/keymap.c59
-rw-r--r--keyboards/pteron36/keymaps/via/readme.md2
-rw-r--r--keyboards/pteron36/keymaps/via/rules.mk2
-rw-r--r--keyboards/pteron36/pteron36.c51
-rw-r--r--keyboards/pteron36/readme.md13
-rw-r--r--keyboards/pteron36/rules.mk8
8 files changed, 136 insertions, 15 deletions
diff --git a/keyboards/pteron36/config.h b/keyboards/pteron36/config.h
index dcc9d68c7..d6f31514e 100644
--- a/keyboards/pteron36/config.h
+++ b/keyboards/pteron36/config.h
@@ -152,4 +152,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
152//#define BOOTMAGIC_LITE_ROW 0 152//#define BOOTMAGIC_LITE_ROW 0
153//#define BOOTMAGIC_LITE_COLUMN 0 153//#define BOOTMAGIC_LITE_COLUMN 0
154// for via 154// for via
155#define DYNAMIC_KEYMAP_LAYER_COUNT 7 \ No newline at end of file 155#define DYNAMIC_KEYMAP_LAYER_COUNT 7
156
157//left encoder
158#define ENCODERS_PAD_A { F5 }
159#define ENCODERS_PAD_B { F4 }
160
161//right encoder
162#define ENCODERS_PAD_A_RIGHT { F4 }
163#define ENCODERS_PAD_B_RIGHT { F5 }
164
165//RGB Underglow
166#define RGB_DI_PIN B6
167#define RGBLED_NUM 10 \ No newline at end of file
diff --git a/keyboards/pteron36/keymaps/default/keymap.c b/keyboards/pteron36/keymaps/default/keymap.c
index 11d00bb31..0cc0e2b47 100644
--- a/keyboards/pteron36/keymaps/default/keymap.c
+++ b/keyboards/pteron36/keymaps/default/keymap.c
@@ -32,4 +32,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
32 KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, 32 KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,
33 KC_Z, KC_X, KC_C, KC_V, KC_B,KC_LBRACKET, KC_RBRACKET, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, 33 KC_Z, KC_X, KC_C, KC_V, KC_B,KC_LBRACKET, KC_RBRACKET, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,
34 KC_LGUI, KC_BSPC, KC_SPC, KC_SPC, KC_ENT, KC_RALT 34 KC_LGUI, KC_BSPC, KC_SPC, KC_SPC, KC_ENT, KC_RALT
35 )}; \ No newline at end of file 35 )};
diff --git a/keyboards/pteron36/keymaps/via/keymap.c b/keyboards/pteron36/keymaps/via/keymap.c
index 1c614596e..9e467dcde 100644
--- a/keyboards/pteron36/keymaps/via/keymap.c
+++ b/keyboards/pteron36/keymaps/via/keymap.c
@@ -81,4 +81,61 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
81 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS 81 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
82 ) 82 )
83 83
84}; \ No newline at end of file 84};
85
86#ifdef OLED_DRIVER_ENABLE
87
88static void render_logo(void) {
89 static const char PROGMEM qmk_logo[] = {
90 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94,
91 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4,
92 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00
93 };
94
95 oled_write_P(qmk_logo, false);
96}
97static void render_status(void){
98 oled_write_P(PSTR("Layer: "), false);
99
100 switch (get_highest_layer(layer_state)) {
101 case _QWERTY:
102 oled_write_P(PSTR("Default\n"), false);
103 break;
104 case _SYMB:
105 oled_write_P(PSTR("Symbol\n"), false);
106 break;
107 case _NAV:
108 oled_write_P(PSTR("Nav\n"), false);
109 break;
110 case _ADJUST:
111 oled_write_P(PSTR("Adjust\n"), false);
112 break;
113 case _MOUSE:
114 oled_write_P(PSTR("Mouse\n"), false);
115 break;
116 case _NUMB:
117 oled_write_P(PSTR("Number\n"), false);
118 break;
119 case _FNR:
120 oled_write_P(PSTR("FunR\n"), false);
121 break;
122 default:
123 // Or use the write_ln shortcut over adding '\n' to the end of your string
124 oled_write_ln_P(PSTR("Undefined"), false);
125 }
126
127 // Host Keyboard LED Status
128 led_t led_state = host_keyboard_led_state();
129 oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
130 oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
131 oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
132}
133void oled_task_user(void) {
134 if (is_keyboard_master()) {
135 render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
136 } else {
137 render_logo(); // Renders a static logo
138 oled_scroll_left(); // Turns on scrolling
139 }
140}
141#endif
diff --git a/keyboards/pteron36/keymaps/via/readme.md b/keyboards/pteron36/keymaps/via/readme.md
index 32ab1253d..5bde19615 100644
--- a/keyboards/pteron36/keymaps/via/readme.md
+++ b/keyboards/pteron36/keymaps/via/readme.md
@@ -1 +1 @@
# Default keymap for Redox Wireless # Default keymap for via \ No newline at end of file
diff --git a/keyboards/pteron36/keymaps/via/rules.mk b/keyboards/pteron36/keymaps/via/rules.mk
index 43061db1d..36b7ba9cb 100644
--- a/keyboards/pteron36/keymaps/via/rules.mk
+++ b/keyboards/pteron36/keymaps/via/rules.mk
@@ -1,2 +1,2 @@
1VIA_ENABLE = yes 1VIA_ENABLE = yes
2LTO_ENABLE = yes \ No newline at end of file 2LTO_ENABLE = yes
diff --git a/keyboards/pteron36/pteron36.c b/keyboards/pteron36/pteron36.c
index 4f06d822d..3288626f0 100644
--- a/keyboards/pteron36/pteron36.c
+++ b/keyboards/pteron36/pteron36.c
@@ -14,4 +14,53 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17#include "pteron36.h" \ No newline at end of file 17#include "pteron36.h"
18
19//common encoder setup
20
21bool encoder_update_kb(uint8_t index, bool clockwise) {
22 if (!encoder_update_user(index, clockwise)) { return false; }
23 if (index == 0) { /* First encoder */
24 if (clockwise) {
25 tap_code(KC__VOLUP);
26 } else {
27 tap_code(KC__VOLDOWN);
28 }
29 } else if (index == 1) { /* Second encoder */
30 if (clockwise) {
31 tap_code(KC_PGUP);
32 } else {
33 tap_code(KC_PGDN);
34 }
35 }
36 return true;
37}
38//common oled support.
39#ifdef OLED_DRIVER_ENABLE
40__attribute__((weak)) void oled_task_user(void) {
41 if (is_keyboard_master()) {
42 oled_write_P(PSTR("Layer: "), false);
43 switch (get_highest_layer(layer_state)) {
44 case _QWERTY:
45 oled_write_ln_P(PSTR("Default"), false);
46 break;
47 default:
48 // Or use the write_ln shortcut over adding '\n' to the end of your string
49 oled_write_ln_P(PSTR("Undefined"), false);
50 }
51 // Host Keyboard LED Status
52 led_t led_state = host_keyboard_led_state();
53 oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
54 oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
55 oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
56 } else {
57 static const char PROGMEM qmk_logo[] = {
58 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94,
59 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4,
60 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00
61 };
62 oled_write_P(qmk_logo, false);
63 oled_scroll_left(); // Turns on scrolling
64 }
65}
66#endif
diff --git a/keyboards/pteron36/readme.md b/keyboards/pteron36/readme.md
index b9e919c75..a68c7a55b 100644
--- a/keyboards/pteron36/readme.md
+++ b/keyboards/pteron36/readme.md
@@ -20,12 +20,15 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to
20 20
21## Default Keymap and Miryoku Layout support 21## Default Keymap and Miryoku Layout support
22 22
23The keyboard was designed with miryoku layout in mind. The default layout is very basic and does not have much use. I will be opening a pr to make the keyboard available with miryoku layout soon. Currently to build the keyboard with miryoku you will have to checkout latest miryoku qmk repo, and add the keyboard folder there manually. After copying the folder run the following command 23The keyboard was designed with miryoku layout in mind. The default layout is very basic and does not have much use, modify the keymap as you see fit. Build keyboard with manna-harbour_miryoku as keymap, qmk should compile the firmare without any issue.
24
25 make pteron36:manna-harbour_miryoku
24 26
25 make pteron36:manna-harbour_miryoku
26
27Add miryoku params as required. 27Add miryoku params as required.
28Pteron36 uses community layout, hence there is no need for separate keymap folder for any keymap that support 5x3_3 layout.
29
30## VIA support
28 31
29## OLED and RotaryEncoder 32The VIA keymap is working as intended.
30 33
31I am working on adding OLED and RotaryEncoder support in keyboard config. 34 make pteron36:via
diff --git a/keyboards/pteron36/rules.mk b/keyboards/pteron36/rules.mk
index 64a21b2e9..278246b37 100644
--- a/keyboards/pteron36/rules.mk
+++ b/keyboards/pteron36/rules.mk
@@ -17,10 +17,10 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = no # USB Nkey Rollover 18NKRO_ENABLE = no # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality 19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow 20RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
21AUDIO_ENABLE = no # Audio output 21AUDIO_ENABLE = no # Audio output
22 22OLED_DRIVER_ENABLE = yes # OLED display
23OLED_ENABLE = no # OLED display; work in progress to add support. will be update in future. 23ENCODER_ENABLE = yes # Encoder support
24SPLIT_KEYBOARD = yes 24SPLIT_KEYBOARD = yes # Split enable
25 25
26LAYOUTS = split_3x5_3 26LAYOUTS = split_3x5_3