Remove the unnecessary for loop

pull/5516/merge^2
skullY 6 years ago
parent 38b6e5f13c
commit e370b31660

@ -43,13 +43,11 @@ void matrix_scan_kb(void) {
uint8_t tilt_read = (readPin(SHAKE_PIN_A) << 4) | readPin(SHAKE_PIN_B);
// Check to see if the tilt sensor has changed state since our last read
for (uint8_t i = 0; i < 2; i++) {
if (tilt_state != tilt_read) {
shake_timer = timer_read();
detected_shakes++;
tilt_state = tilt_read;
}
}
if ((detected_shakes > 0) && (timer_elapsed(shake_timer) > SHAKE_TIMEOUT)) {
if (detected_shakes > SHAKE_COUNT) {
@ -66,6 +64,12 @@ void matrix_scan_kb(void) {
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
if (keycode == ENC_BTN1) {
}
}
return process_record_user(keycode, record);
}

@ -17,6 +17,17 @@
#include "quantum.h"
enum TWOx1800_keycodes {
ENC_BTN1 = SAFE_RANGE,
ENC_BTN2,
ENC_BTN3,
ENC_BTN4,
NEW_SAFE_RANGE
};
#undef SAFE_RANGE
#define SAFE_RANGE NEW_SAFE_RANGE
// This a shortcut to help you visually see your layout.
// The first section contains all of the arguments
// The second converts the arguments into a two-dimensional array

@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#pragma once
#include "config_common.h"
@ -197,7 +196,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 1
#endif
/*
* Drawing mode
*/
#define DRAWING_ENABLE
//#define UNDO_KEY LGUI(KC_Z) // What key to send for undo
//#define UNDO_KEY LCTL(KC_Z)
#define UNDO_KEY LGUI(KC_SLSH)
/*
* Shake to undo configuration
@ -207,6 +212,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define SHAKE_PIN_B E5
#define SHAKE_TIMEOUT 500 // How long after shaking stops before we register it
#define SHAKE_COUNT 8 // How many shakes it takes to activate
//#define SHAKE_KEY LGUI(KC_Z) // What key to send after a shake
//#define SHAKE_KEY LCTL(KC_Z)
#define SHAKE_KEY LGUI(KC_SLSH)
#define SHAKE_KEY UNDO_KEY // What key to send after a shake

@ -17,7 +17,7 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_all( \
KC_BTN1, KC_BTN2, KC_BTN3, KC_BTN4, \
ENC_BTN1, ENC_BTN2, ENC_BTN3, ENC_BTN4, \
KC_HOME, KC_END, KC_PGUP, KC_PGDN, KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, \
\
KC_PMNS, KC_NLCK, KC_PSLS, KC_PAST, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \

Loading…
Cancel
Save