summaryrefslogtreecommitdiffstats
path: root/keyboards/treadstone48/keymaps/like_jis_rs
diff options
context:
space:
mode:
authormarksard <38324387+marksard@users.noreply.github.com>2020-01-14 03:06:40 +0900
committerDrashna Jaelre <drashna@live.com>2020-01-13 10:06:40 -0800
commit240e1ef6fd4b3356f3d21a50b0a0ad6c0673b1dd (patch)
tree2bb6492f22a39e389a8e5fe2bdb56e2de6558d55 /keyboards/treadstone48/keymaps/like_jis_rs
parent1b8cb95f2e56acf09bb66e779b800ae14aa074e5 (diff)
[Keyboard] Rebuild treadstone48 rev1 firmware (#7856)
* Keyboard: add treeadstone48 * rename layout defines * Use of pragma once * move common include code * fixed info.json * change keymap layout from kc to normal * fix alpha revision keymap * fixed info.json * remove USE_Link_Time_Optimization * I re-created treastone48 keyboard firmware from ./util/new_keyboard.sh After that I use common OLED_DRIVER, RGB_LIGHT and SPLIT_KEYBOARD options. And then check all keymap. * Modified by PR review
Diffstat (limited to 'keyboards/treadstone48/keymaps/like_jis_rs')
-rw-r--r--keyboards/treadstone48/keymaps/like_jis_rs/config.h53
-rw-r--r--keyboards/treadstone48/keymaps/like_jis_rs/keymap.c116
-rw-r--r--keyboards/treadstone48/keymaps/like_jis_rs/readme_jp.md4
-rw-r--r--keyboards/treadstone48/keymaps/like_jis_rs/rules.mk67
4 files changed, 77 insertions, 163 deletions
diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/config.h b/keyboards/treadstone48/keymaps/like_jis_rs/config.h
index e8acd5c76d..95b58c23db 100644
--- a/keyboards/treadstone48/keymaps/like_jis_rs/config.h
+++ b/keyboards/treadstone48/keymaps/like_jis_rs/config.h
@@ -1,22 +1,18 @@
-/*
-This is the c configuration file for the keymap
-
-Copyright 2012 Jun Wako <wakojun@gmail.com>
-Copyright 2015 Jack Humbert
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
+/* Copyright 2020 marksard
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
#pragma once
@@ -46,15 +42,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MOUSEKEY_DELAY 0
#endif
-// Selection of RGBLIGHT MODE to use.
-#if defined(LED_ANIMATIONS)
- //#define RGBLIGHT_EFFECT_BREATHING
- #define RGBLIGHT_EFFECT_RAINBOW_MOOD
- #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
- //#define RGBLIGHT_EFFECT_SNAKE
- #define RGBLIGHT_EFFECT_KNIGHT
- //#define RGBLIGHT_EFFECT_CHRISTMAS
- #define RGBLIGHT_EFFECT_STATIC_GRADIENT
- //#define RGBLIGHT_EFFECT_RGB_TEST
- //#define RGBLIGHT_EFFECT_ALTERNATING
-#endif
+// If you use the HashTwenty(alpha), please enable USE_HASHTWENTY
+// #define ANGELINA_KEYMAP
+
+// If you plug in the USB on the right side, please enable MASTER_RIGHT
+// #define RHYMESTONE_RIGHTHAND
+
+#define OLED_FONT_H "keyboards/treadstone48/common/glcdfont.c"
diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/keymap.c b/keyboards/treadstone48/keymaps/like_jis_rs/keymap.c
index 0e4ec063cc..354e40146f 100644
--- a/keyboards/treadstone48/keymaps/like_jis_rs/keymap.c
+++ b/keyboards/treadstone48/keymaps/like_jis_rs/keymap.c
@@ -1,9 +1,22 @@
+/* Copyright 2020 marksard
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
#include QMK_KEYBOARD_H
#include "keymap_jp.h"
#include "../common/oled_helper.h"
-extern keymap_config_t keymap_config;
-
#ifdef RGBLIGHT_ENABLE
//Following line allows macro to read current RGB settings
extern rgblight_config_t rgblight_config;
@@ -165,7 +178,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
#define L_ADJUST (1<<_ADJUST)
#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER)
-#ifdef SSD1306OLED
+#ifdef OLED_DRIVER_ENABLE
+#include <stdio.h>
+#include <string.h>
+
typedef struct {
uint8_t state;
char name[8];
@@ -204,18 +220,42 @@ static inline void update_keymap_status(void) {
keymap_config.swap_lalt_lgui? "win" : "mac", get_leyer_status());
}
-static inline void render_keymap_status(struct CharacterMatrix *matrix) {
+static inline void render_keymap_status(void) {
- matrix_write(matrix, layer_status_buf);
+ oled_write(layer_status_buf, false);
}
#define UPDATE_KEYMAP_STATUS() update_keymap_status()
-#define RENDER_KEYMAP_STATUS(a) render_keymap_status(a)
+
+static inline void render_status(void) {
+
+ UPDATE_LED_STATUS();
+ RENDER_LED_STATUS();
+ render_keymap_status();
+ UPDATE_LOCK_STATUS();
+ RENDER_LOCK_STATUS();
+ RENDER_KEY_STATUS();
+}
+
+oled_rotation_t oled_init_user(oled_rotation_t rotation) {
+
+// if (is_keyboard_master())
+// return OLED_ROTATION_180; // flips the display 180 degrees if offhand
+ return rotation;
+}
+
+void oled_task_user(void) {
+
+ if (is_keyboard_master()) {
+ render_status();
+ } else {
+ render_logo();
+ }
+}
#else
#define UPDATE_KEYMAP_STATUS()
-#define RENDER_KEYMAP_STATUS(a)
#endif
@@ -263,18 +303,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
break;
#ifdef RGBLIGHT_ENABLE
- case RGB_MOD:
- if (record->event.pressed) {
- rgblight_mode(RGB_current_mode);
- rgblight_step();
- RGB_current_mode = rgblight_config.mode;
- }
- break;
case RGBRST:
if (record->event.pressed) {
eeconfig_update_rgblight_default();
rgblight_enable();
- RGB_current_mode = rgblight_config.mode;
}
break;
#endif
@@ -286,57 +318,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
UPDATE_KEYMAP_STATUS();
return result;
}
-
-void matrix_init_user(void) {
- #ifdef RGBLIGHT_ENABLE
- RGB_current_mode = rgblight_config.mode;
- #endif
- //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
- #ifdef SSD1306OLED
- iota_gfx_init(!has_usb()); // turns on the display
- #endif
-}
-
-//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
-#ifdef SSD1306OLED
-
-void matrix_scan_user(void) {
- iota_gfx_task(); // this is what updates the display continuously
-}
-
-static inline void matrix_update(struct CharacterMatrix *dest,
- const struct CharacterMatrix *source) {
- if (memcmp(dest->display, source->display, sizeof(dest->display))) {
- memcpy(dest->display, source->display, sizeof(dest->display));
- dest->dirty = true;
- }
-}
-
-static inline void render_status(struct CharacterMatrix *matrix) {
-
- UPDATE_LED_STATUS();
- RENDER_LED_STATUS(matrix);
- RENDER_KEYMAP_STATUS(matrix);
- UPDATE_LOCK_STATUS();
- RENDER_LOCK_STATUS(matrix);
- RENDER_KEY_STATUS(matrix);
-}
-
-void iota_gfx_task_user(void) {
- struct CharacterMatrix matrix;
-
- #if DEBUG_TO_SCREEN
- if (debug_enable) {
- return;
- }
- #endif
-
- matrix_clear(&matrix);
- if (is_master) {
- render_status(&matrix);
- }
-
- matrix_update(&display, &matrix);
-}
-
-#endif
diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/readme_jp.md b/keyboards/treadstone48/keymaps/like_jis_rs/readme_jp.md
index 5a6fc1d73b..d3ce8eb3f8 100644
--- a/keyboards/treadstone48/keymaps/like_jis_rs/readme_jp.md
+++ b/keyboards/treadstone48/keymaps/like_jis_rs/readme_jp.md
@@ -4,9 +4,9 @@
 デフォルトキーマップの記号類をJISライクな配置に揃えなおしたものです。
 オプションのRhymestone用のマップを使用するために拡張しています。RhymestoneのpromicroにもTreadstone48のキーマップを入れてください。
- Rhymestoneは基本的には左手側を使うことを想定していますが、右手側を使用する場合はrules.mkにあるRHYMESTONE_RIGHTHAND設定をyesにすれば使えるようになります。
+ Rhymestoneは基本的には左手側を使うことを想定していますが、右手側を使用する場合はconfig.hの以下の行を有効にしてください。
-```RHYMESTONE_RIGHTHAND=yes```
+```#define RHYMESTONE_RIGHTHAND```
## キーマップの見かた
diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/rules.mk b/keyboards/treadstone48/keymaps/like_jis_rs/rules.mk
index c34bb2e34a..3f116d1902 100644
--- a/keyboards/treadstone48/keymaps/like_jis_rs/rules.mk
+++ b/keyboards/treadstone48/keymaps/like_jis_rs/rules.mk
@@ -1,67 +1,12 @@
-
-# Build Options
-# change to "no" to disable the options, or define them in the Makefile in
-# the appropriate keymap folder that will get included automatically
-#
-BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE = no # Mouse keys(+4700)
-EXTRAKEY_ENABLE = no # Audio control and System control(+450)
-CONSOLE_ENABLE = no # Console for debug(+400)
-COMMAND_ENABLE = no # Commands for debug and configuration
-NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
-MIDI_ENABLE = no # MIDI controls
-AUDIO_ENABLE = no # Audio output on port C6
-UNICODE_ENABLE = no # Unicode
-BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
-RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
-SWAP_HANDS_ENABLE = no # Enable one-hand typing
+MOUSEKEY_ENABLE = yes # Mouse keys
TAP_DANCE_ENABLE = yes
-# If your custom treadstone48 pcb, you can rewrite to yes.
-OLED_ENABLE = no # OLED_ENABLE
-LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.)
-LED_ANIMATIONS = yes # LED animations
-
-# Other selectable option
-IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone)
-LOCAL_GLCDFONT = no # use each keymaps "font.h" insted of "common/glcdfont.c"
-RHYMESTONE_RIGHTHAND = no # If connect right hand side of the Rhymestone, set to yes.
-ANGELINA_KEYMAP = no # If Alfa verstion use set to yes.
-
-ifeq ($(strip $(OLED_ENABLE)), yes)
- OPT_DEFS += -DOLED_ENABLE
-endif
-
-ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
- RGBLIGHT_ENABLE = yes
-else
- RGBLIGHT_ENABLE = no
-endif
-
-ifeq ($(strip $(LED_ANIMATIONS)), yes)
- # OPT_DEFS += -DRGBLIGHT_ANIMATIONS
- OPT_DEFS += -DLED_ANIMATIONS
-endif
-
-ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
- OPT_DEFS += -DIOS_DEVICE_ENABLE
-endif
-
-ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
- OPT_DEFS += -DLOCAL_GLCDFONT
-endif
-
-ifeq ($(strip $(RHYMESTONE_RIGHTHAND)), yes)
- OPT_DEFS += -DRHYMESTONE_RIGHTHAND
-endif
-
-ifeq ($(strip $(ANGELINA_KEYMAP)), yes)
- OPT_DEFS += -DANGELINA_KEYMAP
-endif
+RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
+OLED_DRIVER_ENABLE = no
+LTO_ENABLE = yes
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+# If you use connection the Rhymestone, please enable RS_EXTRA_LED
+OPT_DEFS += -DRS_EXTRA_LED
# If you want to change the display of OLED, you need to change here
SRC += ./common/oled_helper.c \