Skip to content

Commit

Permalink
qmk cformat (#9500)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarc authored Jun 22, 2020
1 parent cb13dd0 commit 3d6d899
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 51 deletions.
5 changes: 2 additions & 3 deletions drivers/issi/is31fl3741.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "i2c_master.h"
#include "progmem.h"


// This is a 7-bit address, that gets left-shifted and bit 0
// set to 0 for write, 1 for read (as per I2C protocol)
// The address will vary depending on your wiring:
Expand Down Expand Up @@ -178,9 +177,9 @@ void IS31FL3741_init(uint8_t addr) {
// Set Pull up & Down for SWx CSy
IS31FL3741_write_register(addr, ISSI_REG_PULLDOWNUP, 0x77);

// IS31FL3741_update_led_scaling_registers(addr, 0xFF, 0xFF, 0xFF);
// IS31FL3741_update_led_scaling_registers(addr, 0xFF, 0xFF, 0xFF);

// Wait 10ms to ensure the device has woken up.
// Wait 10ms to ensure the device has woken up.
wait_ms(10);
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/ws2812.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
#include "quantum/color.h"

/*
* Older WS2812s can handle a reset time (TRST) of 50us, but recent
* Older WS2812s can handle a reset time (TRST) of 50us, but recent
* component revisions require a minimum of 280us.
*/

#if !defined(WS2812_TRST_US)
#define WS2812_TRST_US 280
# define WS2812_TRST_US 280
#endif

/* User Interface
Expand Down
79 changes: 39 additions & 40 deletions quantum/process_keycode/process_ucis.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ bool process_ucis(uint16_t keycode, keyrecord_t *record) {
return true;
}

bool special = keycode == KC_SPC || keycode == KC_ENT ||
keycode == KC_ESC || keycode == KC_BSPC;
bool special = keycode == KC_SPC || keycode == KC_ENT || keycode == KC_ESC || keycode == KC_BSPC;
if (qk_ucis_state.count >= UCIS_MAX_SYMBOL_LENGTH && !special) {
return false;
}
Expand All @@ -82,49 +81,49 @@ bool process_ucis(uint16_t keycode, keyrecord_t *record) {
qk_ucis_state.count++;

switch (keycode) {
case KC_BSPC:
if (qk_ucis_state.count >= 2) {
qk_ucis_state.count -= 2;
return true;
} else {
qk_ucis_state.count--;
return false;
}
case KC_BSPC:
if (qk_ucis_state.count >= 2) {
qk_ucis_state.count -= 2;
return true;
} else {
qk_ucis_state.count--;
return false;
}

case KC_SPC:
case KC_ENT:
case KC_ESC:
for (uint8_t i = 0; i < qk_ucis_state.count; i++) {
register_code(KC_BSPC);
unregister_code(KC_BSPC);
wait_ms(UNICODE_TYPE_DELAY);
}
case KC_SPC:
case KC_ENT:
case KC_ESC:
for (uint8_t i = 0; i < qk_ucis_state.count; i++) {
register_code(KC_BSPC);
unregister_code(KC_BSPC);
wait_ms(UNICODE_TYPE_DELAY);
}

if (keycode == KC_ESC) {
qk_ucis_state.in_progress = false;
qk_ucis_cancel();
return false;
}
if (keycode == KC_ESC) {
qk_ucis_state.in_progress = false;
qk_ucis_cancel();
return false;
}

uint8_t i;
bool symbol_found = false;
for (i = 0; ucis_symbol_table[i].symbol; i++) {
if (is_uni_seq(ucis_symbol_table[i].symbol)) {
symbol_found = true;
register_ucis(ucis_symbol_table[i].code_points);
break;
uint8_t i;
bool symbol_found = false;
for (i = 0; ucis_symbol_table[i].symbol; i++) {
if (is_uni_seq(ucis_symbol_table[i].symbol)) {
symbol_found = true;
register_ucis(ucis_symbol_table[i].code_points);
break;
}
}
if (symbol_found) {
qk_ucis_success(i);
} else {
qk_ucis_symbol_fallback();
}
}
if (symbol_found) {
qk_ucis_success(i);
} else {
qk_ucis_symbol_fallback();
}

qk_ucis_state.in_progress = false;
return false;
qk_ucis_state.in_progress = false;
return false;

default:
return true;
default:
return true;
}
}
2 changes: 1 addition & 1 deletion quantum/process_keycode/process_unicode_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void send_unicode_string(const char *str) {

while (*str) {
int32_t code_point = 0;
str = decode_utf8(str, &code_point);
str = decode_utf8(str, &code_point);

if (code_point >= 0) {
register_unicode(code_point);
Expand Down
2 changes: 1 addition & 1 deletion quantum/process_keycode/process_unicodemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ __attribute__((weak)) uint16_t unicodemap_index(uint16_t keycode) {
uint16_t index = keycode - QK_UNICODEMAP_PAIR;

bool shift = unicode_saved_mods & MOD_MASK_SHIFT;
bool caps = IS_HOST_LED_ON(USB_LED_CAPS_LOCK);
bool caps = IS_HOST_LED_ON(USB_LED_CAPS_LOCK);
if (shift ^ caps) {
index >>= 7;
}
Expand Down
6 changes: 2 additions & 4 deletions quantum/rgb_matrix_drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* be here if shared between boards.
*/

#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737) || defined(IS31FL3741)
#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737) || defined(IS31FL3741)

# include "i2c_master.h"

Expand Down Expand Up @@ -100,9 +100,7 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
.set_color_all = IS31FL3737_set_color_all,
};
# else
static void flush(void) {
IS31FL3741_update_pwm_buffers(DRIVER_ADDR_1, DRIVER_ADDR_2);
}
static void flush(void) { IS31FL3741_update_pwm_buffers(DRIVER_ADDR_1, DRIVER_ADDR_2); }

const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init,
Expand Down

0 comments on commit 3d6d899

Please sign in to comment.