Skip to content

Commit

Permalink
start test usb anc ble switch
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Jun 17, 2021
1 parent 278d0e7 commit 67fe370
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 13 deletions.
2 changes: 1 addition & 1 deletion keyboards/yandrstudio/whiteMouse28T/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
//#define MATRIX_HAS_GHOST

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
#define DEBOUNCE 3



Expand Down
12 changes: 6 additions & 6 deletions keyboards/yandrstudio/whiteMouse28T/f401/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@
#endif


#define SERIAL_DRIVER SD1
#define SD1_TX_PIN A9
#define SD1_TX_PAL_MODE 7
#define SD1_RX_PIN A10
#define SD1_RX_PAL_MODE 7
// #define SERIAL_DRIVER SD1
// #define SD1_TX_PIN A9
// #define SD1_TX_PAL_MODE 7
// #define SD1_RX_PIN A10
// #define SD1_RX_PAL_MODE 7


#define ADC_RESOLUTION ADC_CFGR1_RES_12BIT
// #define ADC_RESOLUTION ADC_CFGR1_RES_12BIT


4 changes: 2 additions & 2 deletions keyboards/yandrstudio/whiteMouse28T/f401/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#undef HAL_USE_SPI
#define HAL_USE_SPI FALSE

#undef HAL_USE_ADC
#define HAL_USE_ADC TRUE
// #undef HAL_USE_ADC
// #define HAL_USE_ADC TRUE


#undef SERIAL_USB_BUFFERS_SIZE
Expand Down
4 changes: 2 additions & 2 deletions keyboards/yandrstudio/whiteMouse28T/f401/mcuconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#define STM32_SERIAL_USE_USART1 TRUE


#undef STM32_ADC_USE_ADC1
#define STM32_ADC_USE_ADC1 TRUE
// #undef STM32_ADC_USE_ADC1
// #define STM32_ADC_USE_ADC1 TRUE

#undef STM32_NO_INIT
#undef STM32_HSI_ENABLED
Expand Down
2 changes: 0 additions & 2 deletions keyboards/yandrstudio/whiteMouse28T/f401/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ SRC += eep/eeprom_stm32.c
SRC += eep/flash_stm32.c
OPT_DEFS += -DEEPROM_EMU_STM32F401xC
COMMON_VPATH += keyboards/yandrstudio/whiteMouse28T/f401/eep

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

SRC += analog.c

QUANTUM_LIB_SRC += uart.c
62 changes: 62 additions & 0 deletions keyboards/yandrstudio/whiteMouse28T/keymaps/usbState/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/* 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


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
// }
}
3 changes: 3 additions & 0 deletions keyboards/yandrstudio/whiteMouse28T/keymaps/usbState/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VIA_ENABLE = yes

QUANTUM_LIB_SRC += uart.c

0 comments on commit 67fe370

Please sign in to comment.