Upstream only checks left stick X axis, so pressing buttons, using
the d-pad, or moving the right stick won't prevent disconnection.
Extends the same dead zone pattern to cover both sticks (all 4 axes),
both button bytes, and d-pad/misc bytes.
The low-battery indicator is critical info — keep blinking even when
the user has the LED disabled (Speaker mute toggle). Steady-state
LED still respects the flag: when battery recovers or charging
starts, the LED returns to off if the flag is set, otherwise to the
existing connected = solid-on state.
(cherry picked from commit 775346cd29d9a3c566309ec7d29db80f0b6979f1)
Blink the Pico onboard LED at 1 Hz when the connected DualSense
reports PowerPercent <= 1 (i.e. <= 10%) and PowerState == Discharging.
Source data is byte 52 of the BT 0x31 input report, already copied
into interrupt_in_data; no new BT parsing required.
The new module owns the LED only while it is actively blinking; it
detects controller disconnection via stale-report timeout and steps
out, so bt.cpp's existing connect/disconnect LED handling stays in
charge in all other states. Honors disable_pico_led.
Gated by -DENABLE_BATT_LED=ON (default). With the option off, the
source file is not compiled and behavior is identical to upstream.
CI gains a compile-only check for the OFF flavor.
(cherry picked from commit 2f8ea73c9fb695e24e7cc3329db7cb925e82e1c9)
When the inactive_time configuration value exceeds 35, the expression
`get_config().inactive_time * 60 * 1000 * 1000`
overflows the maximum int value due to implicit integer conversion.
l2cap_send was passed the caller's `len` (expected response size) instead of
the actual array size. The get_feature array is only 2 bytes (transaction
header + report ID), so this read up to 62 bytes of uninitialized stack.
Use sizeof(get_feature) to send only the 2-byte GET_REPORT request.