alpha
Login
or
Join now
jmrp.io
/
kleidos
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/jmrplens/kleidos. Kleidos — Hardware BLE password manager for ESP32-S3 (M5StickC Plus2, StickS3, M5Stack Gray, T-Deck, Cardputer)
jmrplens.github.io/kleidos/
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
kleidos
/
test
/
drivers
/
test_imu_factory
/
at
main
1 file
José M. Requena Plens
Resolve IMU at runtime via a WHO_AM_I probe factory
7d ago
5b83c1d7
test_imu_factory.cpp
Resolve IMU at runtime via a WHO_AM_I probe factory Bring the IMU up to the PMIC/RTC abstraction bar. Add drivers/imu/imu_factory.{h,cpp}: createImu(address) probes the internal I2C bus and returns the matching driver, mirroring createPmic/createRtc. Detection reuses the drivers' identity constants: BMI270 chip-id 0x24 at reg 0x00, MPU6886-family WHO_AM_I 0x19/0x68/0x71 at reg 0x75, and QMI8658 0x05 at reg 0x00 (recognized but unimplemented -> NullImu). A pure classifyImu() carries the decision; concrete instantiation stays compile-gated on the board's IMU_TYPE_* flags (the BMI270 Bosch backend is only linkable where built). The factory never returns nullptr. The IMU is now resolved once at HAL bootstrap and written into the runtime-settable BoardDef::imu slot (mutable), so the ~12 board::get().imu consumers are unchanged. Remove the per-board static IMU instantiation, #include, and .imu wiring from all 9 board_*.cpp files. Add test/drivers/test_imu_factory: exhaustive classifyImu family coverage (all families incl. BMI270/MPU, off-hardware) plus createImu probe wiring driven by a fake I2C bus (QMI8658/unknown/read-fail -> NullImu). Claude-Session: https://claude.ai/code/session_01SV58JXhfxhhc9DC6vdjBo4
1 week ago