aboutsummaryrefslogtreecommitdiff
path: root/keyboard/onekey
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-11-28 14:42:41 +0900
committertmk <nobody@nowhere>2013-11-28 14:43:47 +0900
commit05be3d85d1b29e0bbca243cc194a8f162c8e48f7 (patch)
tree14c04dbddbe8d313f38a8b900394b0fde34821a8 /keyboard/onekey
parent4eb27ee89038e934dcb498df7508199efd9c93f1 (diff)
downloadqmk_firmware-05be3d85d1b29e0bbca243cc194a8f162c8e48f7.tar.gz
qmk_firmware-05be3d85d1b29e0bbca243cc194a8f162c8e48f7.zip
Fix pin configuration of onekey for PS/2 mouse
Diffstat (limited to 'keyboard/onekey')
-rw-r--r--keyboard/onekey/Makefile (renamed from keyboard/onekey/Makefile.lufa)4
-rw-r--r--keyboard/onekey/README.md2
-rw-r--r--keyboard/onekey/config.h4
-rw-r--r--keyboard/onekey/matrix.c18
4 files changed, 14 insertions, 14 deletions
diff --git a/keyboard/onekey/Makefile.lufa b/keyboard/onekey/Makefile
index 60a84ba00..78732e470 100644
--- a/keyboard/onekey/Makefile.lufa
+++ b/keyboard/onekey/Makefile
@@ -116,8 +116,8 @@ CONSOLE_ENABLE = yes # Console for debug(+400)
116#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 116#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
117#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA 117#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
118 118
119PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support 119#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
120PS2_USE_BUSYWAIT = yes # uses primitive reference code 120#PS2_USE_BUSYWAIT = yes # uses primitive reference code
121#PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin 121#PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin
122#PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomened) 122#PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomened)
123 123
diff --git a/keyboard/onekey/README.md b/keyboard/onekey/README.md
index 6ccc99929..7413f3880 100644
--- a/keyboard/onekey/README.md
+++ b/keyboard/onekey/README.md
@@ -1,5 +1,5 @@
1Onekey 1Onekey
2====== 2======
3Just one key keyboard for example. It sends 'a' key if pins PD0 and PD1 are short-circuited. 3Just one key keyboard for example. It sends 'a' key if pins PB0 and PB1 are short-circuited.
4 4
5https://github.com/tmk/tmk_keyboard/issues/56 5https://github.com/tmk/tmk_keyboard/issues/56
diff --git a/keyboard/onekey/config.h b/keyboard/onekey/config.h
index 1d2e052bf..bf1d2b1ed 100644
--- a/keyboard/onekey/config.h
+++ b/keyboard/onekey/config.h
@@ -73,7 +73,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
73# define PS2_CLOCK_PORT PORTD 73# define PS2_CLOCK_PORT PORTD
74# define PS2_CLOCK_PIN PIND 74# define PS2_CLOCK_PIN PIND
75# define PS2_CLOCK_DDR DDRD 75# define PS2_CLOCK_DDR DDRD
76# define PS2_CLOCK_BIT 5 76# define PS2_CLOCK_BIT 1
77# define PS2_DATA_PORT PORTD 77# define PS2_DATA_PORT PORTD
78# define PS2_DATA_PIN PIND 78# define PS2_DATA_PIN PIND
79# define PS2_DATA_DDR DDRD 79# define PS2_DATA_DDR DDRD
@@ -87,7 +87,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
87#define PS2_CLOCK_PORT PORTD 87#define PS2_CLOCK_PORT PORTD
88#define PS2_CLOCK_PIN PIND 88#define PS2_CLOCK_PIN PIND
89#define PS2_CLOCK_DDR DDRD 89#define PS2_CLOCK_DDR DDRD
90#define PS2_CLOCK_BIT 5 90#define PS2_CLOCK_BIT 1
91#define PS2_DATA_PORT PORTD 91#define PS2_DATA_PORT PORTD
92#define PS2_DATA_PIN PIND 92#define PS2_DATA_PIN PIND
93#define PS2_DATA_DDR DDRD 93#define PS2_DATA_DDR DDRD
diff --git a/keyboard/onekey/matrix.c b/keyboard/onekey/matrix.c
index a0a14ff82..29df86832 100644
--- a/keyboard/onekey/matrix.c
+++ b/keyboard/onekey/matrix.c
@@ -139,29 +139,29 @@ uint8_t matrix_key_count(void)
139 139
140/* Column pin configuration 140/* Column pin configuration
141 * col: 0 141 * col: 0
142 * pin: D0 142 * pin: B0
143 */ 143 */
144static void init_cols(void) 144static void init_cols(void)
145{ 145{
146 // Input with pull-up(DDR:0, PORT:1) 146 // Input with pull-up(DDR:0, PORT:1)
147 DDRD &= ~(1<<0); 147 DDRB &= ~(1<<0);
148 PORTD |= (1<<0); 148 PORTB |= (1<<0);
149} 149}
150 150
151static matrix_row_t read_cols(void) 151static matrix_row_t read_cols(void)
152{ 152{
153 return (PIND&(1<<0) ? 0 : (1<<0)); 153 return (PINB&(1<<0) ? 0 : (1<<0));
154} 154}
155 155
156/* Row pin configuration 156/* Row pin configuration
157 * row: 0 157 * row: 0
158 * pin: D1 158 * pin: B1
159 */ 159 */
160static void unselect_rows(void) 160static void unselect_rows(void)
161{ 161{
162 // Hi-Z(DDR:0, PORT:0) to unselect 162 // Hi-Z(DDR:0, PORT:0) to unselect
163 DDRD &= ~0b00000010; 163 DDRB &= ~0b00000010;
164 PORTD &= ~0b00000010; 164 PORTB &= ~0b00000010;
165} 165}
166 166
167static void select_row(uint8_t row) 167static void select_row(uint8_t row)
@@ -169,8 +169,8 @@ static void select_row(uint8_t row)
169 // Output low(DDR:1, PORT:0) to select 169 // Output low(DDR:1, PORT:0) to select
170 switch (row) { 170 switch (row) {
171 case 0: 171 case 0:
172 DDRD |= (1<<1); 172 DDRB |= (1<<1);
173 PORTD &= ~(1<<1); 173 PORTB &= ~(1<<1);
174 break; 174 break;
175 } 175 }
176} 176}