Пример #1
0
cfw_client_t * system_setup(T_QUEUE *q, handle_msg_cb_t cb, void *cb_data)
{
	cfw_client_t * client;

	/* Initialize OS abstraction */
	os_init();

	/* Setup BSP and get main queue */
	*q = bsp_setup();

	/* start Quark watchdog */
	wdt_start(WDT_MAX_TIMEOUT_MS);

	/* Component framework and services setup */
	client = cfw_app_setup(*q, cb, cb_data);
	pr_info(LOG_MODULE_MAIN, "cfw init done");

	/* Cproxy is another (deprecated) way to communicate with the component
	 * framework, used by some test commands and some services. Initialize
	 * it here. */
	cproxy_init(*q);

	/* Initialize ARC shared structure and start it. */
	shared_data->ports = port_get_port_table();
	shared_data->services = services;
	shared_data->service_mgr_port_id = cfw_get_service_mgr_port_id();
	start_arc(0);

	return client;
}
Пример #2
0
cfw_handle_t system_setup(T_QUEUE *q, handle_msg_cb_t cb, void *cb_data)
{
	cfw_handle_t handle;

	/* Initialize OS abstraction */
	os_init();

	/* Setup IPC and main queue */
	*q = ipc_setup();

	/* General hardware setup function, pass the ipc message handler if you
	 * want to use this feature. */
	soc_setup(ipc_handle_message);

	/* start Quark watchdog */
	wdt_start(WDT_MAX_TIMEOUT_MS);

	/* USB setup */
	usb_app_setup();

	/* Start log infrastructure */
	log_start(log_backend_uart);

	/* Enable test command engine async support through the main queue */
	tcmd_async_init(*q);
	/* Test commands will use the same port as the log system */
	set_tcmd_uart_port(CONFIG_UART_CONSOLE_INDEX);

	/* Component framework and services setup */
	handle = cfw_setup(*q, cb, NULL);
	pr_info(LOG_MODULE_MAIN, "cfw init done");

	/* Initialize ARC shared structure and start it. */
	shared_data->ports = port_get_port_table();
	shared_data->services = services;
	shared_data->service_mgr_port_id = cfw_get_service_mgr_port_id();
	start_arc(0);

	return handle;
}