Run clang-format manually to fix recently changed files

This commit is contained in:
zvecr 2019-11-17 14:02:26 +00:00 committed by Drashna Jaelre
parent 6b18ca2875
commit a91c0c4765
24 changed files with 235 additions and 235 deletions

View file

@ -115,15 +115,13 @@ void DRV_init(void) {
} }
void DRV_rtp_init(void) { void DRV_rtp_init(void) {
DRV_write(DRV_GO, 0x00); DRV_write(DRV_GO, 0x00);
DRV_write(DRV_RTP_INPUT, 20); //20 is the lowest value I've found where haptics can still be felt. DRV_write(DRV_RTP_INPUT, 20); // 20 is the lowest value I've found where haptics can still be felt.
DRV_write(DRV_MODE, 0x05); DRV_write(DRV_MODE, 0x05);
DRV_write(DRV_GO, 0x01); DRV_write(DRV_GO, 0x01);
} }
void DRV_amplitude(uint8_t amplitude) { void DRV_amplitude(uint8_t amplitude) { DRV_write(DRV_RTP_INPUT, amplitude); }
DRV_write(DRV_RTP_INPUT, amplitude);
}
void DRV_pulse(uint8_t sequence) { void DRV_pulse(uint8_t sequence) {
DRV_write(DRV_GO, 0x00); DRV_write(DRV_GO, 0x00);

View file

@ -169,12 +169,12 @@ void haptic_set_mode(uint8_t mode) {
} }
void haptic_set_amplitude(uint8_t amp) { void haptic_set_amplitude(uint8_t amp) {
haptic_config.amplitude = amp; haptic_config.amplitude = amp;
eeconfig_update_haptic(haptic_config.raw); eeconfig_update_haptic(haptic_config.raw);
xprintf("haptic_config.amplitude = %u\n", haptic_config.amplitude); xprintf("haptic_config.amplitude = %u\n", haptic_config.amplitude);
#ifdef DRV2605L #ifdef DRV2605L
DRV_amplitude(amp); DRV_amplitude(amp);
#endif #endif
} }
void haptic_set_buzz(uint8_t buzz) { void haptic_set_buzz(uint8_t buzz) {
@ -211,52 +211,50 @@ uint8_t haptic_get_dwell(void) {
} }
void haptic_enable_continuous(void) { void haptic_enable_continuous(void) {
haptic_config.cont = 1; haptic_config.cont = 1;
xprintf("haptic_config.cont = %u\n", haptic_config.cont); xprintf("haptic_config.cont = %u\n", haptic_config.cont);
eeconfig_update_haptic(haptic_config.raw); eeconfig_update_haptic(haptic_config.raw);
#ifdef DRV2605L #ifdef DRV2605L
DRV_rtp_init(); DRV_rtp_init();
#endif #endif
} }
void haptic_disable_continuous(void) { void haptic_disable_continuous(void) {
haptic_config.cont = 0; haptic_config.cont = 0;
xprintf("haptic_config.cont = %u\n", haptic_config.cont); xprintf("haptic_config.cont = %u\n", haptic_config.cont);
eeconfig_update_haptic(haptic_config.raw); eeconfig_update_haptic(haptic_config.raw);
#ifdef DRV2605L #ifdef DRV2605L
DRV_write(DRV_MODE,0x00); DRV_write(DRV_MODE, 0x00);
#endif #endif
} }
void haptic_toggle_continuous(void) { void haptic_toggle_continuous(void) {
#ifdef DRV2605L #ifdef DRV2605L
if (haptic_config.cont) { if (haptic_config.cont) {
haptic_disable_continuous(); haptic_disable_continuous();
} else { } else {
haptic_enable_continuous(); haptic_enable_continuous();
} }
eeconfig_update_haptic(haptic_config.raw); eeconfig_update_haptic(haptic_config.raw);
#endif #endif
} }
void haptic_cont_increase(void) { void haptic_cont_increase(void) {
uint8_t amp = haptic_config.amplitude + 10; uint8_t amp = haptic_config.amplitude + 10;
if (haptic_config.amplitude >= 120) { if (haptic_config.amplitude >= 120) {
amp = 120; amp = 120;
} }
haptic_set_amplitude(amp); haptic_set_amplitude(amp);
} }
void haptic_cont_decrease(void) { void haptic_cont_decrease(void) {
uint8_t amp = haptic_config.amplitude - 10; uint8_t amp = haptic_config.amplitude - 10;
if (haptic_config.amplitude < 20) { if (haptic_config.amplitude < 20) {
amp = 20; amp = 20;
} }
haptic_set_amplitude(amp); haptic_set_amplitude(amp);
} }
void haptic_play(void) { void haptic_play(void) {
#ifdef DRV2605L #ifdef DRV2605L
uint8_t play_eff = 0; uint8_t play_eff = 0;
@ -269,7 +267,6 @@ void haptic_play(void) {
} }
bool process_haptic(uint16_t keycode, keyrecord_t *record) { bool process_haptic(uint16_t keycode, keyrecord_t *record) {
if (keycode == HPT_ON && record->event.pressed) { if (keycode == HPT_ON && record->event.pressed) {
haptic_enable(); haptic_enable();
} }
@ -300,16 +297,16 @@ bool process_haptic(uint16_t keycode, keyrecord_t *record) {
if (keycode == HPT_DWLD && record->event.pressed) { if (keycode == HPT_DWLD && record->event.pressed) {
haptic_dwell_decrease(); haptic_dwell_decrease();
} }
if (keycode == HPT_CONT && record->event.pressed) { if (keycode == HPT_CONT && record->event.pressed) {
haptic_toggle_continuous(); haptic_toggle_continuous();
} }
if (keycode == HPT_CONI && record->event.pressed) { if (keycode == HPT_CONI && record->event.pressed) {
haptic_cont_increase(); haptic_cont_increase();
} }
if (keycode == HPT_COND && record->event.pressed) { if (keycode == HPT_COND && record->event.pressed) {
haptic_cont_decrease(); haptic_cont_decrease();
} }
if (haptic_config.enable) { if (haptic_config.enable) {
if (record->event.pressed) { if (record->event.pressed) {
// keypress // keypress

View file

@ -34,14 +34,14 @@
typedef union { typedef union {
uint32_t raw; uint32_t raw;
struct { struct {
bool enable :1; bool enable : 1;
uint8_t feedback :2; uint8_t feedback : 2;
uint8_t mode :7; uint8_t mode : 7;
bool buzz :1; bool buzz : 1;
uint8_t dwell :7; uint8_t dwell : 7;
bool cont :1; bool cont : 1;
uint8_t amplitude :8; uint8_t amplitude : 8;
uint16_t reserved :7; uint16_t reserved : 7;
}; };
} haptic_config_t; } haptic_config_t;

View file

@ -191,7 +191,7 @@ void backlight_off(pin_t backlight_pin) {
# define FOR_EACH_LED(x) \ # define FOR_EACH_LED(x) \
for (uint8_t i = 0; i < BACKLIGHT_LED_COUNT; i++) { \ for (uint8_t i = 0; i < BACKLIGHT_LED_COUNT; i++) { \
pin_t backlight_pin = backlight_pins[i]; \ pin_t backlight_pin = backlight_pins[i]; \
{ x } \ { x } \
} }

View file

@ -303,25 +303,26 @@
UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
sei(); \ sei(); \
} while (0) } while (0)
# elif (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)) # elif (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__))
# define SERIAL_UART_BAUD 115200 # define SERIAL_UART_BAUD 115200
# define SERIAL_UART_DATA UDR1 # define SERIAL_UART_DATA UDR1
/* UBRR should result in ~16 and set UCSR1A = _BV(U2X1) as per rn42 documentation. HC05 needs baudrate configured accordingly */ /* UBRR should result in ~16 and set UCSR1A = _BV(U2X1) as per rn42 documentation. HC05 needs baudrate configured accordingly */
# define SERIAL_UART_UBRR (F_CPU / (8UL * SERIAL_UART_BAUD) - 1) # define SERIAL_UART_UBRR (F_CPU / (8UL * SERIAL_UART_BAUD) - 1)
# define SERIAL_UART_RXD_VECT USART1_RX_vect # define SERIAL_UART_RXD_VECT USART1_RX_vect
# define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) # define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
# define SERIAL_UART_INIT() do { \ # define SERIAL_UART_INIT() \
UCSR1A = _BV(U2X1); \ do { \
/* baud rate */ \ UCSR1A = _BV(U2X1); \
UBRR1L = SERIAL_UART_UBRR; \ /* baud rate */ \
/* baud rate */ \ UBRR1L = SERIAL_UART_UBRR; \
UBRR1H = SERIAL_UART_UBRR >> 8; \ /* baud rate */ \
/* enable TX */ \ UBRR1H = SERIAL_UART_UBRR >> 8; \
UCSR1B = _BV(TXEN1); \ /* enable TX */ \
/* 8-bit data */ \ UCSR1B = _BV(TXEN1); \
UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ /* 8-bit data */ \
sei(); \ UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
} while(0) sei(); \
} while (0)
# else # else
# error "USART configuration is needed." # error "USART configuration is needed."
# endif # endif

View file

@ -21,40 +21,33 @@
// for memcpy // for memcpy
#include <string.h> #include <string.h>
#if !defined(DIP_SWITCH_PINS) #if !defined(DIP_SWITCH_PINS)
# error "No DIP switch pads defined by DIP_SWITCH_PINS" # error "No DIP switch pads defined by DIP_SWITCH_PINS"
#endif #endif
#define NUMBER_OF_DIP_SWITCHES (sizeof(dip_switch_pad)/sizeof(pin_t)) #define NUMBER_OF_DIP_SWITCHES (sizeof(dip_switch_pad) / sizeof(pin_t))
static pin_t dip_switch_pad[] = DIP_SWITCH_PINS; static pin_t dip_switch_pad[] = DIP_SWITCH_PINS;
static bool dip_switch_state[NUMBER_OF_DIP_SWITCHES] = { 0 }; static bool dip_switch_state[NUMBER_OF_DIP_SWITCHES] = {0};
static bool last_dip_switch_state[NUMBER_OF_DIP_SWITCHES] = { 0 }; static bool last_dip_switch_state[NUMBER_OF_DIP_SWITCHES] = {0};
__attribute__((weak)) void dip_switch_update_user(uint8_t index, bool active) {}
__attribute__((weak)) __attribute__((weak)) void dip_switch_update_kb(uint8_t index, bool active) { dip_switch_update_user(index, active); }
void dip_switch_update_user(uint8_t index, bool active) {}
__attribute__((weak)) __attribute__((weak)) void dip_switch_update_mask_user(uint32_t state) {}
void dip_switch_update_kb(uint8_t index, bool active) { dip_switch_update_user(index, active); }
__attribute__((weak)) __attribute__((weak)) void dip_switch_update_mask_kb(uint32_t state) { dip_switch_update_mask_user(state); }
void dip_switch_update_mask_user(uint32_t state) {}
__attribute__((weak))
void dip_switch_update_mask_kb(uint32_t state) { dip_switch_update_mask_user(state); }
void dip_switch_init(void) { void dip_switch_init(void) {
for (uint8_t i = 0; i < NUMBER_OF_DIP_SWITCHES; i++) { for (uint8_t i = 0; i < NUMBER_OF_DIP_SWITCHES; i++) {
setPinInputHigh(dip_switch_pad[i]); setPinInputHigh(dip_switch_pad[i]);
} }
dip_switch_read(true); dip_switch_read(true);
} }
void dip_switch_read(bool forced) { void dip_switch_read(bool forced) {
bool has_dip_state_changed = false; bool has_dip_state_changed = false;
uint32_t dip_switch_mask = 0; uint32_t dip_switch_mask = 0;
for (uint8_t i = 0; i < NUMBER_OF_DIP_SWITCHES; i++) { for (uint8_t i = 0; i < NUMBER_OF_DIP_SWITCHES; i++) {
dip_switch_state[i] = !readPin(dip_switch_pad[i]); dip_switch_state[i] = !readPin(dip_switch_pad[i]);

View file

@ -37,8 +37,8 @@ static pin_t encoders_pad_b[] = ENCODERS_PAD_B;
static int8_t encoder_LUT[] = {0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0}; static int8_t encoder_LUT[] = {0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0};
static uint8_t encoder_state[NUMBER_OF_ENCODERS] = {0}; static uint8_t encoder_state[NUMBER_OF_ENCODERS] = {0};
static int8_t encoder_pulses[NUMBER_OF_ENCODERS] = {0}; static int8_t encoder_pulses[NUMBER_OF_ENCODERS] = {0};
#ifdef SPLIT_KEYBOARD #ifdef SPLIT_KEYBOARD
// right half encoders come over as second set of encoders // right half encoders come over as second set of encoders
@ -84,7 +84,7 @@ static void encoder_update(int8_t index, uint8_t state) {
encoder_value[index]++; encoder_value[index]++;
encoder_update_kb(index, true); encoder_update_kb(index, true);
} }
if (encoder_pulses[index] <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise if (encoder_pulses[index] <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise
encoder_value[index]--; encoder_value[index]--;
encoder_update_kb(index, false); encoder_update_kb(index, false);
} }
@ -109,7 +109,7 @@ void encoder_state_raw(uint8_t* slave_state) { memcpy(slave_state, &encoder_valu
void encoder_update_raw(uint8_t* slave_state) { void encoder_update_raw(uint8_t* slave_state) {
for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { for (int i = 0; i < NUMBER_OF_ENCODERS; i++) {
uint8_t index = i + thatHand; uint8_t index = i + thatHand;
int8_t delta = slave_state[i] - encoder_value[index]; int8_t delta = slave_state[i] - encoder_value[index];
while (delta > 0) { while (delta > 0) {
delta--; delta--;
encoder_value[index]++; encoder_value[index]++;

View file

@ -78,36 +78,36 @@
#define IT_MINS KC_SLSH // - and _ #define IT_MINS KC_SLSH // - and _
// shifted characters // shifted characters
#define IT_DEGR LSFT(IT_AACC) // ° #define IT_DEGR LSFT(IT_AACC) // °
#define IT_EXLM LSFT(KC_1) // ! #define IT_EXLM LSFT(KC_1) // !
#define IT_DQOT LSFT(KC_2) // " #define IT_DQOT LSFT(KC_2) // "
#define IT_STRL LSFT(KC_3) // £ #define IT_STRL LSFT(KC_3) // £
#define IT_DLR LSFT(KC_4) // $ #define IT_DLR LSFT(KC_4) // $
#define IT_PERC LSFT(KC_5) // % #define IT_PERC LSFT(KC_5) // %
#define IT_AMPR LSFT(KC_6) // & #define IT_AMPR LSFT(KC_6) // &
#define IT_SLSH LSFT(KC_7) // / #define IT_SLSH LSFT(KC_7) // /
#define IT_LPRN LSFT(KC_8) // ( #define IT_LPRN LSFT(KC_8) // (
#define IT_RPRN LSFT(KC_9) // ) #define IT_RPRN LSFT(KC_9) // )
#define IT_EQL LSFT(KC_0) // = #define IT_EQL LSFT(KC_0) // =
#define IT_QST LSFT(IT_APOS) // ? #define IT_QST LSFT(IT_APOS) // ?
#define IT_CRC LSFT(IT_IACC) // ^ #define IT_CRC LSFT(IT_IACC) // ^
#define IT_ASTR LSFT(IT_PLUS) // * #define IT_ASTR LSFT(IT_PLUS) // *
#define IT_MORE LSFT(IT_LESS) // > #define IT_MORE LSFT(IT_LESS) // >
#define IT_COLN LSFT(IT_DOT) // : #define IT_COLN LSFT(IT_DOT) // :
#define IT_SCLN LSFT(IT_COMM) // ; #define IT_SCLN LSFT(IT_COMM) // ;
#define IT_UNDS LSFT(IT_MINS) // _ #define IT_UNDS LSFT(IT_MINS) // _
// Alt Gr-ed characters // Alt Gr-ed characters
#define IT_LCBR ALGR(KC_7) // { #define IT_LCBR ALGR(KC_7) // {
#define IT_LBRC ALGR(IT_EACC) // [ #define IT_LBRC ALGR(IT_EACC) // [
#define IT_RBRC ALGR(IT_PLUS) // ] #define IT_RBRC ALGR(IT_PLUS) // ]
#define IT_RCBR ALGR(KC_0) // } #define IT_RCBR ALGR(KC_0) // }
#define IT_AT ALGR(IT_OACC) // @ #define IT_AT ALGR(IT_OACC) // @
#define IT_EURO ALGR(KC_E) // € #define IT_EURO ALGR(KC_E) // €
#define IT_PIPE LSFT(IT_BSLS) // | #define IT_PIPE LSFT(IT_BSLS) // |
#define IT_SHRP ALGR(IT_AACC) // # #define IT_SHRP ALGR(IT_AACC) // #
// Deprecated // Deprecated
#define IT_X_PLUS X_RBRACKET // # #define IT_X_PLUS X_RBRACKET // #
#endif #endif

View file

@ -65,7 +65,7 @@
#define IT_COMM KC_COMM // , and ; #define IT_COMM KC_COMM // , and ;
#define IT_APOS KC_MINS // ' and ? #define IT_APOS KC_MINS // ' and ?
#define IT_BSLS KC_NUBS // \ and | #define IT_BSLS KC_NUBS // \ and |
#define IT_LESS KC_GRV // < and > #define IT_LESS KC_GRV // < and >
#define IT_MINS KC_SLSH // - and _ #define IT_MINS KC_SLSH // - and _
// accented vowels (regular, with shift, with option, with option and shift) // accented vowels (regular, with shift, with option, with option and shift)
@ -77,37 +77,37 @@
#define IT_IACC KC_EQL // ì, ^, ˆ, ± #define IT_IACC KC_EQL // ì, ^, ˆ, ±
// shifted characters // shifted characters
#define IT_EXLM LSFT(KC_1) // ! #define IT_EXLM LSFT(KC_1) // !
#define IT_DQOT LSFT(KC_2) // " #define IT_DQOT LSFT(KC_2) // "
#define IT_STRL LSFT(KC_3) // £ #define IT_STRL LSFT(KC_3) // £
#define IT_DLR LSFT(KC_4) // $ #define IT_DLR LSFT(KC_4) // $
#define IT_PERC LSFT(KC_5) // % #define IT_PERC LSFT(KC_5) // %
#define IT_AMPR LSFT(KC_6) // & #define IT_AMPR LSFT(KC_6) // &
#define IT_SLSH LSFT(KC_7) // / #define IT_SLSH LSFT(KC_7) // /
#define IT_LPRN LSFT(KC_8) // ( #define IT_LPRN LSFT(KC_8) // (
#define IT_RPRN LSFT(KC_9) // ) #define IT_RPRN LSFT(KC_9) // )
#define IT_EQL LSFT(KC_0) // = #define IT_EQL LSFT(KC_0) // =
#define IT_DEGR LSFT(IT_AACC) // ° #define IT_DEGR LSFT(IT_AACC) // °
#define IT_QST LSFT(IT_APOS) // ? #define IT_QST LSFT(IT_APOS) // ?
#define IT_CRC LSFT(IT_IACC) // ^ #define IT_CRC LSFT(IT_IACC) // ^
#define IT_ASTR LSFT(IT_PLUS) // * #define IT_ASTR LSFT(IT_PLUS) // *
#define IT_MORE LSFT(IT_LESS) // > #define IT_MORE LSFT(IT_LESS) // >
#define IT_COLN LSFT(IT_DOT) // : #define IT_COLN LSFT(IT_DOT) // :
#define IT_SCLN LSFT(IT_COMM) // ; #define IT_SCLN LSFT(IT_COMM) // ;
#define IT_UNDS LSFT(IT_MINS) // _ #define IT_UNDS LSFT(IT_MINS) // _
#define IT_LCBR LSFT(IT_LBRC) // { #define IT_LCBR LSFT(IT_LBRC) // {
#define IT_RCBR LSFT(IT_RBRC) // } #define IT_RCBR LSFT(IT_RBRC) // }
#define IT_PIPE LSFT(IT_BSLS) // | #define IT_PIPE LSFT(IT_BSLS) // |
// Alt -ed characters // Alt -ed characters
#define IT_LBRC LALT(IT_EACC) // [ #define IT_LBRC LALT(IT_EACC) // [
#define IT_RBRC LALT(IT_PLUS) // ] #define IT_RBRC LALT(IT_PLUS) // ]
#define IT_AT LALT(IT_OACC) // @ #define IT_AT LALT(IT_OACC) // @
#define IT_EURO LALT(KC_E) // € #define IT_EURO LALT(KC_E) // €
#define IT_SHRP LALT(IT_AACC ) // # #define IT_SHRP LALT(IT_AACC) // #
#define IT_ACUT LALT(KC_8) // ´ #define IT_ACUT LALT(KC_8) // ´
#define IT_GRAVE LALT(KC_9) // ` #define IT_GRAVE LALT(KC_9) // `
#define IT_TILDE LALT(KC_5) // ~ #define IT_TILDE LALT(KC_5) // ~
#define IT_PLMN LALT(LSFT(IT_IACC)) // ± #define IT_PLMN LALT(LSFT(IT_IACC)) // ±
#endif #endif

View file

@ -65,7 +65,7 @@
#define IT_COMM KC_COMM // , and ; #define IT_COMM KC_COMM // , and ;
#define IT_APOS KC_MINS // ' and ? #define IT_APOS KC_MINS // ' and ?
#define IT_BSLS KC_GRV // \ and | #define IT_BSLS KC_GRV // \ and |
#define IT_LESS KC_NUBS// < and > #define IT_LESS KC_NUBS // < and >
#define IT_MINS KC_SLSH // - and _ #define IT_MINS KC_SLSH // - and _
// accented vowels (regular, with shift, with option, with option and shift) // accented vowels (regular, with shift, with option, with option and shift)
@ -77,37 +77,37 @@
#define IT_IACC KC_EQL // ì, ^, ˆ, ± #define IT_IACC KC_EQL // ì, ^, ˆ, ±
// shifted characters // shifted characters
#define IT_EXLM LSFT(KC_1) // ! #define IT_EXLM LSFT(KC_1) // !
#define IT_DQOT LSFT(KC_2) // " #define IT_DQOT LSFT(KC_2) // "
#define IT_STRL LSFT(KC_3) // £ #define IT_STRL LSFT(KC_3) // £
#define IT_DLR LSFT(KC_4) // $ #define IT_DLR LSFT(KC_4) // $
#define IT_PERC LSFT(KC_5) // % #define IT_PERC LSFT(KC_5) // %
#define IT_AMPR LSFT(KC_6) // & #define IT_AMPR LSFT(KC_6) // &
#define IT_SLSH LSFT(KC_7) // / #define IT_SLSH LSFT(KC_7) // /
#define IT_LPRN LSFT(KC_8) // ( #define IT_LPRN LSFT(KC_8) // (
#define IT_RPRN LSFT(KC_9) // ) #define IT_RPRN LSFT(KC_9) // )
#define IT_EQL LSFT(KC_0) // = #define IT_EQL LSFT(KC_0) // =
#define IT_DEGR LSFT(IT_AACC) // ° #define IT_DEGR LSFT(IT_AACC) // °
#define IT_QST LSFT(IT_APOS) // ? #define IT_QST LSFT(IT_APOS) // ?
#define IT_CRC LSFT(IT_IACC) // ^ #define IT_CRC LSFT(IT_IACC) // ^
#define IT_ASTR LSFT(IT_PLUS) // * #define IT_ASTR LSFT(IT_PLUS) // *
#define IT_MORE LSFT(IT_LESS) // > #define IT_MORE LSFT(IT_LESS) // >
#define IT_COLN LSFT(IT_DOT) // : #define IT_COLN LSFT(IT_DOT) // :
#define IT_SCLN LSFT(IT_COMM) // ; #define IT_SCLN LSFT(IT_COMM) // ;
#define IT_UNDS LSFT(IT_MINS) // _ #define IT_UNDS LSFT(IT_MINS) // _
#define IT_LCBR LSFT(IT_LBRC) // { #define IT_LCBR LSFT(IT_LBRC) // {
#define IT_RCBR LSFT(IT_RBRC) // } #define IT_RCBR LSFT(IT_RBRC) // }
#define IT_PIPE LSFT(IT_BSLS) // | #define IT_PIPE LSFT(IT_BSLS) // |
// Alt -ed characters // Alt -ed characters
#define IT_LBRC LALT(IT_EACC) // [ #define IT_LBRC LALT(IT_EACC) // [
#define IT_RBRC LALT(IT_PLUS) // ] #define IT_RBRC LALT(IT_PLUS) // ]
#define IT_AT LALT(IT_OACC) // @ #define IT_AT LALT(IT_OACC) // @
#define IT_EURO LALT(KC_E) // € #define IT_EURO LALT(KC_E) // €
#define IT_SHRP LALT(IT_AACC ) // # #define IT_SHRP LALT(IT_AACC) // #
#define IT_ACUT LALT(KC_8) // ´ #define IT_ACUT LALT(KC_8) // ´
#define IT_GRAVE LALT(KC_9) // ` #define IT_GRAVE LALT(KC_9) // `
#define IT_TILDE LALT(KC_5) // ~ #define IT_TILDE LALT(KC_5) // ~
#define IT_PLMN LALT(LSFT(IT_IACC)) // ± #define IT_PLMN LALT(LSFT(IT_IACC)) // ±
#endif #endif

View file

@ -63,10 +63,10 @@ typedef struct {
{ .fn = {qk_tap_dance_pair_on_each_tap, qk_tap_dance_pair_finished, qk_tap_dance_pair_reset}, .user_data = (void *)&((qk_tap_dance_pair_t){kc1, kc2}), } { .fn = {qk_tap_dance_pair_on_each_tap, qk_tap_dance_pair_finished, qk_tap_dance_pair_reset}, .user_data = (void *)&((qk_tap_dance_pair_t){kc1, kc2}), }
# define ACTION_TAP_DANCE_DUAL_ROLE(kc, layer) \ # define ACTION_TAP_DANCE_DUAL_ROLE(kc, layer) \
{ .fn = { qk_tap_dance_dual_role_on_each_tap, qk_tap_dance_dual_role_finished, qk_tap_dance_dual_role_reset }, .user_data = (void *)&((qk_tap_dance_dual_role_t) { kc, layer, layer_move }), } { .fn = {qk_tap_dance_dual_role_on_each_tap, qk_tap_dance_dual_role_finished, qk_tap_dance_dual_role_reset}, .user_data = (void *)&((qk_tap_dance_dual_role_t){kc, layer, layer_move}), }
# define ACTION_TAP_DANCE_LAYER_TOGGLE(kc, layer) \ # define ACTION_TAP_DANCE_LAYER_TOGGLE(kc, layer) \
{ .fn = { NULL, qk_tap_dance_dual_role_finished, qk_tap_dance_dual_role_reset }, .user_data = (void *)&((qk_tap_dance_dual_role_t) { kc, layer, layer_invert }), } { .fn = {NULL, qk_tap_dance_dual_role_finished, qk_tap_dance_dual_role_reset}, .user_data = (void *)&((qk_tap_dance_dual_role_t){kc, layer, layer_invert}), }
# define ACTION_TAP_DANCE_LAYER_MOVE(kc, layer) ACTION_TAP_DANCE_DUAL_ROLE(kc, layer) # define ACTION_TAP_DANCE_LAYER_MOVE(kc, layer) ACTION_TAP_DANCE_DUAL_ROLE(kc, layer)
@ -79,8 +79,6 @@ typedef struct {
# define ACTION_TAP_DANCE_FN_ADVANCED_TIME(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, tap_specific_tapping_term) \ # define ACTION_TAP_DANCE_FN_ADVANCED_TIME(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, tap_specific_tapping_term) \
{ .fn = {user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset}, .user_data = NULL, .custom_tapping_term = tap_specific_tapping_term, } { .fn = {user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset}, .user_data = NULL, .custom_tapping_term = tap_specific_tapping_term, }
extern qk_tap_dance_action_t tap_dance_actions[]; extern qk_tap_dance_action_t tap_dance_actions[];
/* To be used internally */ /* To be used internally */

View file

@ -1116,7 +1116,7 @@ __attribute__((weak)) void led_set(uint8_t usb_led) {
#endif #endif
led_set_kb(usb_led); led_set_kb(usb_led);
led_update_kb((led_t) usb_led); led_update_kb((led_t)usb_led);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View file

@ -146,14 +146,13 @@ extern layer_state_t layer_state;
#endif #endif
#ifdef DIP_SWITCH_ENABLE #ifdef DIP_SWITCH_ENABLE
#include "dip_switch.h" # include "dip_switch.h"
#endif #endif
#ifdef DYNAMIC_MACRO_ENABLE #ifdef DYNAMIC_MACRO_ENABLE
#include "process_dynamic_macro.h" # include "process_dynamic_macro.h"
#endif #endif
// Function substitutions to ease GPIO manipulation // Function substitutions to ease GPIO manipulation
#if defined(__AVR__) #if defined(__AVR__)
typedef uint8_t pin_t; typedef uint8_t pin_t;

View file

@ -771,4 +771,4 @@ enum quantum_keycodes {
#define DM_PLY1 DYN_MACRO_PLAY1 #define DM_PLY1 DYN_MACRO_PLAY1
#define DM_PLY2 DYN_MACRO_PLAY2 #define DM_PLY2 DYN_MACRO_PLAY2
#endif // QUANTUM_KEYCODES_H #endif // QUANTUM_KEYCODES_H

View file

@ -919,7 +919,7 @@ void rgblight_effect_snake(animation_status_t *anim) {
ledp->g = 0; ledp->g = 0;
ledp->b = 0; ledp->b = 0;
# ifdef RGBW # ifdef RGBW
ledp->w = 0; ledp->w = 0;
# endif # endif
for (j = 0; j < RGBLIGHT_EFFECT_SNAKE_LENGTH; j++) { for (j = 0; j < RGBLIGHT_EFFECT_SNAKE_LENGTH; j++) {
k = pos + j * increment; k = pos + j * increment;

View file

@ -419,34 +419,39 @@
* @note It is invoked from within @p chThdInit() and implicitly from all * @note It is invoked from within @p chThdInit() and implicitly from all
* the threads creation APIs. * the threads creation APIs.
*/ */
# define CH_CFG_THREAD_INIT_HOOK(tp) \ # define CH_CFG_THREAD_INIT_HOOK(tp) \
{ /* Add threads initialization code here.*/ } { /* Add threads initialization code here.*/ \
}
/** /**
* @brief Threads finalization hook. * @brief Threads finalization hook.
* @details User finalization code added to the @p chThdExit() API. * @details User finalization code added to the @p chThdExit() API.
*/ */
# define CH_CFG_THREAD_EXIT_HOOK(tp) \ # define CH_CFG_THREAD_EXIT_HOOK(tp) \
{ /* Add threads finalization code here.*/ } { /* Add threads finalization code here.*/ \
}
/** /**
* @brief Context switch hook. * @brief Context switch hook.
* @details This hook is invoked just before switching between threads. * @details This hook is invoked just before switching between threads.
*/ */
# define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) \ # define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) \
{ /* Context switch code here.*/ } { /* Context switch code here.*/ \
}
/** /**
* @brief ISR enter hook. * @brief ISR enter hook.
*/ */
# define CH_CFG_IRQ_PROLOGUE_HOOK() \ # define CH_CFG_IRQ_PROLOGUE_HOOK() \
{ /* IRQ prologue code here.*/ } { /* IRQ prologue code here.*/ \
}
/** /**
* @brief ISR exit hook. * @brief ISR exit hook.
*/ */
# define CH_CFG_IRQ_EPILOGUE_HOOK() \ # define CH_CFG_IRQ_EPILOGUE_HOOK() \
{ /* IRQ epilogue code here.*/ } { /* IRQ epilogue code here.*/ \
}
/** /**
* @brief Idle thread enter hook. * @brief Idle thread enter hook.
@ -455,7 +460,8 @@
* @note This macro can be used to activate a power saving mode. * @note This macro can be used to activate a power saving mode.
*/ */
# define CH_CFG_IDLE_ENTER_HOOK() \ # define CH_CFG_IDLE_ENTER_HOOK() \
{ /* Idle-enter code here.*/ } { /* Idle-enter code here.*/ \
}
/** /**
* @brief Idle thread leave hook. * @brief Idle thread leave hook.
@ -464,22 +470,25 @@
* @note This macro can be used to deactivate a power saving mode. * @note This macro can be used to deactivate a power saving mode.
*/ */
# define CH_CFG_IDLE_LEAVE_HOOK() \ # define CH_CFG_IDLE_LEAVE_HOOK() \
{ /* Idle-leave code here.*/ } { /* Idle-leave code here.*/ \
}
/** /**
* @brief Idle Loop hook. * @brief Idle Loop hook.
* @details This hook is continuously invoked by the idle thread loop. * @details This hook is continuously invoked by the idle thread loop.
*/ */
# define CH_CFG_IDLE_LOOP_HOOK() \ # define CH_CFG_IDLE_LOOP_HOOK() \
{ /* Idle loop code here.*/ } { /* Idle loop code here.*/ \
}
/** /**
* @brief System tick event hook. * @brief System tick event hook.
* @details This hook is invoked in the system tick handler immediately * @details This hook is invoked in the system tick handler immediately
* after processing the virtual timers queue. * after processing the virtual timers queue.
*/ */
# define CH_CFG_SYSTEM_TICK_HOOK() \ # define CH_CFG_SYSTEM_TICK_HOOK() \
{ /* System tick event code here.*/ } { /* System tick event code here.*/ \
}
/** /**
* @brief System halt hook. * @brief System halt hook.
@ -487,7 +496,8 @@
* the system is halted. * the system is halted.
*/ */
# define CH_CFG_SYSTEM_HALT_HOOK(reason) \ # define CH_CFG_SYSTEM_HALT_HOOK(reason) \
{ /* System halt code here.*/ } { /* System halt code here.*/ \
}
/** /**
* @brief Trace hook. * @brief Trace hook.
@ -495,7 +505,8 @@
* trace buffer. * trace buffer.
*/ */
# define CH_CFG_TRACE_HOOK(tep) \ # define CH_CFG_TRACE_HOOK(tep) \
{ /* Trace code here.*/ } { /* Trace code here.*/ \
}
/** @} */ /** @} */

View file

@ -7,7 +7,8 @@
* *
* FIXME: needs doc * FIXME: needs doc
*/ */
void suspend_idle(uint8_t time) { /* Note: Not used anywhere currently */ } void suspend_idle(uint8_t time) { /* Note: Not used anywhere currently */
}
/** \brief Run user level Power down /** \brief Run user level Power down
* *

View file

@ -51,10 +51,10 @@ void eeconfig_init_quantum(void) {
// TODO: Remove once ARM has a way to configure EECONFIG_HANDEDNESS // TODO: Remove once ARM has a way to configure EECONFIG_HANDEDNESS
// within the emulated eeprom via dfu-util or another tool // within the emulated eeprom via dfu-util or another tool
#if defined INIT_EE_HANDS_LEFT #if defined INIT_EE_HANDS_LEFT
#pragma message "Faking EE_HANDS for left hand" # pragma message "Faking EE_HANDS for left hand"
eeprom_update_byte(EECONFIG_HANDEDNESS, 1); eeprom_update_byte(EECONFIG_HANDEDNESS, 1);
#elif defined INIT_EE_HANDS_RIGHT #elif defined INIT_EE_HANDS_RIGHT
#pragma message "Faking EE_HANDS for right hand" # pragma message "Faking EE_HANDS for right hand"
eeprom_update_byte(EECONFIG_HANDEDNESS, 0); eeprom_update_byte(EECONFIG_HANDEDNESS, 0);
#endif #endif

View file

@ -41,7 +41,7 @@ uint8_t host_keyboard_leds(void) {
} }
led_t host_keyboard_led_state(void) { led_t host_keyboard_led_state(void) {
if (!driver) return (led_t) {0}; if (!driver) return (led_t){0};
return (led_t)((*driver->keyboard_leds)()); return (led_t)((*driver->keyboard_leds)());
} }

View file

@ -36,11 +36,11 @@ extern "C" {
typedef union { typedef union {
uint8_t raw; uint8_t raw;
struct { struct {
bool num_lock : 1; bool num_lock : 1;
bool caps_lock : 1; bool caps_lock : 1;
bool scroll_lock : 1; bool scroll_lock : 1;
bool compose : 1; bool compose : 1;
bool kana : 1; bool kana : 1;
uint8_t reserved : 3; uint8_t reserved : 3;
}; };
} led_t; } led_t;

View file

@ -186,9 +186,10 @@ COMPILER_PACK_RESET()
#define USB_HID_COUNTRY_UK 32 // UK #define USB_HID_COUNTRY_UK 32 // UK
#define USB_HID_COUNTRY_US 33 // US #define USB_HID_COUNTRY_US 33 // US
#define USB_HID_COUNTRY_YUGOSLAVIA 34 // Yugoslavia #define USB_HID_COUNTRY_YUGOSLAVIA 34 // Yugoslavia
#define USB_HID_COUNTRY_TURKISH_F 35 // Turkish-F #define USB_HID_COUNTRY_TURKISH_F \
//! @} 35 // Turkish-F
//! @} //! @}
//! @}
//! @} //! @}
//! \name HID KEYS values //! \name HID KEYS values

View file

@ -310,7 +310,7 @@ static void usb_event_cb(USBDriver *usbp, usbevent_t event) {
case USB_EVENT_SUSPEND: case USB_EVENT_SUSPEND:
#ifdef SLEEP_LED_ENABLE #ifdef SLEEP_LED_ENABLE
sleep_led_enable(); sleep_led_enable();
#endif /* SLEEP_LED_ENABLE */ #endif /* SLEEP_LED_ENABLE */
/* Falls into.*/ /* Falls into.*/
case USB_EVENT_UNCONFIGURED: case USB_EVENT_UNCONFIGURED:
/* Falls into.*/ /* Falls into.*/
@ -453,9 +453,9 @@ static bool usb_request_hook_cb(USBDriver *usbp) {
#ifdef NKRO_ENABLE #ifdef NKRO_ENABLE
keymap_config.nkro = !!keyboard_protocol; keymap_config.nkro = !!keyboard_protocol;
if (!keymap_config.nkro && keyboard_idle) { if (!keymap_config.nkro && keyboard_idle) {
#else /* NKRO_ENABLE */ #else /* NKRO_ENABLE */
if (keyboard_idle) { if (keyboard_idle) {
#endif /* NKRO_ENABLE */ #endif /* NKRO_ENABLE */
/* arm the idle timer if boot protocol & idle */ /* arm the idle timer if boot protocol & idle */
osalSysLockFromISR(); osalSysLockFromISR();
chVTSetI(&keyboard_idle_timer, 4 * MS2ST(keyboard_idle), keyboard_idle_timer_cb, (void *)usbp); chVTSetI(&keyboard_idle_timer, 4 * MS2ST(keyboard_idle), keyboard_idle_timer_cb, (void *)usbp);

View file

@ -320,7 +320,8 @@ static void send_mouse(report_mouse_t *report) {
#endif #endif
} }
static void send_system(uint16_t data) { /* not supported */ } static void send_system(uint16_t data) { /* not supported */
}
static void send_consumer(uint16_t data) { static void send_consumer(uint16_t data) {
#ifdef EXTRAKEY_ENABLE #ifdef EXTRAKEY_ENABLE

View file

@ -31,9 +31,9 @@
#define ConnectionUpdateInterval 1000 /* milliseconds */ #define ConnectionUpdateInterval 1000 /* milliseconds */
#ifdef SAMPLE_BATTERY #ifdef SAMPLE_BATTERY
#ifndef BATTERY_LEVEL_PIN # ifndef BATTERY_LEVEL_PIN
# define BATTERY_LEVEL_PIN 7 # define BATTERY_LEVEL_PIN 7
#endif # endif
#endif #endif
static struct { static struct {