AP_UAVCAN: use fixed-size memory pool
This commit is contained in:
parent
4a334d0ed7
commit
71af938a12
@ -97,8 +97,7 @@ static uavcan::Publisher<uavcan::equipment::esc::RawCommand>* esc_raw[MAX_NUMBER
|
||||
static uavcan::Publisher<uavcan::equipment::indication::LightsCommand>* rgb_led[MAX_NUMBER_OF_CAN_DRIVERS];
|
||||
|
||||
AP_UAVCAN::AP_UAVCAN() :
|
||||
_node_allocator(
|
||||
UAVCAN_NODE_POOL_SIZE, UAVCAN_NODE_POOL_SIZE)
|
||||
_node_allocator()
|
||||
{
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef UAVCAN_NODE_POOL_BLOCK_SIZE
|
||||
#define UAVCAN_NODE_POOL_BLOCK_SIZE 256
|
||||
#define UAVCAN_NODE_POOL_BLOCK_SIZE 64
|
||||
#endif
|
||||
|
||||
#ifndef UAVCAN_SRV_NUMBER
|
||||
@ -146,6 +146,7 @@ private:
|
||||
///// LED /////
|
||||
void led_out_send();
|
||||
|
||||
uavcan::PoolAllocator<UAVCAN_NODE_POOL_SIZE, UAVCAN_NODE_POOL_BLOCK_SIZE, AP_UAVCAN::RaiiSynchronizer> _node_allocator;
|
||||
|
||||
// UAVCAN parameters
|
||||
AP_Int8 _uavcan_node;
|
||||
@ -154,7 +155,7 @@ private:
|
||||
AP_Int16 _servo_rate_hz;
|
||||
|
||||
uavcan::Node<0> *_node;
|
||||
uavcan::HeapBasedPoolAllocator<UAVCAN_NODE_POOL_BLOCK_SIZE, AP_UAVCAN::RaiiSynchronizer> _node_allocator;
|
||||
|
||||
uint8_t _driver_index;
|
||||
char _thread_name[9];
|
||||
bool _initialized;
|
||||
|
Loading…
Reference in New Issue
Block a user