13 Commits

Author SHA1 Message Date
CuriousNom
8d704d3082 pipa: peripheralmanager: Revert many keyboard/pen changes
* will be reimplemented later.
2025-08-12 12:00:00 +00:00
Roman Lubij
cb92741ec1 pipa: peripheralmanager: Implement a toggle for kb angle detection 2025-08-18 13:15:26 +00:00
Roman Lubij
5626759888 pipa: peripheralmanager: removed configuration loading logic
it is useless, and a selinux nightmare
2025-08-18 13:15:26 +00:00
Roman Lubij
023c62aa3c pipa: peripheralmanaher: Bump xiaomi-keyboard to 1.1.0
- Angle detection handling improved (WAY less CPU time required)
- misc improvements
2025-08-18 13:15:26 +00:00
Roman Lubij
ee61cb73aa pipa: peripheralmanaher: improve watchdog stuck logic 2025-08-18 13:15:26 +00:00
Roman Lubij
12a554bf3b (DNM) pipa: peripheralmanager: some optimisations
- Use SIMD math where possible
- Make the kb accel thread sleep for longer
2025-08-18 13:15:26 +00:00
Roman Lubij
946ee66c69 (DNM) pipa: peripheralmanager: Reimplement angle detection
Thanks luka177 for the code for retrieving the accelerometer data from the KB. This is mostly WIP overall, but it does seem to work *okay*.
2025-08-18 13:15:26 +00:00
Roman Lubij
f86f874c61 xiaomi-keyboard: Improve the watchdog
We should no longer be getting a logspam of the watchdog thread being stuck for over 50 years
2025-08-18 13:15:26 +00:00
Abdulwahab Isam
e58955d62e pipa: PeripheralManager: disable keyboard when device is locked
Change-Id: If28600c72be57fc36ef4a871d69e67f05d7e0b7e
Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-04-03 07:25:38 +03:00
Abdulwahab Isam
b8af5dac53 pipa: add license header to xiaomi-keyboard.cpp
- Add standard LineageOS license header
- Add SPDX identifier
- Match copyright format with Java files (2023-2025)
- No functional changes to implementation

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-03-24 05:58:17 +03:00
Abdulwahab Isam
865e43385b pipa: refactor: improve keyboard driver reliability and maintenance
- Reduce resource usage with smaller buffers and optimized code
- Add watchdog thread for automatic recovery from hangs
- Implement configuration file support for runtime settings
- Add dynamic keyboard detection with fallback path
- Improve connection handling with debouncing and backoff
- Enhance power management with proper sleep/wake handling
- Add proper signal handling and resource cleanup

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-03-24 05:42:47 +03:00
Abdulwahab Isam
a1919b0c02 pipa: remove Angle detection code from keyboard
too much logic and kinda overkill for our usecase

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-03-24 05:42:40 +03:00
Luka Panio
9938f176f0 pipa: peripheralmanager: Initial xiaomi-keyboard implementation
* xiaomi-keyboard handles keyboard and tablet angle calculation
 * This allows to correctly turn off the keyboard when flipped back.

Change-Id: I9287d2d4c2b0b3fc2ab40d4daf7577521ec8662a
2025-01-26 03:46:38 +03:00