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
Now Program::code is ArrayVec type, which contains its own data.
I think almost all of use cases are to program "static" one, and it is not necessary to allocate memory every time.
So I suggest to add slice support for Program::code.
Furthermore, I want pio_proc assembler macros to support slice as well.
The macros returns ProgramWithDefines<> type, which has dynamic type parameter, so it is not possible to use it as static variable.
I am able to work with this change, but I am not sure if it is good idea or not.
The text was updated successfully, but these errors were encountered:
As pio programs are only a few bytes long, I wonder if it's worth to spend effort on optimizing memory usage.
Do you have an example where such a change would help?
Your indication is correct; the performance problem is not so significant.
I don't like that the process is not minimal.
However, I think that is more convenient since slice is available as a primitive type.
In almost all use cases, the program is a static value, so we can use a static slice.
The difference is little, but a simple and fast way is preferable.
When dynamically generating programs, we don't need to convert the array to ArrayVec.
The code I first confront this issue is like this:
fnmain(){//
pio0.install(&PROGRAM).unwrap();//}// Here the program is compile-time-static value// but this approach is not available.staticPROGRAM:Program<32> = pio_proc::pio_asm![".wrap_target"," set pins, 1"," set pins, 0",".wrap",].program;
I get some errors because ArrayVec does not work in statics.
Now
Program::code
isArrayVec
type, which contains its own data.I think almost all of use cases are to program "static" one, and it is not necessary to allocate memory every time.
So I suggest to add slice support for
Program::code
.Furthermore, I want pio_proc assembler macros to support slice as well.
The macros returns
ProgramWithDefines<>
type, which has dynamic type parameter, so it is not possible to use it as static variable.I am able to work with this change, but I am not sure if it is good idea or not.
The text was updated successfully, but these errors were encountered: