You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So this is a feature request but a bit vague about what exactly the feature would be, I think we have to discuss it.
So basically I want to use this for printing to through the USB CDC interface of my microcontroller. For efficiency, we should use double buffering: so we set up one buffer to send and then continue filling the second buffer.
I have a std::array buffer, then create an emio::span_buffer, then create a emio::writer. when its full/close to full I can do the transmission from the underlying buffer.
The part that is missing is somehow in-place redirecting the writer and span_buffer to point to the other underlying buffer. Both span_buffer and writer have their copy assignment deleted. set_write_area doesn't reassign span_ member so it would be wrong to use it to change the buffer.
I think double buffering is a pretty common technique in embedded systems so it would be nice to support it.
Ultimately I would like the code to look like this:
// Global buffers exist `buffer[0]`
emio::span_buffer span{buffer};
emio::writer w{span};
format_to(w, ...);
flush(w); // Starts a transmission with the current buffer, writer now points to buffer[1]format_to(w, ...);
The simplest solution might be that we get a writer.set_buffer() method
The text was updated successfully, but these errors were encountered:
I use technics like double buffering myself. For that, I implemented a custom buffer which manages the two arrays internal and is linked to an output device (USB/UART).
I think, switching the buffers at writer/formatter level isn't an ideal abstraction.
So this is a feature request but a bit vague about what exactly the feature would be, I think we have to discuss it.
So basically I want to use this for printing to through the USB CDC interface of my microcontroller. For efficiency, we should use double buffering: so we set up one buffer to send and then continue filling the second buffer.
I have a
std::array
buffer, then create anemio::span_buffer
, then create aemio::writer
. when its full/close to full I can do the transmission from the underlying buffer.The part that is missing is somehow in-place redirecting the writer and span_buffer to point to the other underlying buffer. Both span_buffer and writer have their copy assignment deleted.
set_write_area
doesn't reassignspan_
member so it would be wrong to use it to change the buffer.I think double buffering is a pretty common technique in embedded systems so it would be nice to support it.
Ultimately I would like the code to look like this:
The simplest solution might be that we get a
writer.set_buffer()
methodThe text was updated successfully, but these errors were encountered: