aboutsummaryrefslogtreecommitdiff
path: root/keyboards/vitamins_included/rev2/rev2.c
blob: e445a3da456a4b42aa7a38191f9b33f37250e956 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "quantum.h"

bool is_keyboard_left(void) {
    #if defined(MASTER_LEFT)
        return is_keyboard_master();
    #elif defined(MASTER_RIGHT)
        return !is_keyboard_master();
    #elif defined(SPLIT_HAND_PIN)
        // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand
        gpio_set_pin_input_high(SPLIT_HAND_PIN);
        bool x = !gpio_read_pin(SPLIT_HAND_PIN);
        gpio_set_pin_input(SPLIT_HAND_PIN);
        return x;
    #elif defined(EE_HANDS)
        return eeprom_read_byte(EECONFIG_HANDEDNESS);
    #endif

    return is_keyboard_master();
}