feat(cpu): smoothed RP2350 CPU/Clock telemetry + 0xfc HID report

Add cpu_temp_raw_smoothed() (cmd.cpp/cmd.h): 256-sample average over a
slow EMA (alpha=0.15) so the RP2350 on-die temperature converges to the
true value instead of chasing per-sample 12-bit ADC noise (~1 LSB =
0.47 C). Single source of truth, ADC initialised in one place.

Also export CPU/Clock telemetry on HID feature report 0xfc (set_khz,
cached real_khz, vreg code, ADC ch4 raw). The handler is dormant: live
read over WebHID is not feasible (Chrome requires the report declared
in the HID descriptor, and declaring the OLED Edition vendor reports
breaks DualSense enumeration on Windows). It is harmless and left for a
possible future non-WebHID consumer. Link hardware_adc.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Thierry Perraut
2026-05-18 07:31:13 -06:00
committed by Marceline
co-authored by Claude Opus 4.7
parent 4552fd2b41
commit 5425b21f00
3 changed files with 77 additions and 1 deletions
+1
View File
@@ -171,6 +171,7 @@ target_link_libraries(ds5-bridge
hardware_timer
hardware_flash
hardware_spi
hardware_adc
pico_btstack_classic
# pico_cyw43_arch_threadsafe_background
pico_cyw43_arch_poll