Skip to content

Commit

Permalink
fix avr oled
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Aug 19, 2021
1 parent 4b68c3b commit a54bf3a
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 31 deletions.
6 changes: 4 additions & 2 deletions keyboards/yandrstudio/hotdox76_V2/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@

# define MASTER_LEFT

# define USE_SERIAL

# define SOFT_SERIAL_PIN D2

# define SPLIT_MODS_ENABLE
Expand All @@ -113,8 +115,8 @@

#ifdef OLED_DRIVER_ENABLE

# define OLED_BRIGHTNESS 200
# define OLED_TIMEOUT 120000
// # define OLED_BRIGHTNESS 200
// # define OLED_TIMEOUT 120000

#endif

Expand Down
26 changes: 20 additions & 6 deletions keyboards/yandrstudio/hotdox76_V2/hotdox76_V2.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ led_config_t g_led_config = {

#endif

// #define I_AM_LEFT

#ifdef OLED_DRIVER_ENABLE

Expand All @@ -70,9 +69,9 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {

cur_alp_index = 1;
# ifdef I_AM_LEFT
return OLED_ROTATION_0;
# else
return OLED_ROTATION_180;
# else
return OLED_ROTATION_0;
# endif
}

Expand Down Expand Up @@ -124,7 +123,7 @@ void render_layer(uint8_t layer) {
break;
case 3:
default:
render_layer_helper_fun(1, PSTR("4:OTHERS"), 0);
render_layer_helper_fun(1, PSTR("OTHER"), 18);
break;
}
}
Expand Down Expand Up @@ -164,6 +163,7 @@ void oled_task_user(void) {
}



static const char PROGMEM code_to_name[0xFF] = {
// 0 1 2 3 4 5 6 7 8 9 A B c D E F
UNC, UNC, UNC, UNC, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x
Expand All @@ -184,6 +184,9 @@ static const char PROGMEM code_to_name[0xFF] = {
UNC, UNC, UNC, UNC, UNC, UNC, UNC, UNC, UNC, UNC, UNC, UNC, UNC, UNC, UNC // Fx
};




void get_cur_alp_hook(uint16_t keycode) {
if (keycode >= 0xF0) {
keycode = 0xF0;
Expand All @@ -199,19 +202,21 @@ void get_cur_alp_hook(uint16_t keycode) {
}
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {

get_cur_alp_hook(keycode);
return true;

}

void matrix_scan_user(void) {

void matrix_scan_kb(void) {
if(!is_oled_on()) {
cur_alp_index = 1;
}
}


#endif

bool is_keyboard_left(void) {
Expand All @@ -224,3 +229,12 @@ bool is_keyboard_left(void) {

}


// void keyboard_post_init_kb(void) {
// // eeconfig_init();
// // Customise these values to desired behaviour
// // debug_enable=true;
// // debug_matrix=false;
// // debug_keyboard=true;
// //debug_mouse=true;
// }
5 changes: 1 addition & 4 deletions keyboards/yandrstudio/hotdox76_V2/info-via.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
"name": "hotdox76-V2_Y&R",
"vendorId": "0xAA96",
"productId": "0xAAA9",
"lighting": {
"extends": "none",
"keycodes": "qmk"
},
"lighting": "qmk_rgblight",
"matrix": {
"rows": 12,
"cols": 7
Expand Down
10 changes: 5 additions & 5 deletions keyboards/yandrstudio/hotdox76_V2/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | |ace | End | | PgDn | | |
* `--------------------' `----------------------'
*/
[HOME] = LAYOUT(
LAYOUT(
// left hand
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
KC_EQL, RGB_TOG, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1),
KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G,
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO),
Expand Down Expand Up @@ -70,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | |
* `--------------------' `--------------------'
*/
[CODE] = LAYOUT(
LAYOUT(
// left hand
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS,
Expand Down Expand Up @@ -111,7 +111,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | |
* `--------------------' `--------------------'
*/
[OFFICE] = LAYOUT(
LAYOUT(
// left hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
Expand Down Expand Up @@ -152,7 +152,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | |
* `--------------------' `--------------------'
*/
[OTHER] = LAYOUT(
LAYOUT(
// left hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
Expand Down
5 changes: 1 addition & 4 deletions keyboards/yandrstudio/hotdox76_V2/oled_font_lib/ext_font.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "progmem.h"
/*
!(0) "(1) #(2) $(3) %(4) &(5) '(6) ((7)
)(8) *(9) +(10) ,(11) -(12) .(13) /(14) 0(15)
Expand All @@ -29,7 +28,7 @@
q(80) r(81) s(82) t(83) u(84) v(85) w(86) x(87)
y(88) z(89) {(90) |(91) }(92) ~(93)
*/
static const unsigned char ext_big_font[][24] PROGMEM = {
static const unsigned char ext_big_font[][24] = {
{0x00,0x00,0x00,0x00,0xFC,0xFC,0xFC,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00,0x00},/*"!",0*/
{0x00,0x00,0x00,0x18,0xF8,0x18,0x00,0x18,0xF8,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*""",1*/
{0x00,0x00,0x60,0x60,0xFE,0xFE,0x60,0xFE,0xFE,0x60,0x00,0x00,0x00,0x00,0x06,0x7F,0x7F,0x06,0x7F,0x7F,0x06,0x06,0x00,0x00},/*"#",2*/
Expand Down Expand Up @@ -127,6 +126,4 @@ static const unsigned char ext_big_font[][24] PROGMEM = {
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",94*/
};



static const unsigned char blank_block PROGMEM = 0x00;
6 changes: 1 addition & 5 deletions keyboards/yandrstudio/hotdox76_V2/oled_font_lib/logo.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,23 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "progmem.h"

static const unsigned char logo_idobao[] PROGMEM = {
static const unsigned char logo_idobao[] = {
0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xE0, 0xE0,
0xF0, 0xF0, 0x70, 0x60, 0x04, 0x0E, 0x0E, 0x1E,
0x8E, 0x8E, 0xC4, 0xC0, 0xE0, 0xF0, 0xF0, 0xF0,
0xE0, 0xE0, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00,


0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0x03, 0x01,
0xF0, 0xF8, 0xFC, 0xFC, 0x1E, 0x1E, 0x0F, 0x0F,
0x07, 0x07, 0x03, 0x03, 0x01, 0x01, 0x00, 0x01,
0x01, 0x03, 0x1F, 0xFF, 0xFF, 0xFF, 0xFE, 0x00,


0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0xC0, 0xE0, 0xF8, 0xFF, 0xFF, 0xFF, 0x7F, 0x00,


0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00,
0x0F, 0x0F, 0x1F, 0x1F, 0x3E, 0x3C, 0x7C, 0x7C,
0x7C, 0x7C, 0x3C, 0x3E, 0x1E, 0x1F, 0x0F, 0x0F,
Expand Down
6 changes: 3 additions & 3 deletions keyboards/yandrstudio/hotdox76_V2/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ ARCH = AVR8

F_USB = $(F_CPU)


# Boot Section Size in *bytes*
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Bootloader selection
BOOTLOADER = caterina

# Build Options
# comment out to disable the options.
Expand All @@ -21,6 +20,7 @@ CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
OLED_DRIVER_ENABLE = yes # Enable Support for SSD1306 or SH1106 OLED Displays; Communicating over I2C

SPLIT_KEYBOARD = yes


6 changes: 4 additions & 2 deletions keyboards/yandrstudio/rainbow65/keymaps/test_font/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ bool encoder_update_user(uint8_t index, bool clockwise) {

// #define I_AM_LEFT



#ifdef OLED_DRIVER_ENABLE

# define UNC (94+0x21)
Expand All @@ -95,9 +97,9 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {

cur_alp_index = 1;
# ifdef I_AM_LEFT
return OLED_ROTATION_0;
# else
return OLED_ROTATION_180;
# else
return OLED_ROTATION_0;
# endif
}

Expand Down

0 comments on commit a54bf3a

Please sign in to comment.