-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor platform variant management and detection #54
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
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.
Pull request overview
This PR refactors the platform variant management system to provide a unified, table-driven approach for detecting and configuring hardware variants across different handheld gaming devices. The refactor replaces ad-hoc global is_* boolean flags with a centralized PlatformVariant structure and detection framework.
Key changes:
- Introduces shared
platform_variant.h/cwith unified detection API and device registry system - Migrates three multi-variant platforms (rg35xxplus, miyoomini, tg5040) to use structured device/variant/mapping tables
- Updates eight single-variant platforms with standardized documentation headers and variant detection sections
- Provides convenience macros (
VARIANT_IS(),HAS_FEATURE()) for cleaner variant and feature checking
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| workspace/all/common/platform_variant.h | New core header defining PlatformVariant structure, VariantType enum, DeviceInfo struct, hardware feature flags, and detection API |
| workspace/all/common/platform_variant.c | Global platform_variant instance and PLAT_getDeviceName() implementation with null-safe fallbacks |
| workspace/all/common/build.mk | Adds platform_variant.c to common source list for build system |
| workspace/all/minui/makefile | Includes platform_variant.c in minui build sources |
| workspace/all/minarch/makefile | Includes platform_variant.c in minarch build sources |
| workspace/tg5040/platform/platform.h | Defines TG5040 variant constants, includes platform_variant.h, migrates macros to use platform_variant fields |
| workspace/tg5040/platform/platform.c | Implements device registry, variant config table, device mapping, and PLAT_detectVariant() for standard/Brick detection |
| workspace/rg35xxplus/platform/platform.h | Defines RG35XX family variants (VGA/Square/Wide), migrates display/feature macros to platform_variant |
| workspace/rg35xxplus/platform/platform.c | Implements detection for 9 devices across 3 variants with HDMI override, replaces PLAT_getModel() with PLAT_getDeviceName() |
| workspace/miyoomini/platform/platform.h | Defines Mini family variants, uses HAS_FEATURE() for button mappings, uses variant comparison for Plus detection |
| workspace/miyoomini/platform/platform.c | Implements PMIC/560p detection, special MY285 Flip handling, replaces PLAT_getModel() with PLAT_getDeviceName() |
| workspace/zero28/platform/platform.h | Updates header doc to standardized format with SoC info, adds variant detection section comment |
| workspace/trimuismart/platform/platform.h | Updates header doc to standardized format, adds variant detection section comment |
| workspace/rgb30/platform/platform.h | Corrects manufacturer to PowKiddy, updates header doc, adds variant detection section |
| workspace/rg35xx/platform/platform.h | Updates header doc with SoC info and clarification note about RG35XX vs RG35XX Plus, adds variant detection section |
| workspace/my355/platform/platform.h | Updates header doc with device name and SoC info, adds clarification note about similar platforms |
| workspace/my282/platform/platform.h | Updates header doc to use Miyoo A30 name with SoC info, adds variant detection section |
| workspace/magicmini/platform/platform.h | Updates header doc to standardized format, adds variant detection section comment |
| workspace/m17/platform/platform.h | Updates header doc to standardized format, adds variant detection section comment |
| docs/platform-variants.md | Comprehensive 269-line documentation covering architecture, usage patterns, detection methods, and migration guide |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.