diff options
author | Ryan Caltabiano <rcalt2vt@gmail.com> | 2019-04-17 01:36:55 +0200 |
---|---|---|
committer | skullydazed <skullydazed@users.noreply.github.com> | 2019-04-20 17:05:10 +0200 |
commit | dd3a813f871b911012da55a499955307c309a7a5 (patch) | |
tree | 80df58d039a9b20283057809925a2351121135d5 /keyboards | |
parent | 0a645225b9c863a106921185a6c2e0c340f10694 (diff) | |
download | qmk_firmware-dd3a813f871b911012da55a499955307c309a7a5.tar.gz qmk_firmware-dd3a813f871b911012da55a499955307c309a7a5.tar.xz |
Reducing size of data send in one frame & update Zen rev2 oled usage
Diffstat (limited to 'keyboards')
-rwxr-xr-x | keyboards/sol/keymaps/brianweyer/keymap.c | 2 | ||||
-rw-r--r-- | keyboards/sol/keymaps/danielhklein/keymap.c | 2 | ||||
-rw-r--r-- | keyboards/sol/keymaps/default/keymap.c | 2 | ||||
-rw-r--r-- | keyboards/zen/rev2/config.h | 13 | ||||
-rw-r--r-- | keyboards/zen/rev2/rev2.c | 8 | ||||
-rw-r--r-- | keyboards/zen/rev2/rules.mk | 7 |
6 files changed, 8 insertions, 26 deletions
diff --git a/keyboards/sol/keymaps/brianweyer/keymap.c b/keyboards/sol/keymaps/brianweyer/keymap.c index 9fd6ad615..87d603d81 100755 --- a/keyboards/sol/keymaps/brianweyer/keymap.c +++ b/keyboards/sol/keymaps/brianweyer/keymap.c @@ -181,7 +181,7 @@ void matrix_init_user(void) { // OLED Driver Logic #ifdef OLED_DRIVER_ENABLE -uint8_t oled_init_user(uint8_t rotation) { +oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (!has_usb()) return OLED_ROTATION_180; // flip 180 for offhand return rotation; diff --git a/keyboards/sol/keymaps/danielhklein/keymap.c b/keyboards/sol/keymaps/danielhklein/keymap.c index cfc295323..9bcc5761a 100644 --- a/keyboards/sol/keymaps/danielhklein/keymap.c +++ b/keyboards/sol/keymaps/danielhklein/keymap.c @@ -246,7 +246,7 @@ void matrix_init_user(void) { // OLED Driver Logic #ifdef OLED_DRIVER_ENABLE -uint8_t oled_init_user(uint8_t rotation) { +oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (!has_usb()) return OLED_ROTATION_180; // flip 180 for offhand return rotation; diff --git a/keyboards/sol/keymaps/default/keymap.c b/keyboards/sol/keymaps/default/keymap.c index 1742fc597..a40bc40b7 100644 --- a/keyboards/sol/keymaps/default/keymap.c +++ b/keyboards/sol/keymaps/default/keymap.c @@ -254,7 +254,7 @@ void matrix_init_user(void) { // OLED Driver Logic #ifdef OLED_DRIVER_ENABLE -uint8_t oled_init_user(uint8_t rotation) { +oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (!has_usb()) return OLED_ROTATION_180; // flip 180 for offhand return rotation; diff --git a/keyboards/zen/rev2/config.h b/keyboards/zen/rev2/config.h index dc37472f6..5fa262760 100644 --- a/keyboards/zen/rev2/config.h +++ b/keyboards/zen/rev2/config.h @@ -66,19 +66,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* ws2812 RGB LED */ #define RGBLED_NUM 34 // Number of LEDs -// If using 90 Degree rotation, increase block cout -#ifdef OLED_ROTATE90 - #define OLED_DISPLAY_CUSTOM - #define OLED_DISPLAY_WIDTH 128 - #define OLED_DISPLAY_HEIGHT 32 - #define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 512 (compile time mathed) - #define OLED_BLOCK_TYPE uint16_t // Type to use for segmenting the oled display for smart rendering, use unsigned types only - #define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 8 (compile time mathed) - #define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed) - #define OLED_SOURCE_MAP { 0, 8, 16, 24 } - #define OLED_TARGET_MAP { 24, 16, 8, 0 } -#endif - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/zen/rev2/rev2.c b/keyboards/zen/rev2/rev2.c index 4104460db..7bd8efbdd 100644 --- a/keyboards/zen/rev2/rev2.c +++ b/keyboards/zen/rev2/rev2.c @@ -47,11 +47,11 @@ void render_status(void) { oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR("SCRLK") : PSTR(" "), false); // Line 16 } -#ifdef OLED_ROTATE90 -bool oled_init_user(bool flip180) { - return true; +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (is_keyboard_master()) + return OLED_ROTATION_90; // flips the display 90 degrees if mainhand + return rotation; } -#endif __attribute__((weak)) void oled_task_user(void) { diff --git a/keyboards/zen/rev2/rules.mk b/keyboards/zen/rev2/rules.mk index d1fe41052..e9d19a69a 100644 --- a/keyboards/zen/rev2/rules.mk +++ b/keyboards/zen/rev2/rules.mk @@ -1,14 +1,9 @@ ENCODER_ENABLE = yes OLED_DRIVER_ENABLE = no -OLED_ROTATE90 = yes -# Setup so that OLED and 90 degree rotation can be turned on/off easily -# with "OLED_DRIVER_ENABLE = yes" or "OLED_ROTATE90 = no" in user's rules.mk file +# Setup so that OLED can be turned on/off easily ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) # Custom local font file OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\" - ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) - OPT_DEFS += -DOLED_ROTATE90 - endif endif |