wiced_result_t wiced_rtos_delete_thread( wiced_thread_t* thread ) { wiced_result_t result = (wiced_result_t) host_rtos_finish_thread( WICED_GET_THREAD_HANDLE( thread ) ); if ( result != WICED_WWD_SUCCESS ) { return result; } if ( thread->stack != NULL ) { malloc_transfer_to_curr_thread( thread->stack ); } malloc_leak_check( &thread->handle, LEAK_CHECK_THREAD ); result = (wiced_result_t) host_rtos_delete_terminated_thread( WICED_GET_THREAD_HANDLE( thread ) ); if ( result == WICED_WWD_SUCCESS ) { if ( thread->stack != NULL ) { free( thread->stack ); thread->stack = NULL; } } return result; }
void application_thread_main( ULONG thread_input ) { UNUSED_PARAMETER( thread_input); #ifndef WICED_DISABLE_WATCHDOG /* Start the watchdog kicking thread */ wiced_rtos_create_thread( &system_monitor_thread_handle, RTOS_HIGHEST_PRIORITY, "system monitor", (wiced_thread_function_t)system_monitor_thread_main, SYSTEM_MONITOR_THREAD_STACK_SIZE, NULL ); #endif /* WICED_DISABLE_WATCHDOG */ #ifdef TX_ENABLE_EVENT_TRACE { wiced_result_t result; wiced_tracex_config_t tracex_config; tracex_config.loop_rec = WICED_FALSE; tracex_config.filter = 0; tracex_config.tcp_server.enable = WICED_FALSE; tracex_config.tcp_server.port = WICED_TRACEX_TCP_SERVER_PORT; tracex_config.tcp_server.max_data_len = WICED_TRACEX_TCP_MAX_PACKET_LENGTH; tracex_config.tcp_server.timeout = WICED_TRACEX_TCP_CONNECT_TIMEOUT; tracex_config.tcp_server.num_retries = WICED_TRACEX_TCP_CONNECTION_NUM_RETRIES; SET_IPV4_ADDRESS(tracex_config.tcp_server.ip, WICED_TRACEX_TCP_SERVER_IP); tracex_config.buf.addr = WICED_TRACEX_BUFFER_ADDRESS; tracex_config.buf.size = WICED_TRACEX_BUFFER_SIZE; tracex_config.buf.obj_cnt = WICED_TRACEX_OBJECT_COUNT; result = wiced_tracex_enable(&tracex_config); wiced_assert( "TraceX enable failed", result == WICED_SUCCESS ); REFERENCE_DEBUG_ONLY_VARIABLE( result ); } #endif /* TX_ENABLE_EVENT_TRACE */ application_start( ); malloc_leak_check(NULL, LEAK_CHECK_THREAD); }
static void application_thread_main( void *arg ) { UNUSED_PARAMETER( arg ); application_start( ); malloc_leak_check(NULL, LEAK_CHECK_THREAD); vTaskDelete( NULL ); }
void application_thread_cleanup( TX_THREAD *thread_ptr, UINT condition ) { /* Determine if the thread was exited. */ if ( thread_ptr && condition == TX_THREAD_EXIT ) { malloc_transfer_to_curr_thread(thread_ptr->tx_thread_stack_start); malloc_transfer_to_curr_thread(thread_ptr); tx_thread_terminate( thread_ptr ); malloc_leak_check(thread_ptr, LEAK_CHECK_THREAD); tx_thread_delete( thread_ptr ); free( thread_ptr->tx_thread_stack_start ); free( thread_ptr ); } }
wiced_result_t wiced_rtos_delete_thread(wiced_thread_t* thread) { wiced_result_t result; malloc_leak_check( &thread, LEAK_CHECK_THREAD ); result = host_rtos_finish_thread( WICED_GET_THREAD_HANDLE( thread ) ); if ( result != WICED_WWD_SUCCESS ) { return result; } return host_rtos_delete_terminated_thread( WICED_GET_THREAD_HANDLE( thread ) ); }
wiced_result_t gpio_keypad_disable( gpio_keypad_t *keypad ) { uint32_t i; malloc_transfer_to_curr_thread(keypad->internal); wiced_rtos_deinit_timer( &keypad->internal->check_state_timer ); for ( i = 0; i < keypad->internal->total_keys; i++ ) { wiced_gpio_input_irq_disable( keypad->internal->key_list[i].gpio ); } free( keypad->internal ); keypad->internal = 0; malloc_leak_check( NULL, LEAK_CHECK_THREAD ); return WICED_SUCCESS; }