diff --git a/keyboards/yandrstudio/r65ble/keymaps/test_uart/keymap.c b/keyboards/yandrstudio/r65ble/keymaps/test_uart/keymap.c index 1e7f5b122a72..0881a14a2848 100644 --- a/keyboards/yandrstudio/r65ble/keymaps/test_uart/keymap.c +++ b/keyboards/yandrstudio/r65ble/keymaps/test_uart/keymap.c @@ -124,7 +124,7 @@ void oled_task_user(void) { void keyboard_post_init_user(void) { - // uart_init(115200); + uart_init(115200); debug_enable=true; // debug_matrix=true; debug_keyboard=true; diff --git a/keyboards/yandrstudio/r65ble/mcuconf.h b/keyboards/yandrstudio/r65ble/mcuconf.h index 57607f48009a..22a14621d850 100644 --- a/keyboards/yandrstudio/r65ble/mcuconf.h +++ b/keyboards/yandrstudio/r65ble/mcuconf.h @@ -17,8 +17,6 @@ /* * UART driver system settings. */ - - #undef STM32_SERIAL_USE_USART1 #define STM32_SERIAL_USE_USART1 TRUE diff --git a/keyboards/yandrstudio/whiteMouse28T/config.h b/keyboards/yandrstudio/whiteMouse28T/config.h index 08dae645004a..65f322d4cce9 100644 --- a/keyboards/yandrstudio/whiteMouse28T/config.h +++ b/keyboards/yandrstudio/whiteMouse28T/config.h @@ -29,7 +29,7 @@ #define MATRIX_COLS 7 // 0 1 2 3 4 5 6 -#define MATRIX_COL_PINS { B14, B15, A8, A9, A10, B4, B3} +#define MATRIX_COL_PINS { B14, B15, A8, A2, A3, B4, B3} #define MATRIX_ROW_PINS { B13, B12, B7, B6} /* COL2ROW or ROW2COL */ diff --git a/keyboards/yandrstudio/whiteMouse28T/f401/halconf.h b/keyboards/yandrstudio/whiteMouse28T/f401/halconf.h index ceffe801a72f..6dfee8652349 100644 --- a/keyboards/yandrstudio/whiteMouse28T/f401/halconf.h +++ b/keyboards/yandrstudio/whiteMouse28T/f401/halconf.h @@ -19,17 +19,18 @@ #include_next #undef HAL_USE_PWM -#define HAL_USE_PWM TRUE +#define HAL_USE_PWM TRUE -// #define HAL_USE_SERIAL TRUE +#undef HAL_USE_SERIAL +#define HAL_USE_SERIAL TRUE + +#undef HAL_USE_SPI +#define HAL_USE_SPI TRUE #undef SERIAL_USB_BUFFERS_SIZE #define SERIAL_USB_BUFFERS_SIZE 256 -#undef HAL_USE_SPI -#define HAL_USE_SPI TRUE - #undef SPI_USE_WAIT #define SPI_USE_WAIT TRUE diff --git a/keyboards/yandrstudio/whiteMouse28T/f401/mcuconf.h b/keyboards/yandrstudio/whiteMouse28T/f401/mcuconf.h index 49983c27dd81..3e8d9acc921e 100644 --- a/keyboards/yandrstudio/whiteMouse28T/f401/mcuconf.h +++ b/keyboards/yandrstudio/whiteMouse28T/f401/mcuconf.h @@ -21,10 +21,12 @@ #undef STM32_PWM_USE_TIM3 #define STM32_PWM_USE_TIM3 TRUE - #undef STM32_SPI_USE_SPI1 #define STM32_SPI_USE_SPI1 TRUE +#undef STM32_SERIAL_USE_USART1 +#define STM32_SERIAL_USE_USART1 TRUE + #undef STM32_NO_INIT #undef STM32_HSI_ENABLED #undef STM32_LSI_ENABLED diff --git a/keyboards/yandrstudio/whiteMouse28T/keymaps/uart/keymap.c b/keyboards/yandrstudio/whiteMouse28T/keymaps/uart/keymap.c new file mode 100644 index 000000000000..e562c6dd92f4 --- /dev/null +++ b/keyboards/yandrstudio/whiteMouse28T/keymaps/uart/keymap.c @@ -0,0 +1,68 @@ +/* Copyright 2021 JasonRen(biu) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#include "uart.h" +#include "print.h" + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, + RGB_TOG, KC_Z, KC_X, KC_C, KC_V, MO(1), KC_RSFT), + LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_SPACE,KC_TRNS, KC_TRNS, KC_TRNS) +}; + + + + +void keyboard_post_init_user(void) { +// eeconfig_init(); + uart_init(115200); + debug_enable=true; +// debug_matrix=true; + debug_keyboard=true; +// //debug_mouse=true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + uart_putchar(0xff); + uart_putchar(keycode >> 8); + uart_putchar(keycode & 0xff); + uart_putchar(0xfe); + uprintf("KL: kc: 0x%04X, col: %u, row: %u, pressed: %b, time: %u, interrupt: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); + } + return true; + // switch (keycode) { + // case KC_N: + // if (record->event.pressed) { + // uart_putchar('#'); + // } else { + // // Do something else when release + // } + // return false; // Skip all further processing of this key + // default: + // return true; // Process all other keycodes normally + // } +} + + diff --git a/keyboards/yandrstudio/whiteMouse28T/keymaps/uart/rules.mk b/keyboards/yandrstudio/whiteMouse28T/keymaps/uart/rules.mk new file mode 100644 index 000000000000..d643d5f76138 --- /dev/null +++ b/keyboards/yandrstudio/whiteMouse28T/keymaps/uart/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +QUANTUM_LIB_SRC += uart.c