Skip to content

Commit 5fdb49b

Browse files
authored
Fixup handwired/kbod (#18754)
1 parent f731e27 commit 5fdb49b

File tree

4 files changed

+9
-71
lines changed

4 files changed

+9
-71
lines changed

keyboards/handwired/kbod/config.h

+1-41
Original file line numberDiff line numberDiff line change
@@ -23,60 +23,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2323
#define MATRIX_ROWS 8
2424
#define MATRIX_COLS 8
2525

26-
/*
27-
* Keyboard Matrix Assignments
28-
*
29-
* Change this to how you wired your keyboard
30-
* COLS: AVR pins used for columns, left to right
31-
* ROWS: AVR pins used for rows, top to bottom
32-
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
33-
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
34-
*
35-
*/
3626
#define MATRIX_ROW_PINS { C6, D7, E6, B4, B5, B6, B7, D6 }
3727
#define MATRIX_COL_PINS { D0, D1, F0, F1, F4, F5, F6, F7 }
3828

39-
/* COL2ROW, ROW2COL*/
4029
#define DIODE_DIRECTION COL2ROW
4130

42-
// #define BACKLIGHT_PIN B7
43-
// #define BACKLIGHT_BREATHING
44-
// #define BACKLIGHT_LEVELS 3
31+
#define LED_CAPS_LOCK_PIN B0
4532

4633
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
4734
#define DEBOUNCE 5
4835

49-
/* define if matrix has ghost (lacks anti-ghosting diodes) */
50-
//#define MATRIX_HAS_GHOST
51-
52-
/* number of backlight levels */
53-
5436
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
5537
#define LOCKING_SUPPORT_ENABLE
5638
/* Locking resynchronize hack */
5739
#define LOCKING_RESYNC_ENABLE
5840

59-
/*
60-
* Force NKRO
61-
*
62-
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
63-
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
64-
* makefile for this to work.)
65-
*
66-
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
67-
* until the next keyboard reset.
68-
*
69-
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
70-
* fully operational during normal computer usage.
71-
*
72-
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
73-
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
74-
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
75-
* power-up.
76-
*
77-
*/
78-
//#define FORCE_NKRO
79-
8041
/*
8142
* Feature disable options
8243
* These options are also useful to firmware size reduction.
@@ -93,5 +54,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
9354
//#define NO_ACTION_TAPPING
9455
//#define NO_ACTION_ONESHOT
9556

96-
#undef TAPPING_TOGGLE
9757
#define TAPPING_TOGGLE 2

keyboards/handwired/kbod/keymaps/default/keymap.c

+8-16
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
6161
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
6262
switch (keycode) {
6363
case SFT_ESC:
64-
SET_WHETHER(MODS_PRESSED(SHIFT), KC_ESC, KC_GRAVE);
64+
SET_WHETHER(MODS_PRESSED(SFT), KC_ESC, KC_GRAVE);
6565

6666
return false;
6767

@@ -75,24 +75,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
7575
}
7676
}
7777

78-
void led_set_user(uint8_t usb_led) {
79-
if (usb_led & _BV(USB_LED_CAPS_LOCK)) {
80-
PORTB |= _BV(PB0);
81-
} else {
82-
PORTB &= ~_BV(PB0);
83-
}
84-
}
85-
8678
void matrix_init_user(void) {
87-
DDRB |= _BV(PB0);
88-
DDRC |= _BV(PC7);
79+
setPinOutput(C7);
80+
writePinLow(C7);
8981
}
9082

91-
void matrix_scan_user(void) {
92-
uint8_t layer = get_highest_layer(layer_state);
93-
if (layer) {
94-
PORTC |= _BV(PC7);
83+
layer_state_t layer_state_set_user(layer_state_t state) {
84+
if (get_highest_layer(state)) {
85+
writePinHigh(C7);
9586
} else {
96-
PORTC &= ~_BV(PC7);
87+
writePinLow(C7);
9788
}
89+
return state;
9890
}

keyboards/handwired/kbod/keymaps/default/readme.md

-5
This file was deleted.

keyboards/handwired/kbod/keymaps/default/rules.mk

-9
This file was deleted.

0 commit comments

Comments
 (0)