v1.0.0alpha

This commit is contained in:
wiredopposite
2024-12-20 01:26:31 -07:00
parent ee8d5e7036
commit ae2777172d
3 changed files with 18 additions and 15 deletions

View File

@@ -237,6 +237,7 @@ if(EXISTS ${SRC}/USBDevice/DeviceDriver/XboxOG/tud_xid/tud_xid_xremote_rom.h)
endif()
if(NOT EN_BLUETOOTH)
add_compile_definitions(PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H=1)
add_compile_definitions(PICO_XOSC_STARTUP_DELAY_MULTIPLIER=64)
endif()

View File

@@ -34,6 +34,18 @@ btstack_timer_source_t led_timer_;
bool led_timer_set_{false};
bool feedback_timer_set_{false};
bool any_connected()
{
for (auto& device : bt_devices_)
{
if (device.connected)
{
return true;
}
}
return false;
}
//This solves a function pointer/crash issue with bluepad32
void set_rumble(uni_hid_device_t* bp_device, uint16_t length, uint8_t rumble_l, uint8_t rumble_r)
{
@@ -145,6 +157,9 @@ static void device_disconnected_cb(uni_hid_device_t* device)
{
return;
}
bt_devices_[idx].connected = false;
if (!led_timer_set_)
{
led_timer_set_ = true;
@@ -169,6 +184,7 @@ static uni_error_t device_ready_cb(uni_hid_device_t* device)
}
bt_devices_[idx].connected = true;
if (led_timer_set_)
{
led_timer_set_ = false;
@@ -303,16 +319,4 @@ void run_task(Gamepad (&gamepads)[MAX_GAMEPADS])
btstack_run_loop_execute();
}
bool any_connected()
{
for (auto& device : bt_devices_)
{
if (device.connected)
{
return true;
}
}
return false;
}
} // namespace bluepad32

View File

@@ -14,8 +14,6 @@
namespace bluepad32
{
void run_task(Gamepad (&gamepads)[MAX_GAMEPADS]);
bool any_connected();
} //namespace bluepad32
}
#endif // _BLUEPAD_32_H_