mirror of https://github.com/ARMmbed/mbed-os.git
Cordio: Make allocating too much memory for pool a warning, not a fatal assert
parent
101c5697e5
commit
2978cd8404
|
@ -330,9 +330,14 @@ void BLE::stack_setup()
|
||||||
buf_pool_desc.pool_count, buf_pool_desc.pool_description
|
buf_pool_desc.pool_count, buf_pool_desc.pool_description
|
||||||
);
|
);
|
||||||
|
|
||||||
// This assert will fail if we've either allocated too much or too little memory
|
// Raise assert if not enough memory was allocated
|
||||||
// (bytes_used would be set to 0 in that case)
|
MBED_ASSERT(bytes_used != 0);
|
||||||
MBED_ASSERT(bytes_used == buf_pool_desc.buffer_size);
|
|
||||||
|
// This warning will be raised if we've allocated too much memory
|
||||||
|
if(bytes_used < buf_pool_desc.buffer_size)
|
||||||
|
{
|
||||||
|
MBED_WARNING1(MBED_MAKE_ERROR(MBED_MODULE_BLE, MBED_ERROR_CODE_INVALID_SIZE), "Too much memory allocated for Cordio memory pool, reduce buf_pool_desc.buffer_size by value below.", buf_pool_desc.buffer_size - bytes_used);
|
||||||
|
}
|
||||||
|
|
||||||
WsfTimerInit();
|
WsfTimerInit();
|
||||||
SecInit();
|
SecInit();
|
||||||
|
|
Loading…
Reference in New Issue