1
0
Fork 0
forked from forks/qmk_firmware

format code according to conventions [skip ci]

This commit is contained in:
QMK Bot 2020-03-13 18:44:56 +00:00
parent 9e8767917d
commit 5e98eaaaff
5 changed files with 107 additions and 108 deletions

View file

@ -43,4 +43,3 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
}
return MACRO_NONE;
};

View file

@ -17,8 +17,8 @@
#include "test_common.hpp"
using testing::_;
using testing::Return;
using testing::InSequence;
using testing::Return;
class KeyPress : public TestFixture {};
@ -167,7 +167,7 @@ TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) {
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
release_key(1, 1); //KC_PLS
release_key(1, 1); // KC_PLS
// BUG: Should really still return KC_EQL, but this is fine too
// It's also called twice for some reason
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(2);
@ -225,7 +225,7 @@ TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) {
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
release_key(0, 1); //KC_EQL
release_key(0, 1); // KC_EQL
// I guess it's fine to still report shift here
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
run_one_scan_loop();

View file

@ -79,14 +79,14 @@ bool is_key_pressed(report_keyboard_t* keyboard_report, uint8_t key) {
}
#ifdef NKRO_ENABLE
if (keyboard_protocol && keymap_config.nkro) {
if ((key>>3) < KEYBOARD_REPORT_BITS) {
return keyboard_report->nkro.bits[key>>3] & 1<<(key&7);
if ((key >> 3) < KEYBOARD_REPORT_BITS) {
return keyboard_report->nkro.bits[key >> 3] & 1 << (key & 7);
} else {
return false;
}
}
#endif
for (int i=0; i < KEYBOARD_REPORT_KEYS; i++) {
for (int i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
if (keyboard_report->keys[i] == key) {
return true;
}