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

Better examples/docs #55

Open
jamesmunns opened this issue Apr 12, 2020 · 5 comments
Open

Better examples/docs #55

jamesmunns opened this issue Apr 12, 2020 · 5 comments
Labels
docs Documentation improvements good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jamesmunns
Copy link
Owner

We should have more complete examples for common use cases, including (at least):

  • How to use with RTFM
  • How to use in bare metal

CC #54 / @justacec

@jamesmunns jamesmunns added good first issue Good for newcomers help wanted Extra attention is needed labels Apr 12, 2020
@jamesmunns
Copy link
Owner Author

In particular, we should show:

  1. How to declare a BBBuffer at static scope
  2. How to store the Consumer/Producer in RTFM's Resources, or something like cmim's Move container
  3. How to store a GrantR/GrantW in an Option<GrantX<'static, U32>> with RTFM's Resources or something like cmim's Move container

@maraisr
Copy link

maraisr commented May 9, 2020

As a side question; would also be nice to see some examples/docs on how to use this for not just basic bytes, but storing stuff like structs

@ianrrees
Copy link

As a newish Rust programmer, the current example's line static BB: BBBuffer<U6> = BBBuffer( ConstBBBuffer::new() ); was a bit confusing due to the implicit use of generic-array.

@ost-ing
Copy link

ost-ing commented Jan 26, 2021

@ianrrees I also found the same thing

@jamesmunns
Copy link
Owner Author

As a note @maraisr, I don't plan to have BBQueue support non-byte (e.g. arrays of u8s) data. It does not currently manage things like alignment, so it wouldn't work as a general purpose struct storage item. You could use it with something like serde or postcard if you need to send things across the wire.

In the future, I will be removing the Generic Array usage, you can take a peek at the next generation docs if you want to see what that will look like!

This "next gen" branch will be merged when min_const_generics lands in the next release or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation improvements good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants