#include <include/contin_array.h>
Creates a continuous array in the locations in the net_buf as given in locations, from a single channel finite array in a net_buf.
- Note
- This function serves the purpose of e.g. having a set of audio samples stored in pcm_finite. This can then be fetched in smaller pieces into RAM and played back in a loop using the results in pcm_cont. The function keeps track of the current position in finite_pos, so that the function can be called multiple times and maintain the correct position in pcm_finite.
- Parameters
-
| pcm_contin | Pointer to the destination net buf. |
- Note
- The continuous array can be empty. If so, the locations given in locations are filled with the finite array. All other valid locations are zeroed.
- Parameters
-
| pcm_finite | Pointer to the single channel de-interleaved finite array net buf. |
| locations | Location(s) to write the finite array to. |
- Note
- If locations is set to zero (mono) the pcm_contin locations must also be set to zero (mono) for the function to operate. If non-zero then all locations must be in the pcm_contin array to for the function to operate.
- Parameters
-
| _finite_pos | Variable used internally. Must be set to 0 for the first run and not changed. |
- Return values
-
| 0 | If the operation was successful. |
| EPERM | If any sizes or location is out of range. |
| ENXIO | On NULL pointer. |
| EINVAL | If the _finite_pos or locations are out of range. |