-
Notifications
You must be signed in to change notification settings - Fork 1
152 refactor control command handling #153
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
Merged
Merged
Conversation
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
…and input/output management
…and output management
…hods and adding total size calculation
…ices with improved type safety and output management
…r improved safety
…r improved safety
…g in display module
… in executable module
…cro for consistency
…fier and AnyByLayout for improved type safety
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
This pull request refactors the device control interface across multiple drivers and modules to use a new, more type-safe command system based on
ControlCommandIdentifierand theAnyByLayouttype for input/output arguments. It replaces the olderControlCommand/ControlArgumentapproach with a pattern that enables better compile-time checks, clearer intent, and easier extensibility. Additionally, it updates related command definitions and device implementations to match the new interface, and cleans up some memory manager functions.Device control interface refactor:
controlmethods (e.g., inscreen.rs,hash.rs,console.rs,drive_file.rs,canvas_screen.rs, andtraits.rs) to useControlCommandIdentifierand typed input/output viaAnyByLayout, replacing the use ofControlCommandandControlArgument. This enables more robust and type-safe device command handling. [1] [2] [3] [4] [5] [6] [7] [8]IDENTIFIERconstants and added helper methods likecast_inputandcast_outputfor extracting typed arguments fromAnyByLayout. [1] [2] [3] [4] [5] [6]Command definition improvements:
define_command!macro for commands likeRESET,SET_ALGORITHM, andGET_MAIN_FUNCTION, improving clarity and reducing boilerplate. [1] [2]API and dependency updates:
sharedas a workspace dependency where needed for the new shared types. [1] [2]Memory manager cleanup:
unsafefromget_usedandget_freemethods in memory manager implementations for bothstdandwasmtargets. [1] [2] [3]ABI and FFI adjustments:
xila_file_system_is_a_terminal, now passing&()and using the new output conventions.This refactor modernizes the device control API, making it safer and easier to maintain, and brings consistency to command handling across the codebase.