summaryrefslogtreecommitdiff
path: root/keyboards/crkbd/keymaps/default
diff options
context:
space:
mode:
authormarksard <38324387+marksard@users.noreply.github.com>2018-08-23 01:51:37 +0900
committerDrashna Jaelre <drashna@live.com>2018-08-22 09:51:37 -0700
commit6076ed85be111f0e88c7049aa3d2e69eed5005a1 (patch)
treeda704f8828a63245ea2333c883462b2f96591212 /keyboards/crkbd/keymaps/default
parent9d27d5544365b988575ca3face308d30feb40c86 (diff)
Keyboard: Partial refactor of the crkbd code (#3600)
* Add display to LED-parameters function * Improvement of update timing for OLED display (Need TWI_Init)
Diffstat (limited to 'keyboards/crkbd/keymaps/default')
-rw-r--r--keyboards/crkbd/keymaps/default/config.h6
-rw-r--r--keyboards/crkbd/keymaps/default/keymap.c33
-rw-r--r--keyboards/crkbd/keymaps/default/rules.mk13
3 files changed, 28 insertions, 24 deletions
diff --git a/keyboards/crkbd/keymaps/default/config.h b/keyboards/crkbd/keymaps/default/config.h
index 15aeb098bc..8d25f7cbc6 100644
--- a/keyboards/crkbd/keymaps/default/config.h
+++ b/keyboards/crkbd/keymaps/default/config.h
@@ -18,10 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef CONFIG_USER_H
-#define CONFIG_USER_H
-
-#include "../../config.h"
+#pragma once
/* Use I2C or Serial */
@@ -50,4 +47,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
-#endif
diff --git a/keyboards/crkbd/keymaps/default/keymap.c b/keyboards/crkbd/keymaps/default/keymap.c
index ac3b7215cd..87661d3451 100644
--- a/keyboards/crkbd/keymaps/default/keymap.c
+++ b/keyboards/crkbd/keymaps/default/keymap.c
@@ -1,24 +1,14 @@
-#include "crkbd.h"
+#include QMK_KEYBOARD_H
#include "bootloader.h"
-#include "action_layer.h"
-#include "action_util.h"
-#include "eeconfig.h"
#ifdef PROTOCOL_LUFA
-#include "lufa.h"
-#include "split_util.h"
+ #include "lufa.h"
+ #include "split_util.h"
#endif
-#include "LUFA/Drivers/Peripheral/TWI.h"
#ifdef SSD1306OLED
+ #include "LUFA/Drivers/Peripheral/TWI.h"
#include "ssd1306.h"
#endif
-#include "../lib/mode_icon_reader.c"
-#include "../lib/layer_state_reader.c"
-#include "../lib/host_led_state_reader.c"
-#include "../lib/logo_reader.c"
-#include "../lib/keylogger.c"
-#include "../lib/timelogger.c"
-
extern keymap_config_t keymap_config;
#ifdef RGBLIGHT_ENABLE
@@ -148,12 +138,25 @@ void matrix_init_user(void) {
//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
#ifdef SSD1306OLED
+// When add source files to SRC in rules.mk, you can use functions.
+const char *read_layer_state(void);
+const char *read_logo(void);
+void set_keylog(uint16_t keycode, keyrecord_t *record);
+const char *read_keylog(void);
+const char *read_keylogs(void);
+
+// const char *read_mode_icon(bool swap);
+// const char *read_host_led_state(void);
+// void set_timelog(void);
+// const char *read_timelog(void);
+
void matrix_scan_user(void) {
iota_gfx_task();
}
void matrix_render_user(struct CharacterMatrix *matrix) {
if (is_master) {
+ // If you want to change the display of OLED, you need to change here
matrix_write_ln(matrix, read_layer_state());
matrix_write_ln(matrix, read_keylog());
matrix_write_ln(matrix, read_keylogs());
@@ -182,7 +185,7 @@ void iota_gfx_task_user(void) {
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
set_keylog(keycode, record);
- set_timelog();
+ // set_timelog();
}
switch (keycode) {
diff --git a/keyboards/crkbd/keymaps/default/rules.mk b/keyboards/crkbd/keymaps/default/rules.mk
index 33ddd82a43..6570e2f5cb 100644
--- a/keyboards/crkbd/keymaps/default/rules.mk
+++ b/keyboards/crkbd/keymaps/default/rules.mk
@@ -15,11 +15,16 @@ 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
-ONEHAND_ENABLE = no # Enable one-hand typing
+SWAP_HANDS_ENABLE = no # Enable one-hand typing
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
-ifndef QUANTUM_DIR
- include ../../../../Makefile
-endif
+# If you want to change the display of OLED, you need to change here
+SRC += ../lib/rgb_state_reader.c \
+ ../lib/layer_state_reader.c \
+ ../lib/logo_reader.c \
+ ../lib/keylogger.c \
+ # ../lib/mode_icon_reader.c \
+ # ../lib/host_led_state_reader.c \
+ # ../lib/timelogger.c \