mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
adb: create autopoll variables directly within ADBBusState
Rather than each ADB implementation requiring its own functions to manage autopoll state, timers, and autopoll masks prepare to move this information directly into ADBBusState. Add external functions within adb.h to allow each ADB implementation to manage the new autopoll variables. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Tested-by: Finn Thain <fthain@telegraphics.com.au> Acked-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20200623204936.24064-8-mark.cave-ayland@ilande.co.uk>
This commit is contained in:
parent
0606b28830
commit
da52c083ac
2 changed files with 90 additions and 0 deletions
|
@ -75,12 +75,25 @@ struct ADBBusState {
|
|||
ADBDevice *devices[MAX_ADB_DEVICES];
|
||||
int nb_devices;
|
||||
int poll_index;
|
||||
|
||||
QEMUTimer *autopoll_timer;
|
||||
bool autopoll_enabled;
|
||||
uint8_t autopoll_rate_ms;
|
||||
uint16_t autopoll_mask;
|
||||
void (*autopoll_cb)(void *opaque);
|
||||
void *autopoll_cb_opaque;
|
||||
};
|
||||
|
||||
int adb_request(ADBBusState *s, uint8_t *buf_out,
|
||||
const uint8_t *buf, int len);
|
||||
int adb_poll(ADBBusState *s, uint8_t *buf_out, uint16_t poll_mask);
|
||||
|
||||
void adb_set_autopoll_enabled(ADBBusState *s, bool enabled);
|
||||
void adb_set_autopoll_rate_ms(ADBBusState *s, int rate_ms);
|
||||
void adb_set_autopoll_mask(ADBBusState *s, uint16_t mask);
|
||||
void adb_register_autopoll_callback(ADBBusState *s, void (*cb)(void *opaque),
|
||||
void *opaque);
|
||||
|
||||
#define TYPE_ADB_KEYBOARD "adb-keyboard"
|
||||
#define TYPE_ADB_MOUSE "adb-mouse"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue