void mesh_system_init(void) { if (mesh_initialized == false) { ns_hal_init(app_stack_heap, MBED_MESH_API_HEAP_SIZE, mesh_system_heap_error_handler, NULL); eventOS_scheduler_mutex_wait(); net_init_core(); eventOS_scheduler_mutex_release(); mesh_initialized = true; } }
void mesh_system_init(void) { if (mesh_initialized == false) { #ifndef YOTTA_CFG ns_hal_init(app_stack_heap, MBED_MESH_API_HEAP_SIZE, mesh_system_heap_error_handler, NULL); eventOS_scheduler_mutex_wait(); net_init_core(); eventOS_scheduler_mutex_release(); #else ns_dyn_mem_init(app_stack_heap, MBED_MESH_API_HEAP_SIZE, mesh_system_heap_error_handler, NULL); randLIB_seed_random(); platform_timer_enable(); eventOS_scheduler_init(); trace_init(); // trace system needs to be initialized right after eventOS_scheduler_init net_init_core(); /* initialize 6LoWPAN socket adaptation layer */ ns_sal_init_stack(); #endif mesh_initialized = true; } }
void mesh_system_init(void) { if (mesh_initialized == false) { #if MBED_CONF_MBED_MESH_API_USE_MALLOC_FOR_HEAP app_stack_heap = malloc(MBED_CONF_MBED_MESH_API_HEAP_SIZE+1); MBED_ASSERT(app_stack_heap); #endif ns_hal_init(app_stack_heap, MBED_CONF_MBED_MESH_API_HEAP_SIZE, mesh_system_heap_error_handler, MBED_CONF_MBED_MESH_API_HEAP_STAT_INFO); eventOS_scheduler_mutex_wait(); net_init_core(); eventOS_scheduler_mutex_release(); mesh_initialized = true; } }
void app_start(int, char **) { char if_desciption[] = "6LoWPAN_NODE"; pc.baud(115200); //Setting the Baud-Rate for trace output ns_dyn_mem_init(app_stack_heap, APP_DEFINED_HEAP_SIZE, app_heap_error_handler,0); randLIB_seed_random(); platform_timer_enable(); eventOS_scheduler_init(); trace_init(); set_trace_print_function( trace_printer ); set_trace_config(TRACE_ACTIVE_LEVEL_DEBUG|TRACE_CARRIAGE_RETURN); tr_debug("M \r\n"); net_init_core(); rf_phy_device_register_id = rf_device_register(); net_rf_id = arm_nwk_interface_init(NET_INTERFACE_RF_6LOWPAN, rf_phy_device_register_id, if_desciption); eventOS_event_handler_create(&tasklet_main, ARM_LIB_TASKLET_INIT_EVENT); }