feat(c6): enable auto-rotation + imu debug command#71
Open
crilam wants to merge 4 commits into
Open
Conversation
Exposes raw accelerometer values, current rotation quadrant, and candidate state via a new `imu` serial command (alongside the existing `screenshot` command). Useful for diagnosing auto-rotation issues without reflashing. All three board ports implement imu_hal_print_debug(): full data on the S3 2.16 (which has active rotation), and a no-op stub on the 1.8 and C6 boards where rotation was previously disabled. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The rotation strip buffer (37 KB) fits comfortably in the C6's internal SRAM alongside the rest of the firmware (~93 KB used of 320 KB). No PSRAM or external storage is needed. Changes: - display.cpp: allocate rot_buf from MALLOC_CAP_INTERNAL, copy rotate_strip() + display_hal_tick() ramp logic from the S3 port - imu.cpp: replace init-only stub with full QMI8658 auto-rotation implementation (same logic as waveshare_amoled_216) - board.h: set BOARD_HAS_ROTATION=1, add BOARD_ROTATION_OFFSET=3 to correct for the IMU being mounted 270° CW relative to the display on the C6 carrier PCB (verified on hardware) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
OpenSCAD model for two-piece kickstand with detent hinge: - clawdmeter_stand.scad: parametric model with 36-tooth detent disc (10° increments), M3 bolt lock, snap-fit cradle, pliable leg - README.md: comprehensive assembly, printing, and usage guide Features: - Tilt-adjustable via detent positions + M3 bolt lock - Folds flat for storage (0° to ~90° range) - Snap-fit device retention (no tools needed) - Rubber pad feet for desk stability - USB-C cable hangs free from bottom Export STLs via OpenSCAD GUI or CLI before printing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Y axis was inverted on the C6 PCB mounting. Invert the sign check in accel_to_rotation() to compensate: (ay > 0) now returns 1 instead of 3, and (ay < 0) returns 3 instead of 1. With inverted Y-axis and BOARD_ROTATION_OFFSET=3, all four orientations now rotate correctly: - Pantalla hacia usuario (ay>0, raw=1) → rotation=0° - Pantalla hacia abajo (ay<0, raw=3) → rotation=180° - Costado (ax±, raw=0/2) → rotation=270°/90° Verified on hardware with 'imu' serial command across all positions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
|
Your test plan is unchecked. Could you test and let me know if I can merge it? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
waveshare_amoled_216_c6board, matching the behaviour of the S3 port. ABOARD_ROTATION_OFFSETof 3 (270° CW) is applied to correct for the IMU being mounted at a different angle relative to the display on the C6 carrier PCB (verified on hardware).imuserial debug command: A newimu_hal_print_debug()HAL function (and matchingimuserial command) prints raw accelerometer values, the current rotation quadrant, and the candidate state. Useful for diagnosing auto-rotation issues on any board without reflashing.Test plan
waveshare_amoled_216_c6and verify splash/usage screens render correctly at restimuin serial monitor and confirm output showsax/ay/az+ rotation statewaveshare_amoled_216andwaveshare_amoled_18still build andimucommand compiles on both🤖 Generated with Claude Code