Skip to content

Commit

Permalink
yd67ble do6m
Browse files Browse the repository at this point in the history
  • Loading branch information
yangdigi committed Jun 22, 2024
1 parent 9b47ba2 commit 54406d4
Show file tree
Hide file tree
Showing 11 changed files with 172 additions and 225 deletions.
25 changes: 16 additions & 9 deletions keyboards/ydkb/debounce_pk.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,17 @@
#ifndef DEBOUNCE_DN
#define DEBOUNCE_DN 5
#endif
#ifndef DEBOUNCE16_DN
#define DEBOUNCE16_DN DEBOUNCE_DN
#endif

#ifndef DEBOUNCE_NK
#define DEBOUNCE_NK 1
#endif
#ifndef DEBOUNCE16_NK
#define DEBOUNCE16_NK DEBOUNCE_NK
#endif

#ifndef DEBOUNCE_UP
#define DEBOUNCE_UP 5
#endif
#ifndef DEBOUNCE16_UP
#define DEBOUNCE16_UP DEBOUNCE_UP

#ifndef DOUBLE_CLICK_FIX_DELAY //default 10
#define DOUBLE_CLICK_FIX_DELAY 10
#endif

#if (DEBOUNCE_DN < 8) && (DEBOUNCE_NK < 8) && (DEBOUNCE_UP < 8)
Expand All @@ -35,6 +30,18 @@
#else
#error "DEBOUNCE VALUE must not exceed 7"
#endif
/*
#ifndef DEBOUNCE16_DN
#define DEBOUNCE16_DN DEBOUNCE_DN
#endif
#ifndef DEBOUNCE16_NK
#define DEBOUNCE16_NK DEBOUNCE_NK
#endif
#ifndef DEBOUNCE16_UP
#define DEBOUNCE16_UP DEBOUNCE_UP
#endif
#if (DEBOUNCE16_DN < 16) && (DEBOUNCE16_NK < 16) && (DEBOUNCE16_UP < 16)
#define DEBOUNCE16_DN_MASK (uint16_t)(~(0x8000 >> DEBOUNCE16_DN))
Expand All @@ -43,6 +50,6 @@
#else
#error "DEBOUNCE16 VALUE must not exceed 15"
#endif

*/

#endif
77 changes: 11 additions & 66 deletions keyboards/ydkb/yd67ble/config.h
Original file line number Diff line number Diff line change
@@ -1,90 +1,35 @@
#pragma once

#include "config_common.h"
#include "config_ble51.h"

/* USB Device descriptor parameter */
#define FW_VER QMK_DN17
#define FW_VER_VIA VIA_DN17
#define FW_VER_VIAL VIAL_DN17
#define VENDOR_ID 0x9D5B
#define PRODUCT_ID 0x2167
#define FW_VER_DATE DO6M
#define VENDOR_ID 0x9D5B
#define PRODUCT_ID 0x2167
#define DEVICE_VER 0x0011
#define MANUFACTURER YDKB_KBDFans
#define PRODUCT YD67BLE (FW_VER)


/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 16

#define DEFAULT_6KRO // macOS's Capslock switching between Chinese and English has compatibility issues with NKRO


#define TAPPING_TOGGLE 2

#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)


/* key combination for command */
#define IS_COMMAND() ( \
(get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) || \
(get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT))) \
)
/* disable command for default layer */
#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS 0
#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS 0

/* fix space cadet rollover issue */
#define DISABLE_SPACE_CADET_ROLLOVER

#if defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB1286__)
#define UCSR1D _SFR_MEM8(0xCB)
#define RTSEN 0
#define CTSEN 1

#define SERIAL_UART_BAUD 76800
#define SERIAL_UART_DATA UDR1
#define SERIAL_UART_UBRR ((F_CPU/(8.0*SERIAL_UART_BAUD)-1+0.5))
#define SERIAL_UART_RXD_VECT USART1_RX_vect
#define SERIAL_UART_TXD_READY (UCSR1A&(1<<UDRE1))
#define SERIAL_UART_INIT() do { \
cli(); \
UBRR1L = (uint8_t) SERIAL_UART_UBRR; \
UBRR1H = ((uint16_t)SERIAL_UART_UBRR>>8); \
UCSR1B |= (1<<RXCIE1) | (1<<RXEN1); \
UCSR1B |= (0<<TXCIE1) | (1<<TXEN1); \
UCSR1C |= (0<<UPM11) | (0<<UPM10); \
UCSR1A |= (1<<U2X1); \
sei(); \
} while(0)
#else
#error "USART configuration is needed."
#endif
#define SUSPEND_ACTION
/* BT Power Control */
#define BT_POWERED (~PORTF & (1<<7))
#define bt_power_init() do { DDRF |= (1<<7); PORTF &= ~(1<<7);} while(0)
#define turn_off_bt() do { PORTF |= (1<<7); UCSR1B &= ~(1<<TXEN1); } while(0)
#define turn_on_bt() do { PORTF &= ~(1<<7); if (~UCSR1B & (1<<TXEN1)) _delay_ms(200); UCSR1B |= (1<<TXEN1); } while(0)
#define bt_power_reset() do {PORTF |= (1<<7); WAIT_MS(100); PORTF &= ~(1<<7);} while(0)
#define turn_off_bt() do { PORTF |= (1<<7); UCSR1B = (1<<RXCIE1 | 1<<RXEN1); } while(0)
#define turn_on_bt() do { PORTF &= ~(1<<7); if (UCSR1B == (1<<RXCIE1 | 1<<RXEN1)) WAIT_MS(200); UCSR1B = (1<<RXCIE1 | 1<<RXEN1 | 1<<TXEN1); } while(0)

#define BLE_NAME "YD67BLE"
#define BLE_BATTERY_SERVICE
#define BT_POWER_SAVE_TIME 3000

#define UPDATE_BATTERY_WHEN_CHARGING
#define BATTERY_CHARGING (~PINC & (1<<7))
#define CHARGING_FIX_VALUE 90
#define CHARGING_FIX_VALUE 70
#define CHARGING_STATE_INIT() do { DDRC &= ~(1<<7); PORTC |= (1<<7);} while(0)
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG

/* disable print */
//#define NO_PRINT

/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
20 changes: 0 additions & 20 deletions keyboards/ydkb/yd67ble/keymaps/via/config.h

This file was deleted.

32 changes: 0 additions & 32 deletions keyboards/ydkb/yd67ble/keymaps/via/keymap.c

This file was deleted.

5 changes: 0 additions & 5 deletions keyboards/ydkb/yd67ble/keymaps/via/readme.md

This file was deleted.

1 change: 0 additions & 1 deletion keyboards/ydkb/yd67ble/keymaps/via/rules.mk

This file was deleted.

5 changes: 0 additions & 5 deletions keyboards/ydkb/yd67ble/keymaps/vial/readme.md

This file was deleted.

4 changes: 3 additions & 1 deletion keyboards/ydkb/yd67ble/keymaps/vial/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ VIA_ENABLE = yes
VIAL_ENABLE = yes
VIAL_INSECURE = yes
QMK_SETTINGS = no
TAP_DANCE_ENABLE = no
TAP_DANCE_ENABLE = yes
COMBO_ENABLE = yes
KEY_OVERRIDE_ENABLE = no
Loading

0 comments on commit 54406d4

Please sign in to comment.