diff options
Diffstat (limited to 'keyboards/gboards/gergo')
-rw-r--r-- | keyboards/gboards/gergo/gergo.c | 21 | ||||
-rw-r--r-- | keyboards/gboards/gergo/keyboard.json (renamed from keyboards/gboards/gergo/info.json) | 7 | ||||
-rw-r--r-- | keyboards/gboards/gergo/matrix.c | 4 | ||||
-rw-r--r-- | keyboards/gboards/gergo/rules.mk | 4 |
4 files changed, 19 insertions, 17 deletions
diff --git a/keyboards/gboards/gergo/gergo.c b/keyboards/gboards/gergo/gergo.c index 41d383d408..1ec6105eeb 100644 --- a/keyboards/gboards/gergo/gergo.c +++ b/keyboards/gboards/gergo/gergo.c @@ -5,17 +5,16 @@ i2c_status_t mcp23018_status = 0x20; void matrix_init_kb(void) { // (tied to Vcc for hardware convenience) - //DDRB &= ~(1<<4); // set B(4) as input - //PORTB &= ~(1<<4); // set B(4) internal pull-up disabled + //gpio_set_pin_input(B4); // set B(4) as input, internal pull-up disabled - // unused pins - C7, D4, D5, D7, E6 + // unused pins - C7, D4, D5, D6, D7, E6 // set as input with internal pull-up enabled - DDRC &= ~(1<<7); - DDRD &= ~(1<<5 | 1<<4 | 1<<6 | 1<<7); - DDRE &= ~(1<<6); - PORTC |= (1<<7); - PORTD |= (1<<5 | 1<<4 | 1<<6 | 1<<7); - PORTE |= (1<<6); + gpio_set_pin_input_high(C7); + gpio_set_pin_input_high(D4); + gpio_set_pin_input_high(D5); + gpio_set_pin_input_high(D6); + gpio_set_pin_input_high(D7); + gpio_set_pin_input_high(E6); matrix_init_user(); } @@ -44,14 +43,14 @@ uint8_t init_mcp23018(void) { // - input : input : 1 // - driving : output : 0 uint8_t data[] = {0b10000000, 0b11111111}; - mcp23018_status = i2c_writeReg(I2C_ADDR, IODIRA, data, sizeof(data), I2C_TIMEOUT); + mcp23018_status = i2c_write_register(I2C_ADDR, IODIRA, data, sizeof(data), I2C_TIMEOUT); if (!mcp23018_status) { // set pull-up // - unused : on : 1 // - input : on : 1 // - driving : off : 0 - mcp23018_status = i2c_writeReg(I2C_ADDR, GPPUA, data, sizeof(data), I2C_TIMEOUT); + mcp23018_status = i2c_write_register(I2C_ADDR, GPPUA, data, sizeof(data), I2C_TIMEOUT); } // SREG=sreg_prev; diff --git a/keyboards/gboards/gergo/info.json b/keyboards/gboards/gergo/keyboard.json index bc53f2db5f..e576ac8012 100644 --- a/keyboards/gboards/gergo/info.json +++ b/keyboards/gboards/gergo/keyboard.json @@ -16,6 +16,13 @@ }, "processor": "atmega32u4", "bootloader": "atmel-dfu", + "features": { + "bootmagic": true, + "mousekey": false, + "extrakey": true, + "console": true, + "command": true + }, "tapping": { "toggle": 1 }, diff --git a/keyboards/gboards/gergo/matrix.c b/keyboards/gboards/gergo/matrix.c index b4885361fb..1fa80a58a0 100644 --- a/keyboards/gboards/gergo/matrix.c +++ b/keyboards/gboards/gergo/matrix.c @@ -297,7 +297,7 @@ static matrix_row_t read_cols(uint8_t row) { return 0; } else { uint8_t data = 0; - mcp23018_status = i2c_readReg(I2C_ADDR, GPIOB, &data, 1, I2C_TIMEOUT); + mcp23018_status = i2c_read_register(I2C_ADDR, GPIOB, &data, 1, I2C_TIMEOUT); #ifdef DEBUG_MATRIX if (~data != 0x00) xprintf("I2C: %d\n", ~data); @@ -344,7 +344,7 @@ static void select_row(uint8_t row) if (mcp23018_status) { // do nothing on error } else { // set active row low : 0 // set other rows hi-Z : 1 uint8_t data = 0xFF & ~(1<<row); - mcp23018_status = i2c_writeReg(I2C_ADDR, GPIOA, &data, 1, I2C_TIMEOUT); + mcp23018_status = i2c_write_register(I2C_ADDR, GPIOA, &data, 1, I2C_TIMEOUT); } } else { // Output low(DDR:1, PORT:0) to select diff --git a/keyboards/gboards/gergo/rules.mk b/keyboards/gboards/gergo/rules.mk index d789b349da..77c632bc1c 100644 --- a/keyboards/gboards/gergo/rules.mk +++ b/keyboards/gboards/gergo/rules.mk @@ -2,10 +2,6 @@ # change yes to no to disable # CUSTOM_MATRIX = yes -EXTRAKEY_ENABLE = yes -CONSOLE_ENABLE = yes -COMMAND_ENABLE = yes -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite SRC += matrix.c I2C_DRIVER_REQUIRED = yes |