AP_UAVCAN: use fixed-size memory pool

This commit is contained in:
Jonathan Challinger 2018-06-18 12:47:57 -07:00 committed by Andrew Tridgell
parent 4a334d0ed7
commit 71af938a12
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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;