Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mesh_system_heap_error_handler to use new error handler #7771

Merged
merged 1 commit into from
Aug 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions features/nanostack/mbed-mesh-api/source/mesh_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "ns_hal_init.h"
#include "include/mesh_system.h"
#include "mbed_assert.h"
#include "mbed_error.h"
// For tracing we need to define flag, have include and define group
#define HAVE_DEBUG 1
#include "ns_trace.h"
Expand All @@ -46,19 +47,7 @@ MBED_CONF_MBED_MESH_API_HEAP_STAT_INFO_DEFINITION;
*/
static void mesh_system_heap_error_handler(heap_fail_t event)
{
tr_error("Heap error, mesh_system_heap_error_handler() %d", event);
switch (event) {
case NS_DYN_MEM_NULL_FREE:
case NS_DYN_MEM_DOUBLE_FREE:
case NS_DYN_MEM_ALLOCATE_SIZE_NOT_VALID:
case NS_DYN_MEM_POINTER_NOT_VALID:
case NS_DYN_MEM_HEAP_SECTOR_CORRUPTED:
case NS_DYN_MEM_HEAP_SECTOR_UNITIALIZED:
break;
default:
break;
}
while (1);
MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_NETWORK_STACK, MBED_ERROR_CODE_OUT_OF_MEMORY), "Heap error, mesh_system_heap_error_handler()", event);
}

void mesh_system_init(void)
Expand Down