Fix preserve pairing on power cycle

This commit is contained in:
2025-09-09 15:05:45 -04:00
parent a1e1ff70fc
commit 2e9159cb57
4 changed files with 6 additions and 5 deletions
-2
View File
@@ -51,8 +51,6 @@ void btstack_main(void){
bt_hid_setup();
init_report_buf();
hci_power_control(HCI_POWER_ON);
}
static void bt_hid_setup(void) {
+4 -1
View File
@@ -16,9 +16,12 @@ static void usb_main(void);
// main loop
int main(void) {
// for PIO USB, we want clock speed to be multiple of 12MHz
set_sys_clock_khz(144000, true);
// need so BTstack can save pairing information to flash
flash_safe_execute_core_init();
sleep_ms(10);
// run BLE on core 1
+1 -1
View File
@@ -18,7 +18,7 @@
host_state_t host_state;
static absolute_time_t request_time;
static absolute_time_t last_report;
static uint16_t host_poll_interval=8000;
static uint16_t host_poll_interval=HOST_POLL_INTERVAL;
// initialize usb host
void usb_host_init(void) {
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef USB_HOST_H_
#define USB_HOST_H_
#define HOST_POLL_INTERVAL 25000
#define HOST_POLL_INTERVAL 8000
typedef enum {
HOST_INACTIVE=0,