mirror of
https://github.com/flowenol/MacintoshKeyboardRemapper.git
synced 2024-11-24 20:30:54 +00:00
keyboard pin swap
This commit is contained in:
parent
278ca3f36d
commit
110465f960
@ -61,7 +61,7 @@ void read_data_from_kbd(kbd_state next_state) {
|
|||||||
if (keyboard_state == READ_MODEL_NUMBER) {
|
if (keyboard_state == READ_MODEL_NUMBER) {
|
||||||
model_number = kbd_data_read;
|
model_number = kbd_data_read;
|
||||||
} else if (kbd_data_read != TEST_ACK && kbd_data_read != TEST_NAK) {
|
} else if (kbd_data_read != TEST_ACK && kbd_data_read != TEST_NAK) {
|
||||||
kbd_last_data_read_index = (kbd_last_data_read_index + 1) % 4;
|
kbd_last_data_read_index = (kbd_last_data_read_index + 1) % KBD_BUFFER_SIZE;
|
||||||
kbd_last_data_read[kbd_last_data_read_index] = kbd_data_read;
|
kbd_last_data_read[kbd_last_data_read_index] = kbd_data_read;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#define CLK_MAC 5
|
#define CLK_MAC 5
|
||||||
#define DATA_MAC 6
|
#define DATA_MAC 6
|
||||||
|
|
||||||
#define CLK_KBD 7
|
#define CLK_KBD 8
|
||||||
#define DATA_KBD 8
|
#define DATA_KBD 7
|
||||||
|
|
||||||
#define CLOCK_START_MSEC 500
|
#define CLOCK_START_MSEC 500
|
||||||
#define CLOCK_TRANSITION_USEC 300
|
#define CLOCK_TRANSITION_USEC 300
|
||||||
@ -13,6 +13,8 @@
|
|||||||
#define MAC_RESP_DELAY_MSEC 240
|
#define MAC_RESP_DELAY_MSEC 240
|
||||||
#define MAC_DETECT_READY_USEC 300
|
#define MAC_DETECT_READY_USEC 300
|
||||||
|
|
||||||
|
#define KBD_BUFFER_SIZE 4
|
||||||
|
|
||||||
// command constants
|
// command constants
|
||||||
const byte MODEL_NUMBER_CMD = 0x16;
|
const byte MODEL_NUMBER_CMD = 0x16;
|
||||||
const byte TEST_CMD = 0x36;
|
const byte TEST_CMD = 0x36;
|
||||||
@ -53,7 +55,7 @@ unsigned long kbd_clock_transition_start;
|
|||||||
unsigned long kbd_delay_start;
|
unsigned long kbd_delay_start;
|
||||||
|
|
||||||
byte kbd_data_read;
|
byte kbd_data_read;
|
||||||
byte kbd_last_data_read[4];
|
byte kbd_last_data_read[KBD_BUFFER_SIZE];
|
||||||
short kbd_last_data_read_index = -1;
|
short kbd_last_data_read_index = -1;
|
||||||
byte model_number;
|
byte model_number;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user