-
Notifications
You must be signed in to change notification settings - Fork 16
feat(bootloader): update upgrade prompt page. #368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis update adds gesture detection for touch input, modularizes input zone matching, refactors the update info UI for scrolling, optimizes SE firmware handling, and introduces LCD window clipping. Several new functions and struct fields are added, and some image resources are replaced with compressed versions. Changes
Estimated code review effort4 (~90 minutes) Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.38.6)core/embed/bootloader/icon_onekey.h📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (9)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (8)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🔭 Outside diff range comments (1)
core/embed/bootloader/bootui.c (1)
800-880: LCD window bounds may overflow
end_x = x0 + w and end_y = y0 + h exceed max index when w or h equals the full resolution.
- core/embed/extmod/modtrezorui/mipi_lcd.c:
lcd_set_windowsetsend_x = x0 + w,end_y = y0 + h- core/embed/bootloader/bootui.c:
lcd_set_window(0, SUBTITLE_OFFSET_Y - bar_height / 2, MAX_DISPLAY_RESX, UPDATE_SECTION_HEIGHT);lcd_set_window(0, 0, MAX_DISPLAY_RESX, MAX_DISPLAY_RESY);
🧹 Nitpick comments (2)
core/embed/trezorhal/touch.c (1)
83-92: Variable namesads_dxandads_dyunclear.Should be
abs_dxandabs_dy.- int ads_dx = abs(dx); - int ads_dy = abs(dy); - if (ads_dx < SWIPE_THRESHOLD_PIXELS && ads_dy < SWIPE_THRESHOLD_PIXELS) + int abs_dx = abs(dx); + int abs_dy = abs(dy); + if (abs_dx < SWIPE_THRESHOLD_PIXELS && abs_dy < SWIPE_THRESHOLD_PIXELS) return SWIPE_NONE; - if (ads_dx > ads_dy) + if (abs_dx > abs_dy) return dx > 0 ? SWIPE_RIGHT : SWIPE_LEFT; else return dy > 0 ? SWIPE_DOWN : SWIPE_UP;core/embed/bootloader/bootui.c (1)
797-798: Magic number needs explanation.340 pixel height should be documented or made a named constant.
+// Maximum height for scrollable update section #define UPDATE_SECTION_HEIGHT 340
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (9)
core/embed/bootloader/bootui.c(5 hunks)core/embed/bootloader/bootui.h(2 hunks)core/embed/bootloader/icon_onekey.h(1 hunks)core/embed/emmc_wrapper/emmc_commands.c(8 hunks)core/embed/extmod/modtrezorui/mipi_lcd.c(5 hunks)core/embed/extmod/modtrezorui/mipi_lcd.h(1 hunks)core/embed/trezorhal/image.h(1 hunks)core/embed/trezorhal/touch.c(1 hunks)core/embed/trezorhal/touch.h(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Gen check
- GitHub Check: Style check
- GitHub Check: Defs check
🔇 Additional comments (12)
core/embed/trezorhal/image.h (1)
126-126: LGTM!The
se_addressfield addition is consistent with the existing struct pattern.core/embed/bootloader/icon_onekey.h (1)
124-133: LGTM!Good switch from raw pixel data to compressed TOIg format.
core/embed/trezorhal/touch.h (1)
52-117: LGTM!Well-structured gesture detection types and API.
core/embed/trezorhal/touch.c (1)
79-79: LGTM!Proper function closure.
core/embed/extmod/modtrezorui/mipi_lcd.h (1)
95-95: LGTM!Clear window clipping API.
core/embed/bootloader/bootui.c (5)
538-610: Function logic looks correct.Input coordinate matching is properly modularized.
616-619: Clean refactor.Good use of the extracted helper function.
625-627: Public interface addition is sound.Exposes the input matching functionality correctly.
895-923: Scrolling logic appears correct.Boundary checks and offset calculations look proper.
938-941: Icon rendering updated correctly.Switched from raw display to compressed icon format.
core/embed/bootloader/bootui.h (2)
90-90: Function declaration looks good.Well-placed and follows naming conventions.
102-102: Function declaration looks good.Appropriate extension of existing functionality.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes