summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md1
-rw-r--r--quantum/quantum.c16
-rw-r--r--quantum/split_common/matrix.c2
-rw-r--r--tmk_core/common/keyboard.c19
4 files changed, 21 insertions, 17 deletions
diff --git a/changelog.md b/changelog.md
index cdebe64f43..badca9920f 100644
--- a/changelog.md
+++ b/changelog.md
@@ -16,3 +16,4 @@
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-06-2019 - Changes to Split Common and OLED code
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 2d21bf0773..20762b1126 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -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.
@@ -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();
}
@@ -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)
@@ -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) {
@@ -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;
diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c
index eb110bd23a..3c3daf3d3b 100644
--- a/quantum/split_common/matrix.c
+++ b/quantum/split_common/matrix.c
@@ -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) {
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index 52546866eb..85d2525480 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -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
@@ -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
@@ -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++) {
@@ -306,6 +316,15 @@ MATRIX_LOOP_END:
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();