Skip to content

Remove aligned, improve ITM code #190

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Jan 15, 2020
Merged

Remove aligned, improve ITM code #190

merged 2 commits into from
Jan 15, 2020

Conversation

jonas-schievink
Copy link
Contributor

@jonas-schievink jonas-schievink commented Jan 15, 2020

This does a handful of things:

  • Removes the dependency on aligned (and thus as-slice and the 2 versions of generic-array), instead providing our own simplified Aligned wrapper
  • Moves the innards of write_aligned to its own function, and calls that from write_all instead of transmuting &[u8] to &Aligned<A4, [u8]> (which is likely UB)
  • Fixes the doc example, which didn't compile anymore
  • Sinks the #[allow] attributes into the functions so they only cover the statements they need to

Closes #184

@rust-highfive
Copy link

r? @therealprof

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m labels Jan 15, 2020
Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

bors r+

bors bot added a commit that referenced this pull request Jan 15, 2020
190: Remove `aligned`, improve ITM code r=adamgreig a=jonas-schievink

This does a handful of things:

* Removes the dependency on `aligned` (and thus `as-slice` and the 2 versions of `generic-array`), instead providing our own simplified `Aligned` wrapper
* Moves the innards of `write_aligned` to its own function, and calls that from `write_all` instead of transmuting `&[u8]` to `&Aligned<A4, [u8]>` (which is likely UB)
* Fixes the doc example, which didn't compile anymore
* Sinks the `#[allow]` attributes into the functions so they only cover the statements they need to

Closes #184

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
@adamgreig
Copy link
Member

Worth noting that this is a breaking change due to the different Aligned.

@bors
Copy link
Contributor

bors bot commented Jan 15, 2020

Build succeeded

@bors bors bot merged commit 1498b1c into rust-embedded:master Jan 15, 2020
@therealprof
Copy link
Contributor

Nice!

@jonas-schievink jonas-schievink deleted the remove-aligned branch January 15, 2020 22:16
@Disasm Disasm mentioned this pull request May 19, 2020
Sh3Rm4n added a commit to Sh3Rm4n/defmt that referenced this pull request Mar 27, 2021
More specifically update cortex-m from 0.6.x to 0.7.x to reduce
the dependency tree a little, see rust-embedded/cortex-m#190

Another interesting update is rtt-target (`0.2.x` -> `0.3.x`)
bors bot added a commit to knurling-rs/defmt that referenced this pull request Mar 27, 2021
440: Update dependencies r=Urhengulas a=Sh3Rm4n

More specifically update cortex-m from `0.6.x` to `0.7.x` to reduce
the dependency tree a little, see rust-embedded/cortex-m#190

Another interesting update is rtt-target (`0.2.x` -> `0.3.x`)

I've lazily used `cargo upgrade` to update the dependencies, which 
means patch release versions are also changed. I can revert these lines, if not desired :) 

Co-authored-by: Fabian Viöl <f.vioel@googlemail.com>
adamgreig pushed a commit that referenced this pull request Jan 12, 2022
190: Align sections r=korken89 a=NickeZ

Hey, I had the same issue as in #189. Don't ask me why this works I looked at other linker scripts.

Fixes #189

Co-authored-by: Niklas Claesson <nicke.claesson@gmail.com>
adamgreig pushed a commit that referenced this pull request Jan 12, 2022
prepare a new patch release that includes PRs #190 and #192
adamgreig pushed a commit that referenced this pull request Jan 12, 2022
194: v0.6.9 r=adamgreig a=japaric

prepare a new patch release that includes PRs #190 and #192

Co-authored-by: Jorge Aparicio <jorge@japaric.io>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
breaking change S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider getting rid of aligned dependency subtree
4 participants