diff options
Diffstat (limited to 'keyboards/40percentclub/ut47')
-rw-r--r-- | keyboards/40percentclub/ut47/config.h | 5 | ||||
-rw-r--r-- | keyboards/40percentclub/ut47/keyboard.json (renamed from keyboards/40percentclub/ut47/info.json) | 13 | ||||
-rw-r--r-- | keyboards/40percentclub/ut47/led.c | 14 | ||||
-rw-r--r-- | keyboards/40percentclub/ut47/matrix.c | 44 | ||||
-rw-r--r-- | keyboards/40percentclub/ut47/rules.mk | 13 |
5 files changed, 43 insertions, 46 deletions
diff --git a/keyboards/40percentclub/ut47/config.h b/keyboards/40percentclub/ut47/config.h index 8f5756d150..f0182a59f8 100644 --- a/keyboards/40percentclub/ut47/config.h +++ b/keyboards/40percentclub/ut47/config.h @@ -28,10 +28,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - /* Enable GNAP matrix serial output */ #define GNAP_ENABLE diff --git a/keyboards/40percentclub/ut47/info.json b/keyboards/40percentclub/ut47/keyboard.json index 668f277f40..62e4a940a1 100644 --- a/keyboards/40percentclub/ut47/info.json +++ b/keyboards/40percentclub/ut47/keyboard.json @@ -10,6 +10,19 @@ }, "processor": "atmega32u4", "bootloader": "caterina", + "features": { + "bootmagic": true, + "mousekey": true, + "extrakey": true, + "command": true, + "nkro": true + }, + "qmk": { + "locking": { + "enabled": true, + "resync": true + } + }, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/40percentclub/ut47/led.c b/keyboards/40percentclub/ut47/led.c index 867a6e2e2a..fa431de760 100644 --- a/keyboards/40percentclub/ut47/led.c +++ b/keyboards/40percentclub/ut47/led.c @@ -25,16 +25,14 @@ bool led_update_kb(led_t led_state) if (res) { if (led_state.caps_lock) { // output low - DDRB |= (1<<0); - PORTB &= ~(1<<0); - DDRD |= (1<<5); - PORTD &= ~(1<<5); + gpio_set_pin_output(B0); + gpio_write_pin_low(B0); + gpio_set_pin_output(D5); + gpio_write_pin_low(D5); } else { // Hi-Z - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); + gpio_set_pin_input(B0); + gpio_set_pin_input(D5); } } return false; diff --git a/keyboards/40percentclub/ut47/matrix.c b/keyboards/40percentclub/ut47/matrix.c index 02ed88b709..d803f11c5e 100644 --- a/keyboards/40percentclub/ut47/matrix.c +++ b/keyboards/40percentclub/ut47/matrix.c @@ -126,14 +126,18 @@ void matrix_print(void) static void init_cols(void) { // Input with pull-up(DDR:0, PORT:1) - DDRF &= ~(1<<4 | 1<<5 | 1<<6 | 1<<7); - PORTF |= (1<<4 | 1<<5 | 1<<6 | 1<<7); - DDRE &= ~(1<<6); - PORTE |= (1<<6); - DDRD &= ~(1<<7); - PORTD |= (1<<7); - DDRB &= ~(1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6); - PORTB |= (1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6); + gpio_set_pin_input_high(F4); + gpio_set_pin_input_high(F5); + gpio_set_pin_input_high(F6); + gpio_set_pin_input_high(F7); + gpio_set_pin_input_high(E6); + gpio_set_pin_input_high(D7); + gpio_set_pin_input_high(B1); + gpio_set_pin_input_high(B2); + gpio_set_pin_input_high(B3); + gpio_set_pin_input_high(B4); + gpio_set_pin_input_high(B5); + gpio_set_pin_input_high(B6); } static matrix_row_t read_cols(void) @@ -160,10 +164,10 @@ static matrix_row_t read_cols(void) static void unselect_rows(void) { // Hi-Z(DDR:0, PORT:0) to unselect - DDRD &= ~0b00010011; - PORTD &= ~0b00010011; - DDRC &= ~0b01000000; - PORTC &= ~0b01000000; + gpio_set_pin_input(C6); + gpio_set_pin_input(D0); + gpio_set_pin_input(D1); + gpio_set_pin_input(D4); } static void select_row(uint8_t row) @@ -171,20 +175,20 @@ static void select_row(uint8_t row) // Output low(DDR:1, PORT:0) to select switch (row) { case 0: - DDRD |= (1<<1); - PORTD &= ~(1<<1); + gpio_set_pin_output(D1); + gpio_write_pin_low(D1); break; case 1: - DDRD |= (1<<0); - PORTD &= ~(1<<0); + gpio_set_pin_output(D0); + gpio_write_pin_low(D0); break; case 2: - DDRD |= (1<<4); - PORTD &= ~(1<<4); + gpio_set_pin_output(D4); + gpio_write_pin_low(D4); break; case 3: - DDRC |= (1<<6); - PORTC &= ~(1<<6); + gpio_set_pin_output(C6); + gpio_write_pin_low(C6); break; } } diff --git a/keyboards/40percentclub/ut47/rules.mk b/keyboards/40percentclub/ut47/rules.mk index 6ba6aa5f6f..5480f61b9b 100644 --- a/keyboards/40percentclub/ut47/rules.mk +++ b/keyboards/40percentclub/ut47/rules.mk @@ -1,16 +1,3 @@ -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # Enable N-Key Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -AUDIO_ENABLE = no # Audio output - -# custom matrix setup CUSTOM_MATRIX = yes SRC += matrix.c UART_DRIVER_REQUIRED = yes |