Merge branch 'adb_address_resolution'

This commit is contained in:
tmk 2022-05-30 20:48:08 +09:00
commit 4923f09377
6 changed files with 3563 additions and 3434 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -47,9 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// https://github.com/tmk/tmk_keyboard/issues/724
#define ADB_MOUSE_2ND_BUTTON_QUIRK
// Scan unsupported devices with register0 when SRQ is asserted
#define ADB_SRQ_SCAN_REG0
/* ADB port setting */
#define ADB_PORT PORTD

File diff suppressed because it is too large Load diff

View file

@ -164,7 +164,7 @@ uint8_t adb_host_talk_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len)
// the stop by a minimum of 140 J.lS beyond its normal duration, as shown in Figure 8-15."
// http://ww1.microchip.com/downloads/en/AppNotes/00591b.pdf
if (!data_in()) { adb_srq = true; } else { adb_srq = false; }
if (!wait_data_hi(500)) { // Service Request(310us Adjustable Keyboard): just ignored
if (!wait_data_hi(500)) { // wait for end of SRQ:(310us Adjustable Keyboard)
xprintf("R");
sei();
return 0;
@ -198,12 +198,14 @@ uint8_t adb_host_talk_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len)
// |________| |
//
uint8_t lo = (uint8_t) wait_data_hi(130);
if (!lo)
goto error; // no more bit or after stop bit
if (!lo) {
goto error; // SRQ?
}
uint8_t hi = (uint8_t) wait_data_lo(lo);
if (!hi)
goto error; // stop bit extedned by Srq?
if (!hi) {
goto error; // stop bit
}
if (n/8 >= len) continue; // can't store in buf
@ -216,6 +218,7 @@ uint8_t adb_host_talk_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len)
error:
sei();
_delay_us(200);
return n/8;
}
@ -244,6 +247,7 @@ void adb_host_listen_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len)
}
place_bit0(); // Stopbit(0);
sei();
_delay_us(200);
}
void adb_host_listen(uint8_t addr, uint8_t reg, uint8_t data_h, uint8_t data_l)

View file

@ -68,11 +68,6 @@ POSSIBILITY OF SUCH DAMAGE.
#define ADB_ADDR_13 13
#define ADB_ADDR_14 14
#define ADB_ADDR_15 15
// for temporary purpose, do not use for polling
#define ADB_ADDR_KBD_POLL 9
#define ADB_ADDR_MOUSE_POLL 10
#define ADB_ADDR_KBD_TMP 14
#define ADB_ADDR_MOUSE_TMP 15
// Command Type
#define ADB_CMD_RESET 0
#define ADB_CMD_FLUSH 1