The BP module offers memory pool functionality with additional feature allowing to treat many buffers as a single memory chunk (with fully linear and continuous access). Because "allocation" and "deallocation" memory from the buffer (memory) pool has known the worst execution time then this kind of pseudo dynamic memory allocation is allowed to use in the real time environment. Additionally to allow consistent usage of buffers (instead of raw pointers to memory) it is added functionality to create a stand-alone buffer wrapping preallocated memory.
Buffers. Allocated buffers have constant (usually small) size but the single "allocation" (the BP_GetBuffer function) can be made up to total size of allocated memory (buffer_size * no_of_buffers). When accessed by the BP_CopyTo functions the buffer returned by the BP_GetBuffer function can treated as a single continuous memory area. The "deallocation" procedure requires only single call to the BP_ReleaseBuffer function.
There is no special setup required for this module. The user should take into account that BP_Create function uses a real dynamic allocation functions and thus it should be avoided when real time tasks are already started. The recommended way of buffer pool creation is to do it before RTOS scheduler is executed.
Using the BP module
The example of stand-alone buffer usage.
To enable the NV module, HAL_ENABLE_BP definition must be set to 1, in hal_config.h.
Generated on Thu Feb 22 2018 13:14:54 for RCM API C++ Library by 188.8.131.52