summaryrefslogtreecommitdiffstats
path: root/keyboards/treadstone48
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
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')
-rw-r--r--keyboards/treadstone48/common/oled_helper.c25
-rw-r--r--keyboards/treadstone48/common/oled_helper.h28
-rw-r--r--keyboards/treadstone48/config.h43
-rw-r--r--keyboards/treadstone48/i2c.c162
-rw-r--r--keyboards/treadstone48/i2c.h46
-rw-r--r--keyboards/treadstone48/keymaps/default/config.h54
-rw-r--r--keyboards/treadstone48/keymaps/default/keymap.c115
-rw-r--r--keyboards/treadstone48/keymaps/default/rules.mk48
-rw-r--r--keyboards/treadstone48/keymaps/like_jis/config.h55
-rw-r--r--keyboards/treadstone48/keymaps/like_jis/keymap.c116
-rw-r--r--keyboards/treadstone48/keymaps/like_jis/rules.mk66
-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
-rw-r--r--keyboards/treadstone48/rev1/config.h275
-rw-r--r--keyboards/treadstone48/rev1/matrix.c357
-rw-r--r--keyboards/treadstone48/rev1/rev1.c30
-rw-r--r--keyboards/treadstone48/rev1/rev1.h43
-rw-r--r--keyboards/treadstone48/rev1/rules.mk3
-rw-r--r--keyboards/treadstone48/rev1/serial_config.h8
-rw-r--r--keyboards/treadstone48/rev1/serial_config_simpleapi.h8
-rw-r--r--keyboards/treadstone48/rev1/split_scomm.c92
-rw-r--r--keyboards/treadstone48/rev1/split_scomm.h21
-rw-r--r--keyboards/treadstone48/rev1/split_util.c70
-rw-r--r--keyboards/treadstone48/rev1/split_util.h16
-rw-r--r--keyboards/treadstone48/rules.mk40
-rw-r--r--keyboards/treadstone48/serial.c589
-rw-r--r--keyboards/treadstone48/serial.h86
-rw-r--r--keyboards/treadstone48/ssd1306.c342
-rw-r--r--keyboards/treadstone48/ssd1306.h90
-rw-r--r--keyboards/treadstone48/treadstone48.c1
-rw-r--r--keyboards/treadstone48/treadstone48.h15
33 files changed, 513 insertions, 2571 deletions
diff --git a/keyboards/treadstone48/common/oled_helper.c b/keyboards/treadstone48/common/oled_helper.c
index 500d3c0dc1..18d8681a4f 100644
--- a/keyboards/treadstone48/common/oled_helper.c
+++ b/keyboards/treadstone48/common/oled_helper.c
@@ -1,8 +1,9 @@
-#ifdef SSD1306OLED
+#ifdef OLED_DRIVER_ENABLE
#include QMK_KEYBOARD_H
-#include "ssd1306.h"
+#include <stdio.h>
+#include <string.h>
-void render_logo(struct CharacterMatrix *matrix) {
+void render_logo(void) {
const char logo_buf[]={
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
@@ -10,10 +11,10 @@ void render_logo(struct CharacterMatrix *matrix) {
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,
0};
- matrix_write(matrix, logo_buf);
+ oled_write(logo_buf, false);
}
-static char keylog_buf[24] = "Key state ready.";
+static char keylog_buf[24] = "Key state ready.\n";
const char code_to_name[60] = {
' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
@@ -27,14 +28,14 @@ void update_key_status(uint16_t keycode, keyrecord_t *record) {
if (!record->event.pressed) return;
char name = (keycode < 60) ? code_to_name[keycode] : ' ';
- snprintf(keylog_buf, sizeof(keylog_buf) - 1, "Key:%dx%d %2x %c",
+ snprintf(keylog_buf, sizeof(keylog_buf) - 1, "Key:%dx%d %2x %c\n",
record->event.key.row, record->event.key.col,
(uint16_t)keycode, name);
}
-void render_key_status(struct CharacterMatrix *matrix) {
+void render_key_status(void) {
- matrix_write(matrix, keylog_buf);
+ oled_write(keylog_buf, false);
}
static char lock_buf[24] = "Lock state ready.\n";
@@ -48,9 +49,9 @@ void update_lock_status(void) {
num_lock, caps_lock, scrl_lock);
}
-void render_lock_status(struct CharacterMatrix *matrix) {
+void render_lock_status(void) {
- matrix_write(matrix, lock_buf);
+ oled_write(lock_buf, false);
}
#ifdef RGBLIGHT_ENABLE
@@ -75,9 +76,9 @@ void update_led_status(void) {
}
}
-void render_led_status(struct CharacterMatrix *matrix) {
+void render_led_status(void) {
- matrix_write(matrix, led_buf);
+ oled_write(led_buf, false);
}
#endif
#endif
diff --git a/keyboards/treadstone48/common/oled_helper.h b/keyboards/treadstone48/common/oled_helper.h
index 44628a5261..69ab705606 100644
--- a/keyboards/treadstone48/common/oled_helper.h
+++ b/keyboards/treadstone48/common/oled_helper.h
@@ -1,35 +1,35 @@
-#ifdef SSD1306OLED
+#ifdef OLED_DRIVER_ENABLE
-void render_logo(struct CharacterMatrix *matrix);
+void render_logo(void);
void update_key_status(uint16_t keycode, keyrecord_t *record);
-void render_key_status(struct CharacterMatrix *matrix);
+void render_key_status(void);
void update_lock_status(void);
-void render_lock_status(struct CharacterMatrix *matrix);
+void render_lock_status(void);
-#define RENDER_LOGO(a) render_logo(a)
+#define RENDER_LOGO() render_logo()
#define UPDATE_KEY_STATUS(a, b) update_key_status(a, b)
-#define RENDER_KEY_STATUS(a) render_key_status(a)
+#define RENDER_KEY_STATUS() render_key_status()
#define UPDATE_LOCK_STATUS() update_lock_status()
-#define RENDER_LOCK_STATUS(a) render_lock_status(a)
+#define RENDER_LOCK_STATUS() render_lock_status()
#ifdef RGBLIGHT_ENABLE
void update_led_status(void);
- void render_led_status(struct CharacterMatrix *matrix);
+ void render_led_status(void);
#define UPDATE_LED_STATUS() update_led_status()
- #define RENDER_LED_STATUS(a) render_led_status(a)
+ #define RENDER_LED_STATUS() render_led_status()
#else
#define UPDATE_LED_STATUS()
- #define RENDER_LED_STATUS(a)
+ #define RENDER_LED_STATUS()
#endif
#else
-#define RENDER_LOGO(a)
+#define RENDER_LOGO()
#define UPDATE_KEY_STATUS(a, b)
-#define RENDER_KEY_STATUS(a)
+#define RENDER_KEY_STATUS()
#define UPDATE_LOCK_STATUS()
-#define RENDER_LOCK_STATUS(a)
+#define RENDER_LOCK_STATUS()
#define UPDATE_LED_STATUS()
-#define RENDER_LED_STATUS(a)
+#define RENDER_LED_STATUS()
#endif
diff --git a/keyboards/treadstone48/config.h b/keyboards/treadstone48/config.h
deleted file mode 100644
index 2e571e2690..0000000000
--- a/keyboards/treadstone48/config.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-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/>.
-*/
-
-#pragma once
-
-#include "config_common.h"
-
-// GCC include 'config.h" sequence in qmk_firmware/keyboards/treadstone48/
-// -include keyboards/treadstone48/config.h
-// -include keyboards/treadstone48/rev?/config.h
-// -include keyboards/treadstone48/rev?/keymaps/MAPNAME/config.h
-// XXXX.c
-
-#include <serial_config.h>
-
-// GCC include search path in qmk_firmare/keyboards/treadstone48/
-// #include "..." search starts here:
-// #include <...> search starts here:
-// keyboards/treadstone48/rev?/keymaps/MAPNAME
-// keyboards/treadstone48
-// keyboards/treadstone48/rev?
-// .
-// ./tmk_core
-// ......
-
-// MACRO and FUNCTION are features that are depreciated.
-#define NO_ACTION_MACRO
-#define NO_ACTION_FUNCTION
diff --git a/keyboards/treadstone48/i2c.c b/keyboards/treadstone48/i2c.c
deleted file mode 100644
index 4bee5c6398..0000000000
--- a/keyboards/treadstone48/i2c.c
+++ /dev/null
@@ -1,162 +0,0 @@
-#include <util/twi.h>
-#include <avr/io.h>
-#include <stdlib.h>
-#include <avr/interrupt.h>
-#include <util/twi.h>
-#include <stdbool.h>
-#include "i2c.h"
-
-#ifdef USE_I2C
-
-// Limits the amount of we wait for any one i2c transaction.
-// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is
-// 9 bits, a single transaction will take around 90μs to complete.
-//
-// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit
-// poll loop takes at least 8 clock cycles to execute
-#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8
-
-#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE)
-
-volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
-
-static volatile uint8_t slave_buffer_pos;
-static volatile bool slave_has_register_set = false;
-
-// Wait for an i2c operation to finish
-inline static
-void i2c_delay(void) {
- uint16_t lim = 0;
- while(!(TWCR & (1<<TWINT)) && lim < I2C_LOOP_TIMEOUT)
- lim++;
-
- // easier way, but will wait slightly longer
- // _delay_us(100);
-}
-
-// Setup twi to run at 100kHz or 400kHz (see ./i2c.h SCL_CLOCK)
-void i2c_master_init(void) {
- // no prescaler
- TWSR = 0;
- // Set TWI clock frequency to SCL_CLOCK. Need TWBR>10.
- // Check datasheets for more info.
- TWBR = ((F_CPU/SCL_CLOCK)-16)/2;
-}
-
-// Start a transaction with the given i2c slave address. The direction of the
-// transfer is set with I2C_READ and I2C_WRITE.
-// returns: 0 => success
-// 1 => error
-uint8_t i2c_master_start(uint8_t address) {
- TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTA);
-
- i2c_delay();
-
- // check that we started successfully
- if ( (TW_STATUS != TW_START) && (TW_STATUS != TW_REP_START))
- return 1;
-
- TWDR = address;
- TWCR = (1<<TWINT) | (1<<TWEN);
-
- i2c_delay();
-
- if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) )
- return 1; // slave did not acknowledge
- else
- return 0; // success
-}
-
-
-// Finish the i2c transaction.
-void i2c_master_stop(void) {
- TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
-
- uint16_t lim = 0;
- while(!(TWCR & (1<<TWSTO)) && lim < I2C_LOOP_TIMEOUT)
- lim++;
-}
-
-// Write one byte to the i2c slave.
-// returns 0 => slave ACK
-// 1 => slave NACK
-uint8_t i2c_master_write(uint8_t data) {
- TWDR = data;
- TWCR = (1<<TWINT) | (1<<TWEN);
-
- i2c_delay();
-
- // check if the slave acknowledged us
- return (TW_STATUS == TW_MT_DATA_ACK) ? 0 : 1;
-}
-
-// Read one byte from the i2c slave. If ack=1 the slave is acknowledged,
-// if ack=0 the acknowledge bit is not set.
-// returns: byte read from i2c device
-uint8_t i2c_master_read(int ack) {
- TWCR = (1<<TWINT) | (1<<TWEN) | (ack<<TWEA);
-
- i2c_delay();
- return TWDR;
-}
-
-void i2c_reset_state(void) {
- TWCR = 0;
-}
-
-void i2c_slave_init(uint8_t address) {
- TWAR = address << 0; // slave i2c address
- // TWEN - twi enable
- // TWEA - enable address acknowledgement
- // TWINT - twi interrupt flag
- // TWIE - enable the twi interrupt
- TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN);
-}
-
-ISR(TWI_vect);
-
-ISR(TWI_vect) {
- uint8_t ack = 1;
- switch(TW_STATUS) {
- case TW_SR_SLA_ACK:
- // this device has been addressed as a slave receiver
- slave_has_register_set = false;
- break;
-
- case TW_SR_DATA_ACK:
- // this device has received data as a slave receiver
- // The first byte that we receive in this transaction sets the location
- // of the read/write location of the slaves memory that it exposes over
- // i2c. After that, bytes will be written at slave_buffer_pos, incrementing
- // slave_buffer_pos after each write.
- if(!slave_has_register_set) {
- slave_buffer_pos = TWDR;
- // don't acknowledge the master if this memory loctaion is out of bounds
- if ( slave_buffer_pos >= SLAVE_BUFFER_SIZE ) {
- ack = 0;
- slave_buffer_pos = 0;
- }
- slave_has_register_set = true;
- } else {
- i2c_slave_buffer[slave_buffer_pos] = TWDR;
- BUFFER_POS_INC();
- }
- break;
-
- case TW_ST_SLA_ACK:
- case TW_ST_DATA_ACK:
- // master has addressed this device as a slave transmitter and is
- // requesting data.
- TWDR = i2c_slave_buffer[slave_buffer_pos];
- BUFFER_POS_INC();
- break;
-
- case TW_BUS_ERROR: // something went wrong, reset twi state
- TWCR = 0;
- default:
- break;
- }
- // Reset everything, so we are ready for the next TWI interrupt
- TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN);
-}
-#endif
diff --git a/keyboards/treadstone48/i2c.h b/keyboards/treadstone48/i2c.h
deleted file mode 100644
index 710662c7ab..0000000000
--- a/keyboards/treadstone48/i2c.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#pragma once
-
-#include <stdint.h>
-
-#ifndef F_CPU
-#define F_CPU 16000000UL
-#endif
-
-#define I2C_READ 1
-#define I2C_WRITE 0
-
-#define I2C_ACK 1
-#define I2C_NACK 0
-
-#define SLAVE_BUFFER_SIZE 0x10
-
-// i2c SCL clock frequency 400kHz
-#define SCL_CLOCK 400000L
-
-extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
-
-void i2c_master_init(void);
-uint8_t i2c_master_start(uint8_t address);
-void i2c_master_stop(void);
-uint8_t i2c_master_write(uint8_t data);
-uint8_t i2c_master_read(int);
-void i2c_reset_state(void);
-void i2c_slave_init(uint8_t address);
-
-
-static inline unsigned char i2c_start_read(unsigned char addr) {
- return i2c_master_start((addr << 1) | I2C_READ);
-}
-
-static inline unsigned char i2c_start_write(unsigned char addr) {
- return i2c_master_start((addr << 1) | I2C_WRITE);
-}
-
-// from SSD1306 scrips
-extern unsigned char i2c_rep_start(unsigned char addr);
-extern void i2c_start_wait(unsigned char addr);
-extern unsigned char i2c_readAck(void);
-extern unsigned char i2c_readNak(void);
-extern unsigned char i2c_read(unsigned char ack);
-
-#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
diff --git a/keyboards/treadstone48/keymaps/default/config.h b/keyboards/treadstone48/keymaps/default/config.h
index e22040cdd6..baa4ec8461 100644
--- a/keyboards/treadstone48/keymaps/default/config.h
+++ b/keyboards/treadstone48/keymaps/default/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
@@ -26,7 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#undef TAPPING_TERM
#endif
#define TAPPING_TERM 225
-// #define IGNORE_MOD_TAP_INTERRUPT
#ifdef MOUSEKEY_ENABLE
#undef MOUSEKEY_INTERVAL
@@ -45,15 +40,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/default/keymap.c b/keyboards/treadstone48/keymaps/default/keymap.c
index 6143307528..100434246d 100644
--- a/keyboards/treadstone48/keymaps/default/keymap.c
+++ b/keyboards/treadstone48/keymaps/default/keymap.c
@@ -1,8 +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"
-
#ifdef RGBLIGHT_ENABLE
//Following line allows macro to read current RGB settings
extern rgblight_config_t rgblight_config;
@@ -115,7 +129,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];
@@ -152,18 +169,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
@@ -198,18 +239,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
@@ -221,57 +254,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/default/rules.mk b/keyboards/treadstone48/keymaps/default/rules.mk
index 38ef4cc9fe..474e71ab11 100644
--- a/keyboards/treadstone48/keymaps/default/rules.mk
+++ b/keyboards/treadstone48/keymaps/default/rules.mk
@@ -1,49 +1,9 @@
+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
-
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
+OLED_DRIVER_ENABLE = no
+LTO_ENABLE = yes
# If you want to change the display of OLED, you need to change here
SRC += ./common/oled_helper.c \
diff --git a/keyboards/treadstone48/keymaps/like_jis/config.h b/keyboards/treadstone48/keymaps/like_jis/config.h
index 3f63a0cfbb..baa4ec8461 100644
--- a/keyboards/treadstone48/keymaps/like_jis/config.h
+++ b/keyboards/treadstone48/keymaps/like_jis/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
@@ -26,8 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#undef TAPPING_TERM
#endif
#define TAPPING_TERM 225
-// #define PREVENT_STUCK_MODIFIERS
-// #define IGNORE_MOD_TAP_INTERRUPT
#ifdef MOUSEKEY_ENABLE
#undef MOUSEKEY_INTERVAL
@@ -46,15 +40,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/keymap.c b/keyboards/treadstone48/keymaps/like_jis/keymap.c
index b63b0c9f49..6cde28d24b 100644
--- a/keyboards/treadstone48/keymaps/like_jis/keymap.c
+++ b/keyboards/treadstone48/keymaps/like_jis/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"