feat: coordinate native rumble with deadline-aware scheduling
This commit is contained in:
parent
be0f3579c6
commit
dcc97e05ba
28 changed files with 1079 additions and 106 deletions
|
|
@ -28,4 +28,6 @@ void btstack_run_loop_set_timer_handler(btstack_timer_source_t* timer,
|
|||
void btstack_run_loop_set_timer(btstack_timer_source_t* timer, uint32_t timeout_ms);
|
||||
void btstack_run_loop_add_timer(btstack_timer_source_t* timer);
|
||||
bool btstack_run_loop_remove_timer(btstack_timer_source_t* timer);
|
||||
bool l2cap_can_send_packet_now(uint16_t cid);
|
||||
int hci_number_free_acl_slots_for_handle(uint16_t handle);
|
||||
uint8_t l2cap_request_can_send_now_event(uint16_t cid);
|
||||
|
|
|
|||
|
|
@ -10,13 +10,24 @@ using uni_play_dual_rumble_t = void (*)(uni_hid_device_t*, uint16_t, uint16_t,
|
|||
struct uni_report_parser_t {
|
||||
uni_play_dual_rumble_t play_dual_rumble = nullptr;
|
||||
};
|
||||
struct uni_circular_buffer_t {
|
||||
unsigned queued = 0;
|
||||
};
|
||||
inline bool uni_circular_buffer_is_empty(const uni_circular_buffer_t* buffer) {
|
||||
return buffer->queued == 0;
|
||||
}
|
||||
|
||||
|
||||
// Only the parser boundary is faked. Native sends either enter the byte sink
|
||||
// synchronously or fail without retaining a packet; no hidden transmit queue.
|
||||
struct uni_hid_device_s {
|
||||
uni_report_parser_t report_parser{};
|
||||
struct { uint16_t interrupt_cid = 0; } conn;
|
||||
bool connected = true;
|
||||
struct {
|
||||
uint16_t interrupt_cid = 0;
|
||||
uint16_t handle = 0;
|
||||
bool connected = true;
|
||||
} conn;
|
||||
uni_circular_buffer_t outgoing_buffer{};
|
||||
bool info_ready = true;
|
||||
bool acquire_allowed = true;
|
||||
bool native_owned = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue