Skip to content
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

treewide: Apply changes for new svd2rust API #545

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Commits on May 4, 2024

  1. treewide: Apply changes for new svd2rust API

    As avr-device is upgrading to use svd2rust version 0.33.1, there are
    some significant changes in the generated API.  We have to adapt the HAL
    code to use the new API whereever relevant.
    
    This commit was mostly generated using the following command, which adds
    the parentheses behind each register access to change it from
    struct-field access to method call.
    
    	cargo build --message-format json 2>/dev/null \
    	  | jq '.message.children[].spans[] | {file: .file_name, line: .line_start, col: (.text[0].highlight_start - 1), insert: .suggested_replacement}' 2>/dev/null \
    	  | jq -r '"sed -ri '"'"'" + (.line | tostring) + "s/^(.{" + (.col | tostring) + "})/\\1" + .insert + "/'"'"' $(cd ../..; realpath " + .file + ")"' \
    	  | sort | uniq | bash
    
    Shell magic for the win :)
    
    Beyond this, .bits() had to be converted to .set() where safe accesses
    are performed.
    Rahix committed May 4, 2024
    Configuration menu
    Copy the full SHA
    0bd44f0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0cad818 View commit details
    Browse the repository at this point in the history