static void setup_handedness(void) { #ifdef EE_HANDS isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); #else #ifdef I2C_MASTER_RIGHT isLeftHand = !has_usb(); #else isLeftHand = has_usb(); #endif #endif }
static void setup_handedness(void) { #ifdef EE_HANDS isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); #else // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) isLeftHand = !has_usb(); #else isLeftHand = has_usb(); #endif #endif }
// this code runs before the usb and keyboard is initialized void matrix_setup(void) { split_keyboard_setup(); if (!has_usb()) { keyboard_slave_loop(); } }
// this code runs before the usb and keyboard is initialized void matrix_setup(void) { split_keyboard_setup(); if (!has_usb()) { //rgblight_init(); keyboard_slave_loop(); } }
static void setup_handedness(void) { #ifdef SPLIT_HAND_PIN // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand pinMode(SPLIT_HAND_PIN, PinDirectionInput); isLeftHand = digitalRead(SPLIT_HAND_PIN); #else #ifdef EE_HANDS isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); #else #ifdef MASTER_RIGHT isLeftHand = !has_usb(); #else isLeftHand = has_usb(); #endif #endif #endif }
static void setup_handedness(void) { #ifdef SPLIT_HAND_PIN // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand pinMode(SPLIT_HAND_PIN, PinDirectionInput); isLeftHand = digitalRead(SPLIT_HAND_PIN); #else #ifdef EE_HANDS isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); #else // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) isLeftHand = !has_usb(); #else isLeftHand = has_usb(); #endif #endif #endif }
void matrix_init_user(void) { #ifdef RGBLIGHT_ENABLE RGB_current_mode = rgblight_config.mode; #endif //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED iota_gfx_init(!has_usb()); // turns on the display #endif }
void split_keyboard_setup(void) { setup_handedness(); if (has_usb()) { keyboard_master_setup(); } else { keyboard_slave_setup(); } sei(); }
void matrix_init_user(void) { #ifdef AUDIO_ENABLE startup_user(); #endif #ifdef RGBLIGHT_ENABLE RGB_current_mode = rgblight_config.mode; #endif //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); iota_gfx_init(!has_usb()); // turns on the display #endif }
void matrix_init_keymap(void) { #ifdef RGBLIGHT_ENABLE RGB_current_mode = rgblight_config.mode; #endif //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED iota_gfx_init(!has_usb()); // turns on the display #endif DDRD &= ~(1<<5); PORTD &= ~(1<<5); DDRB &= ~(1<<0); PORTB &= ~(1<<0);}
int main(void) { setup_hardware(); setup_set_handedness(); sei(); /* wait for USB startup to get ready for debug output */ uint8_t timeout = 200; // timeout when USB is not available while (timeout-- && USB_DeviceState != DEVICE_STATE_Configured) { wait_ms(5); #if defined(INTERRUPT_CONTROL_ENDPOINT) ; #else USB_USBTask(); #endif } /* if (USB_DeviceState != DEVICE_STATE_Configured) { */ if (!has_usb()) { // USB failed to connect, so run this device in slave mode. matrix_init(); serial_slave_init(); while (1) { matrix_slave_scan(); } } /* init modules */ keyboard_init(); host_set_driver(&lufa_driver); #ifdef SLEEP_LED_ENABLE sleep_led_init(); #endif while (1) { keyboard_task(); #if !defined(INTERRUPT_CONTROL_ENDPOINT) USB_USBTask(); #endif } }
void matrix_init_keymap(void) { //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h iota_gfx_init(!has_usb()); // turns on the display }
oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (!has_usb()) return OLED_ROTATION_180; // flip 180 for offhand return rotation; }