瀏覽代碼

fantastic60: Disable bootmagic and change method of detecting ps2 mouse

fantastic60
Kai Ryu 8 年之前
父節點
當前提交
2dce1236b7
共有 2 個文件被更改,包括 16 次插入2 次删除
  1. 2
    2
      keyboard/fantastic60/Makefile
  2. 14
    0
      keyboard/fantastic60/matrix.c

+ 2
- 2
keyboard/fantastic60/Makefile 查看文件

@@ -121,8 +121,8 @@ endif
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
#MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration

+ 14
- 0
keyboard/fantastic60/matrix.c 查看文件

@@ -74,6 +74,20 @@ void matrix_init(void)
unselect_rows();
init_cols();

#ifdef PS2_MOUSE_ENABLE
// ps2 mouse detecting
DDRC &= ~(1<<PC7);
PORTC |= (1<<PC7);
_delay_us(30); // without this wait read unstable value.
if ((PINC & (1<<PC7)) == 0) {
ps2_mouse_enabled = 1;
}
else {
ps2_mouse_enabled = 0;
}
PORTC &= ~(1<<PC7);
#endif

// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
matrix[i] = 0;