improve memory management & polling

This commit is contained in:
2025-08-20 21:30:22 -04:00
parent 5b3a5beb32
commit a1e1ff70fc
13 changed files with 195 additions and 151 deletions
+10 -5
View File
@@ -1,5 +1,7 @@
#ifndef MAIN_HOST_H_
#define MAIN_HOST_H_
#ifndef USB_HOST_H_
#define USB_HOST_H_
#define HOST_POLL_INTERVAL 25000
typedef enum {
HOST_INACTIVE=0,
@@ -7,14 +9,17 @@ typedef enum {
HOST_MOUNTED,
HOST_START_LISTEN,
HOST_LISTENING,
HOST_WAIT_POLL,
HOST_POLL,
HOST_STOP_LISTEN,
} host_state_t;
extern host_state_t host_state;
void usb_host_init(void);
void set_host_state(host_state_t new_host_state);
host_state_t get_host_state(void);
bool host_ready(void);
void host_ready(void);
void poll_devices(void);
void set_host_poll_interval(uint16_t bt_conn_interval);
bool request_hid_report(uint8_t dev_addr, uint8_t instance);
bool stop_hid_report(uint8_t dev_addr, uint8_t instance);