forked from mirrors/qmk_userspace
		
	format code according to conventions [skip ci]
This commit is contained in:
		
					parent
					
						
							
								000eb14d78
							
						
					
				
			
			
				commit
				
					
						a3db72df72
					
				
			
		
					 14 changed files with 93 additions and 96 deletions
				
			
		| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define JOYSTICK_AXES_COUNT 2
 | 
					#define JOYSTICK_AXES_COUNT 2
 | 
				
			||||||
#define JOYSTICK_BUTTON_COUNT 1
 | 
					#define JOYSTICK_BUTTON_COUNT 1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1 +1 @@
 | 
				
			||||||
JOYSTICK_ENABLE = analog
 | 
					JOYSTICK_ENABLE = analog
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -79,7 +79,6 @@ void set_autoshift_timeout(uint16_t timeout) { autoshift_timeout = timeout; }
 | 
				
			||||||
bool process_auto_shift(uint16_t keycode, keyrecord_t *record) {
 | 
					bool process_auto_shift(uint16_t keycode, keyrecord_t *record) {
 | 
				
			||||||
    if (record->event.pressed) {
 | 
					    if (record->event.pressed) {
 | 
				
			||||||
        switch (keycode) {
 | 
					        switch (keycode) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
            case KC_ASTG:
 | 
					            case KC_ASTG:
 | 
				
			||||||
                autoshift_toggle();
 | 
					                autoshift_toggle();
 | 
				
			||||||
                return true;
 | 
					                return true;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,7 @@ bool process_joystick(uint16_t keycode, keyrecord_t *record) {
 | 
				
			||||||
    return true;
 | 
					    return true;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__attribute__((weak))
 | 
					__attribute__((weak)) void joystick_task(void) {
 | 
				
			||||||
void joystick_task(void) {
 | 
					 | 
				
			||||||
    if (process_joystick_analogread() && (joystick_status.status & JS_UPDATED)) {
 | 
					    if (process_joystick_analogread() && (joystick_status.status & JS_UPDATED)) {
 | 
				
			||||||
        send_joystick_packet(&joystick_status);
 | 
					        send_joystick_packet(&joystick_status);
 | 
				
			||||||
        joystick_status.status &= ~JS_UPDATED;
 | 
					        joystick_status.status &= ~JS_UPDATED;
 | 
				
			||||||
| 
						 | 
					@ -51,12 +50,7 @@ uint16_t savePinState(pin_t pin) {
 | 
				
			||||||
 bit  15    9  8   7   6  5  4   3     2    1 0
 | 
					 bit  15    9  8   7   6  5  4   3     2    1 0
 | 
				
			||||||
      |unused|ODR|IDR|PUPDR|OSPEEDR|OTYPER|MODER|
 | 
					      |unused|ODR|IDR|PUPDR|OSPEEDR|OTYPER|MODER|
 | 
				
			||||||
    */
 | 
					    */
 | 
				
			||||||
    return  (( PAL_PORT(pin)->MODER   >> (2*PAL_PAD(pin))) & 0x3)
 | 
					    return ((PAL_PORT(pin)->MODER >> (2 * PAL_PAD(pin))) & 0x3) | (((PAL_PORT(pin)->OTYPER >> (1 * PAL_PAD(pin))) & 0x1) << 2) | (((PAL_PORT(pin)->OSPEEDR >> (2 * PAL_PAD(pin))) & 0x3) << 3) | (((PAL_PORT(pin)->PUPDR >> (2 * PAL_PAD(pin))) & 0x3) << 5) | (((PAL_PORT(pin)->IDR >> (1 * PAL_PAD(pin))) & 0x1) << 7) | (((PAL_PORT(pin)->ODR >> (1 * PAL_PAD(pin))) & 0x1) << 8);
 | 
				
			||||||
          | (((PAL_PORT(pin)->OTYPER  >> (1*PAL_PAD(pin))) & 0x1) << 2) 
 | 
					 | 
				
			||||||
          | (((PAL_PORT(pin)->OSPEEDR >> (2*PAL_PAD(pin))) & 0x3) << 3)
 | 
					 | 
				
			||||||
          | (((PAL_PORT(pin)->PUPDR   >> (2*PAL_PAD(pin))) & 0x3) << 5)
 | 
					 | 
				
			||||||
          | (((PAL_PORT(pin)->IDR     >> (1*PAL_PAD(pin))) & 0x1) << 7)
 | 
					 | 
				
			||||||
          | (((PAL_PORT(pin)->ODR     >> (1*PAL_PAD(pin))) & 0x1) << 8);
 | 
					 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -407,7 +407,6 @@ void rgblight_decrease_val_helper(bool write_to_eeprom) {
 | 
				
			||||||
void rgblight_decrease_val_noeeprom(void) { rgblight_decrease_val_helper(false); }
 | 
					void rgblight_decrease_val_noeeprom(void) { rgblight_decrease_val_helper(false); }
 | 
				
			||||||
void rgblight_decrease_val(void) { rgblight_decrease_val_helper(true); }
 | 
					void rgblight_decrease_val(void) { rgblight_decrease_val_helper(true); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
void rgblight_increase_speed_helper(bool write_to_eeprom) {
 | 
					void rgblight_increase_speed_helper(bool write_to_eeprom) {
 | 
				
			||||||
    if (rgblight_config.speed < 3) rgblight_config.speed++;
 | 
					    if (rgblight_config.speed < 3) rgblight_config.speed++;
 | 
				
			||||||
    // RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED?
 | 
					    // RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED?
 | 
				
			||||||
| 
						 | 
					@ -428,7 +427,6 @@ void rgblight_decrease_speed_helper(bool write_to_eeprom) {
 | 
				
			||||||
void rgblight_decrease_speed(void) { rgblight_decrease_speed_helper(true); }
 | 
					void rgblight_decrease_speed(void) { rgblight_decrease_speed_helper(true); }
 | 
				
			||||||
void rgblight_decrease_speed_noeeprom(void) { rgblight_decrease_speed_helper(false); }
 | 
					void rgblight_decrease_speed_noeeprom(void) { rgblight_decrease_speed_helper(false); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
void rgblight_sethsv_noeeprom_old(uint8_t hue, uint8_t sat, uint8_t val) {
 | 
					void rgblight_sethsv_noeeprom_old(uint8_t hue, uint8_t sat, uint8_t val) {
 | 
				
			||||||
    if (rgblight_config.enable) {
 | 
					    if (rgblight_config.enable) {
 | 
				
			||||||
        LED_TYPE tmp_led;
 | 
					        LED_TYPE tmp_led;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -107,7 +107,6 @@ layer_state_t layer_state_set_kb(layer_state_t state);
 | 
				
			||||||
#    define layer_state_set_user(state) (void)state
 | 
					#    define layer_state_set_user(state) (void)state
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
/* pressed actions cache */
 | 
					/* pressed actions cache */
 | 
				
			||||||
#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE)
 | 
					#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -225,7 +225,6 @@ void mousekey_on(uint8_t code) {
 | 
				
			||||||
        mousekey_accel |= (1 << 1);
 | 
					        mousekey_accel |= (1 << 1);
 | 
				
			||||||
    else if (code == KC_MS_ACCEL2)
 | 
					    else if (code == KC_MS_ACCEL2)
 | 
				
			||||||
        mousekey_accel |= (1 << 2);
 | 
					        mousekey_accel |= (1 << 2);
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void mousekey_off(uint8_t code) {
 | 
					void mousekey_off(uint8_t code) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -888,7 +888,9 @@ void virtser_task(void) {
 | 
				
			||||||
void send_joystick_packet(joystick_t *joystick) {
 | 
					void send_joystick_packet(joystick_t *joystick) {
 | 
				
			||||||
    joystick_report_t rep = {
 | 
					    joystick_report_t rep = {
 | 
				
			||||||
#    if JOYSTICK_AXES_COUNT > 0
 | 
					#    if JOYSTICK_AXES_COUNT > 0
 | 
				
			||||||
        .axes = {joystick->axes[0],
 | 
					        .axes =
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                joystick->axes[0],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#        if JOYSTICK_AXES_COUNT >= 2
 | 
					#        if JOYSTICK_AXES_COUNT >= 2
 | 
				
			||||||
                joystick->axes[1],
 | 
					                joystick->axes[1],
 | 
				
			||||||
| 
						 | 
					@ -909,7 +911,9 @@ void send_joystick_packet(joystick_t *joystick) {
 | 
				
			||||||
#    endif  // JOYSTICK_AXES_COUNT>0
 | 
					#    endif  // JOYSTICK_AXES_COUNT>0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#    if JOYSTICK_BUTTON_COUNT > 0
 | 
					#    if JOYSTICK_BUTTON_COUNT > 0
 | 
				
			||||||
        .buttons = {joystick->buttons[0],
 | 
					        .buttons =
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                joystick->buttons[0],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#        if JOYSTICK_BUTTON_COUNT > 8
 | 
					#        if JOYSTICK_BUTTON_COUNT > 8
 | 
				
			||||||
                joystick->buttons[1],
 | 
					                joystick->buttons[1],
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -316,7 +316,9 @@ void send_joystick_packet(joystick_t *joystick) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    joystick_report_t r = {
 | 
					    joystick_report_t r = {
 | 
				
			||||||
#    if JOYSTICK_AXES_COUNT > 0
 | 
					#    if JOYSTICK_AXES_COUNT > 0
 | 
				
			||||||
        .axes = {joystick->axes[0],
 | 
					        .axes =
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                joystick->axes[0],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#        if JOYSTICK_AXES_COUNT >= 2
 | 
					#        if JOYSTICK_AXES_COUNT >= 2
 | 
				
			||||||
                joystick->axes[1],
 | 
					                joystick->axes[1],
 | 
				
			||||||
| 
						 | 
					@ -337,7 +339,9 @@ void send_joystick_packet(joystick_t *joystick) {
 | 
				
			||||||
#    endif  // JOYSTICK_AXES_COUNT>0
 | 
					#    endif  // JOYSTICK_AXES_COUNT>0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#    if JOYSTICK_BUTTON_COUNT > 0
 | 
					#    if JOYSTICK_BUTTON_COUNT > 0
 | 
				
			||||||
        .buttons = {joystick->buttons[0],
 | 
					        .buttons =
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                joystick->buttons[0],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#        if JOYSTICK_BUTTON_COUNT > 8
 | 
					#        if JOYSTICK_BUTTON_COUNT > 8
 | 
				
			||||||
                joystick->buttons[1],
 | 
					                joystick->buttons[1],
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue