Exemplo n.º 1
0
void app_init(app_configuration *conf) {
	app_set_configuration(conf);

	switch (appconf.app_to_use) {
	case APP_PPM:
		app_ppm_start();
		break;

	case APP_ADC:
		app_adc_start(true);
		break;

	case APP_UART:
		hw_stop_i2c();
		app_uartcomm_start();
		break;

	case APP_PPM_UART:
		hw_stop_i2c();
		app_ppm_start();
		app_uartcomm_start();
		break;

	case APP_ADC_UART:
		hw_stop_i2c();
		app_adc_start(false);
		app_uartcomm_start();
		break;

	case APP_NUNCHUK:
		app_nunchuk_start();
		break;

	case APP_NRF:
		nrf_driver_init();
		break;

	case APP_CUSTOM:
#ifdef USE_APP_STEN
		hw_stop_i2c();
		app_sten_init();
#endif
#ifdef USE_APP_GURGALOF
		app_gurgalof_init();
#endif
		break;

	default:
		break;
	}
}
Exemplo n.º 2
0
Arquivo: app.c Projeto: finkultur/bldc
void app_init(app_configuration *conf) {
	appconf = *conf;

	switch (appconf.app_to_use) {
	case APP_PPM:
		app_ppm_configure(&appconf.app_ppm_conf);
		app_ppm_start();
		break;

	case APP_UART:
		hw_stop_i2c();
		app_uartcomm_configure(appconf.app_uart_baudrate);
		app_uartcomm_start();
		break;

	case APP_PPM_UART:
		hw_stop_i2c();
		app_ppm_configure(&appconf.app_ppm_conf);
		app_ppm_start();
		app_uartcomm_configure(appconf.app_uart_baudrate);
		app_uartcomm_start();
		break;

	case APP_NUNCHUK:
		app_nunchuk_configure(&appconf.app_chuk_conf);
		app_nunchuk_start();
		break;

	case APP_CUSTOM:
#ifdef USE_APP_STEN
		hw_stop_i2c();
		app_sten_init();
#endif
#ifdef USE_APP_GURGALOF
		app_gurgalof_init();
#endif
		break;

	default:
		break;
	}
}