Skip to content

Commit

Permalink
add wm uart map
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Jun 14, 2021
1 parent eacbc03 commit 8e30997
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 10 deletions.
2 changes: 1 addition & 1 deletion keyboards/yandrstudio/r65ble/keymaps/test_uart/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions keyboards/yandrstudio/r65ble/mcuconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
/*
* UART driver system settings.
*/


#undef STM32_SERIAL_USE_USART1
#define STM32_SERIAL_USE_USART1 TRUE

2 changes: 1 addition & 1 deletion keyboards/yandrstudio/whiteMouse28T/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
11 changes: 6 additions & 5 deletions keyboards/yandrstudio/whiteMouse28T/f401/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@
#include_next <halconf.h>

#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

Expand Down
4 changes: 3 additions & 1 deletion keyboards/yandrstudio/whiteMouse28T/f401/mcuconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
68 changes: 68 additions & 0 deletions keyboards/yandrstudio/whiteMouse28T/keymaps/uart/keymap.c
Original file line number Diff line number Diff line change
@@ -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 <http:https://www.gnu.org/licenses/>.
*/
#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
// }
}


2 changes: 2 additions & 0 deletions keyboards/yandrstudio/whiteMouse28T/keymaps/uart/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VIA_ENABLE = yes
QUANTUM_LIB_SRC += uart.c

0 comments on commit 8e30997

Please sign in to comment.