next_usb: Change debug messages
This commit is contained in:
parent
42b50dfd13
commit
5e2288dfa5
1 changed files with 4 additions and 18 deletions
|
|
@ -76,8 +76,6 @@ static bool is_modified = false;
|
||||||
|
|
||||||
#define NEXT_KBD_PWR_READ (NEXT_KBD_PWR_PIN&(1<<NEXT_KBD_PWR_BIT))
|
#define NEXT_KBD_PWR_READ (NEXT_KBD_PWR_PIN&(1<<NEXT_KBD_PWR_BIT))
|
||||||
|
|
||||||
static bool power_state = false;
|
|
||||||
|
|
||||||
/* intialize matrix for scanning. should be called once. */
|
/* intialize matrix for scanning. should be called once. */
|
||||||
void matrix_init(void)
|
void matrix_init(void)
|
||||||
{
|
{
|
||||||
|
|
@ -96,10 +94,6 @@ void matrix_init(void)
|
||||||
NEXT_KBD_PWR_DDR &= ~(1<<NEXT_KBD_PWR_BIT); // Power Button pin to input
|
NEXT_KBD_PWR_DDR &= ~(1<<NEXT_KBD_PWR_BIT); // Power Button pin to input
|
||||||
NEXT_KBD_PWR_PORT |= (1<<NEXT_KBD_PWR_BIT); // KBD_PWR pull up
|
NEXT_KBD_PWR_PORT |= (1<<NEXT_KBD_PWR_BIT); // KBD_PWR pull up
|
||||||
|
|
||||||
_delay_us(1); // prevents from reading immediately after pin config
|
|
||||||
power_state = NEXT_KBD_PWR_READ ? false : true;
|
|
||||||
dprintf("Initial power button state: %b\n", power_state);
|
|
||||||
|
|
||||||
next_kbd_init();
|
next_kbd_init();
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
|
|
@ -156,20 +150,8 @@ uint8_t matrix_scan(void)
|
||||||
|
|
||||||
if (!NEXT_KBD_PWR_READ) {
|
if (!NEXT_KBD_PWR_READ) {
|
||||||
matrix_make(NEXT_KBD_PWR_KEYCODE);
|
matrix_make(NEXT_KBD_PWR_KEYCODE);
|
||||||
power_state = 1;
|
|
||||||
if (is_modified)
|
|
||||||
{
|
|
||||||
dprintf("Power state 1\n");
|
|
||||||
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
matrix_break(NEXT_KBD_PWR_KEYCODE);
|
matrix_break(NEXT_KBD_PWR_KEYCODE);
|
||||||
power_state = 0;
|
|
||||||
if (is_modified)
|
|
||||||
{
|
|
||||||
dprintf("Power state 0\n");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t resp = (next_kbd_recv());
|
uint32_t resp = (next_kbd_recv());
|
||||||
|
|
@ -188,6 +170,7 @@ uint8_t matrix_scan(void)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
dprintf("[ r=%04lX keycode=%02X pressed=%X CTRL=%X SHIFT_LEFT=%X SHIFT_RGHT=%X CMD_LEFT=%X CMD_RGHT=%X ALT_LEFT=%X ALT_RGHT=%X ]\n", \
|
dprintf("[ r=%04lX keycode=%02X pressed=%X CTRL=%X SHIFT_LEFT=%X SHIFT_RGHT=%X CMD_LEFT=%X CMD_RGHT=%X ALT_LEFT=%X ALT_RGHT=%X ]\n", \
|
||||||
resp, \
|
resp, \
|
||||||
NEXT_KBD_KEYCODE(resp), \
|
NEXT_KBD_KEYCODE(resp), \
|
||||||
|
|
@ -200,6 +183,7 @@ uint8_t matrix_scan(void)
|
||||||
NEXT_KBD_PRESSED_ALT_LEFT(resp), \
|
NEXT_KBD_PRESSED_ALT_LEFT(resp), \
|
||||||
NEXT_KBD_PRESSED_ALT_RGHT(resp) \
|
NEXT_KBD_PRESSED_ALT_RGHT(resp) \
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
// Modifier keys don't return keycode; have to check the upper bits
|
// Modifier keys don't return keycode; have to check the upper bits
|
||||||
NEXT_KBD_MAKE_OR_BREAK(ALT_RGHT, 0x51);
|
NEXT_KBD_MAKE_OR_BREAK(ALT_RGHT, 0x51);
|
||||||
|
|
@ -227,6 +211,7 @@ static void matrix_make(uint8_t code)
|
||||||
if (!matrix_is_on(ROW(code), COL(code))) {
|
if (!matrix_is_on(ROW(code), COL(code))) {
|
||||||
matrix[ROW(code)] |= 1<<COL(code);
|
matrix[ROW(code)] |= 1<<COL(code);
|
||||||
is_modified = true;
|
is_modified = true;
|
||||||
|
dprintf("%02X ", code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -236,5 +221,6 @@ static void matrix_break(uint8_t code)
|
||||||
if (matrix_is_on(ROW(code), COL(code))) {
|
if (matrix_is_on(ROW(code), COL(code))) {
|
||||||
matrix[ROW(code)] &= ~(1<<COL(code));
|
matrix[ROW(code)] &= ~(1<<COL(code));
|
||||||
is_modified = true;
|
is_modified = true;
|
||||||
|
dprintf("%02X ", code | 0x80);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue