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

[FR] expose write(_, buf: &[u8]) when set_print_channel() used #20

Open
ildar opened this issue Aug 18, 2021 · 1 comment
Open

[FR] expose write(_, buf: &[u8]) when set_print_channel() used #20

ildar opened this issue Aug 18, 2021 · 1 comment

Comments

@ildar
Copy link

ildar commented Aug 18, 2021

the set_print_channel() consumes the channel hence write(channel, buf: &[u8]) can't be used. And rtt_print() doesn't accept &[u8].
The situation when I need to write [u8] is trivial: to echo bytes I receive with read() from down channel.

@mvirkkunen
Copy link
Contributor

If you want to send actual binary data, I think it's better to write directly to the channel. The printing facility is really only meant for printing text. If it's actually text, you can use core::str::from_utf8 to convert it to an str for printing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants