Skip to content

Commit

Permalink
Merge pull request #46 from zsa/fix/oled_driver_for_splits
Browse files Browse the repository at this point in the history
Fix issuse with OLED Driver and Split Keyboard code
  • Loading branch information
fdidron authored May 20, 2019
2 parents 3662999 + a90a78c commit 24d05fe
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
05-05-2019 - New keycode macro (XP) for shifted character pairs using UNICODEMAP, and bugfixes/improvements
05-05-2019 - Add `LINK_TIME_OPTIMIZATION_ENABLE` to enable LTO and disable problematic features that cause LTO to fail
05-05-2019 - Fix issue with Space Cadet
05-16-2019 - Add RGB Light Effect Range functionality
05-06-2019 - Changes to Split Common and OLED code
05-16-2019 - Add RGB Light Effect Range functionality
16 changes: 0 additions & 16 deletions quantum/quantum.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,6 @@ bool process_record_quantum(keyrecord_t *record) {
preprocess_tap_dance(keycode, record);
#endif

#if defined(OLED_DRIVER_ENABLE) && !defined(OLED_DISABLE_TIMEOUT)
// Wake up oled if user is using those fabulous keys!
if (record->event.pressed)
oled_on();
#endif

if (!(
#if defined(KEY_LOCK_ENABLE)
// Must run first to be able to mask key_up events.
Expand Down Expand Up @@ -976,9 +970,6 @@ void matrix_init_quantum() {
#ifdef OUTPUT_AUTO_ENABLE
set_output(OUTPUT_AUTO);
#endif
#ifdef OLED_DRIVER_ENABLE
oled_init(OLED_ROTATION_0);
#endif
matrix_init_kb();
}

Expand Down Expand Up @@ -1015,10 +1006,6 @@ void matrix_scan_quantum() {
haptic_task();
#endif

#ifdef OLED_DRIVER_ENABLE
oled_task();
#endif

matrix_scan_kb();
}
#if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_PIN)
Expand Down Expand Up @@ -1109,9 +1096,7 @@ void backlight_task(void) {
#endif
#endif

#else // pwm through timer

#define TIMER_TOP 0xFFFFU

// See http://jared.geek.nz/2013/feb/linear-led-pwm
static uint16_t cie_lightness(uint16_t v) {
Expand Down Expand Up @@ -1158,7 +1143,6 @@ void backlight_task(void) {}

#define BREATHING_NO_HALT 0
#define BREATHING_HALT_OFF 1
#define BREATHING_HALT_ON 2
#define BREATHING_STEPS 128

static uint8_t breathing_period = BREATHING_PERIOD;
Expand Down
2 changes: 1 addition & 1 deletion quantum/split_common/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ uint8_t _matrix_scan(void) {

debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed);

return 1;
return (uint8_t)changed;
}

uint8_t matrix_scan(void) {
Expand Down
19 changes: 19 additions & 0 deletions tmk_core/common/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef QWIIC_ENABLE
# include "qwiic.h"
#endif
#ifdef OLED_DRIVER_ENABLE
#include "oled_driver.h"
#endif
#ifdef VELOCIKEY_ENABLE
#include "velocikey.h"
#endif
Expand Down Expand Up @@ -205,6 +208,9 @@ void keyboard_init(void) {
#ifdef QWIIC_ENABLE
qwiic_init();
#endif
#ifdef OLED_DRIVER_ENABLE
oled_init(OLED_ROTATION_0);
#endif
#ifdef PS2_MOUSE_ENABLE
ps2_mouse_init();
#endif
Expand Down Expand Up @@ -262,7 +268,11 @@ void keyboard_task(void)
uint8_t keys_processed = 0;
#endif

#if defined(OLED_DRIVER_ENABLE) && !defined(OLED_DISABLE_TIMEOUT)
uint8_t ret = matrix_scan();
#else
matrix_scan();
#endif

if (is_keyboard_master()) {
for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
Expand Down Expand Up @@ -306,6 +316,15 @@ void keyboard_task(void)
qwiic_task();
#endif

#ifdef OLED_DRIVER_ENABLE
oled_task();
#ifndef OLED_DISABLE_TIMEOUT
// Wake up oled if user is using those fabulous keys!
if (ret)
oled_on();
#endif
#endif

#ifdef MOUSEKEY_ENABLE
// mousekey repeat & acceleration
mousekey_task();
Expand Down

0 comments on commit 24d05fe

Please sign in to comment.