fix: BM8563 clock via direct Wire1 I2C, lift preview above hints - #11
Merged
Merged
Conversation
Two regressions found by user testing of 1.3.0:
1. All three Clock settings (toggle, format, UTC offset) were dead
on tap. Root cause: HalClock built on M5.Rtc.isEnabled(), which
only returns true after M5.begin() — but this port never calls
M5.begin() (lgfx handles the display directly, the touch driver
handles GT911 directly). So _available was permanently false and
handleSelection's halClock.isAvailable() gate no-op'd everything.
Rewrite HalClock to talk to BM8563 directly over Wire1 at 0x51:
- The BM8563 sits on the same physical I2C bus as the GT911 touch
controller (SDA=GPIO41, SCL=GPIO42, port 1).
- HalTouch::begin() initialises the ESP-IDF I2C master on port 1
via lgfx during gpio.begin(); calling Wire1.begin(41, 42, 400000)
in HalClock::begin() afterwards re-binds Arduino TwoWire to the
same driver (idempotent in arduino-esp32 v3.x) so we can issue
BCD register reads without disturbing touch.
- All time fields are BCD; mask the VL bit on minutes and the two
reserved bits on hours. RTC stores 24-hour UTC; display offset
and 12h formatting are applied in formatTime as before.
2. The status-bar preview at the bottom of Customise Status Bar was
drawing inside the button-hint band. verticalPreviewPadding was 50
but Lyra-family themes have buttonHintsHeight=80, so the preview
sat 30px below the top of the hint row, colliding with the
« Back / Toggle / Up / Down labels.
Bump verticalPreviewPadding to 100 so the preview clears the
tallest hint band with breathing room. Cheap fix; a follow-up
could compute it from the active theme's metrics, but the
constant works because both classic and Lyra share this Activity.
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.
Two 1.3.0 regressions reported by user testing:
1. Clock toggles dead. Built HalClock on M5.Rtc.isEnabled() which requires M5.begin(), but this port never calls it. Rewritten to talk to BM8563 directly over Wire1 at 0x51 — same I2C bus that GT911 touch already uses (SDA=41, SCL=42, port 1). lgfx initialises the ESP-IDF I2C master on port 1 during HalTouch::begin; binding Wire1 to it afterwards in HalClock::begin is idempotent on arduino-esp32 v3 and doesn't disturb touch.
2. Status-bar preview overlaps button hints in Customise Status Bar. verticalPreviewPadding=50 was smaller than Lyra-family themes' buttonHintsHeight=80, so the preview drew inside the hint row. Bumped to 100 to clear with breathing room.