void init_drivers(void) { driver.video_data_own = false; driver.audio_data_own = false; driver.input_data_own = false; #ifdef HAVE_CAMERA driver.camera_data_own = false; #endif #ifdef HAVE_LOCATION driver.location_data_own = false; #endif #ifdef HAVE_OSK driver.osk_data_own = false; #endif #ifdef HAVE_MENU // By default, we want the menu to persist through driver reinits. driver.menu_data_own = true; #endif adjust_system_rates(); g_extern.frame_count = 0; init_video_input(); if (!driver.video_cache_context_ack && g_extern.system.hw_render_callback.context_reset) g_extern.system.hw_render_callback.context_reset(); driver.video_cache_context_ack = false; init_audio(); #ifdef HAVE_CAMERA // Only initialize camera driver if we're ever going to use it. if (g_extern.camera_active) init_camera(); #endif #ifdef HAVE_LOCATION // Only initialize location driver if we're ever going to use it. if (g_extern.location_active) init_location(); #endif #ifdef HAVE_OSK init_osk(); #endif #ifdef HAVE_MENU init_menu(); if (driver.menu && driver.menu_ctx && driver.menu_ctx->context_reset) driver.menu_ctx->context_reset(driver.menu); #endif // Keep non-throttled state as good as possible. if (driver.nonblock_state) driver_set_nonblock_state(driver.nonblock_state); g_extern.system.frame_time_last = 0; }
void init_devices (void) { cli(); //Clears the global interrupts port_init(); adc_init(); timer5_init(); left_position_encoder_interrupt_init(); right_position_encoder_interrupt_init(); sei(); //Enables the global interrupts // To initialize the direction of the bot to north init_location(); }
void init_drivers(void) { driver.video_data_own = !driver.video_data; driver.audio_data_own = !driver.audio_data; driver.input_data_own = !driver.input_data; #ifdef HAVE_CAMERA driver.camera_data_own = !driver.camera_data; #endif #ifdef HAVE_LOCATION driver.location_data_own = !driver.location_data; #endif #ifdef HAVE_OSK driver.osk_data_own = !driver.osk_data; #endif adjust_system_rates(); g_extern.frame_count = 0; init_video_input(); if (!driver.video_cache_context_ack && g_extern.system.hw_render_callback.context_reset) g_extern.system.hw_render_callback.context_reset(); driver.video_cache_context_ack = false; init_audio(); #ifdef HAVE_CAMERA // Only init camera driver if we're ever going to use it. if (g_extern.camera_active) init_camera(); #endif #ifdef HAVE_LOCATION // Only init location driver if we're ever going to use it. if (g_extern.location_active) init_location(); #endif #ifdef HAVE_OSK init_osk(); #endif // Keep non-throttled state as good as possible. if (driver.nonblock_state) driver_set_nonblock_state(driver.nonblock_state); g_extern.system.frame_time_last = 0; }
/** * init_drivers: * @flags : Bitmask of drivers to initialize. * * Initializes drivers. * @flags determines which drivers get initialized. **/ void init_drivers(int flags) { driver_t *driver = driver_get_ptr(); global_t *global = global_get_ptr(); if (flags & DRIVER_VIDEO) driver->video_data_own = false; if (flags & DRIVER_AUDIO) driver->audio_data_own = false; if (flags & DRIVER_INPUT) driver->input_data_own = false; if (flags & DRIVER_CAMERA) driver->camera_data_own = false; if (flags & DRIVER_LOCATION) driver->location_data_own = false; #ifdef HAVE_MENU /* By default, we want the menu to persist through driver reinits. */ driver->menu_data_own = true; #endif if (flags & (DRIVER_VIDEO | DRIVER_AUDIO)) driver_adjust_system_rates(); if (flags & DRIVER_VIDEO) { init_video(); if (!driver->video_cache_context_ack && global->system.hw_render_callback.context_reset) global->system.hw_render_callback.context_reset(); driver->video_cache_context_ack = false; global->system.frame_time_last = 0; } if (flags & DRIVER_AUDIO) init_audio(); /* Only initialize camera driver if we're ever going to use it. */ if ((flags & DRIVER_CAMERA) && driver->camera_active) init_camera(); /* Only initialize location driver if we're ever going to use it. */ if ((flags & DRIVER_LOCATION) && driver->location_active) init_location(); #ifdef HAVE_MENU menu_update_libretro_info(); if (flags & DRIVER_MENU) { init_menu(); menu_driver_context_reset(); } #endif if (flags & (DRIVER_VIDEO | DRIVER_AUDIO)) { /* Keep non-throttled state as good as possible. */ if (driver->nonblock_state) driver_set_nonblock_state(driver->nonblock_state); } }
/** * drivers_init: * @flags : Bitmask of drivers to initialize. * * Initializes drivers. * @flags determines which drivers get initialized. **/ void drivers_init(int flags) { bool video_is_threaded = false; if (flags & DRIVER_VIDEO_MASK) video_driver_unset_own_driver(); if (flags & DRIVER_AUDIO_MASK) audio_driver_unset_own_driver(); if (flags & DRIVER_INPUT_MASK) input_driver_unset_own_driver(); if (flags & DRIVER_CAMERA_MASK) camera_driver_ctl(RARCH_CAMERA_CTL_UNSET_OWN_DRIVER, NULL); if (flags & DRIVER_LOCATION_MASK) location_driver_ctl(RARCH_LOCATION_CTL_UNSET_OWN_DRIVER, NULL); if (flags & DRIVER_WIFI_MASK) wifi_driver_ctl(RARCH_WIFI_CTL_UNSET_OWN_DRIVER, NULL); #ifdef HAVE_MENU /* By default, we want the menu to persist through driver reinits. */ menu_driver_ctl(RARCH_MENU_CTL_SET_OWN_DRIVER, NULL); #endif if (flags & (DRIVER_VIDEO_MASK | DRIVER_AUDIO_MASK)) driver_adjust_system_rates(); if (flags & DRIVER_VIDEO_MASK) { struct retro_hw_render_callback *hwr = video_driver_get_hw_context(); video_driver_monitor_reset(); video_driver_init(&video_is_threaded); if (!video_driver_is_video_cache_context_ack() && hwr->context_reset) hwr->context_reset(); video_driver_unset_video_cache_context_ack(); rarch_ctl(RARCH_CTL_SET_FRAME_TIME_LAST, NULL); } if (flags & DRIVER_AUDIO_MASK) { audio_driver_init(); audio_driver_new_devices_list(); } /* Only initialize camera driver if we're ever going to use it. */ if ((flags & DRIVER_CAMERA_MASK) && camera_driver_ctl(RARCH_CAMERA_CTL_IS_ACTIVE, NULL)) camera_driver_ctl(RARCH_CAMERA_CTL_INIT, NULL); /* Only initialize location driver if we're ever going to use it. */ if ((flags & DRIVER_LOCATION_MASK) && location_driver_ctl(RARCH_LOCATION_CTL_IS_ACTIVE, NULL)) init_location(); core_info_init_current_core(); #ifdef HAVE_MENU if (flags & DRIVER_VIDEO_MASK) { if (flags & DRIVER_MENU_MASK) menu_driver_init(video_is_threaded); } #endif if (flags & (DRIVER_VIDEO_MASK | DRIVER_AUDIO_MASK)) { /* Keep non-throttled state as good as possible. */ if (input_driver_is_nonblock_state()) driver_set_nonblock_state(); } if (flags & DRIVER_LED_MASK) { led_driver_init(); } if (flags & DRIVER_MIDI_MASK) midi_driver_init(); }
/** * init_drivers: * @flags : Bitmask of drivers to initialize. * * Initializes drivers. * @flags determines which drivers get initialized. **/ static void init_drivers(int flags) { if (flags & DRIVER_VIDEO) video_driver_unset_own_driver(); if (flags & DRIVER_AUDIO) audio_driver_unset_own_driver(); if (flags & DRIVER_INPUT) input_driver_unset_own_driver(); if (flags & DRIVER_CAMERA) camera_driver_ctl(RARCH_CAMERA_CTL_UNSET_OWN_DRIVER, NULL); if (flags & DRIVER_LOCATION) location_driver_ctl(RARCH_LOCATION_CTL_UNSET_OWN_DRIVER, NULL); #ifdef HAVE_MENU /* By default, we want the menu to persist through driver reinits. */ menu_driver_ctl(RARCH_MENU_CTL_SET_OWN_DRIVER, NULL); #endif if (flags & (DRIVER_VIDEO | DRIVER_AUDIO)) driver_adjust_system_rates(); if (flags & DRIVER_VIDEO) { struct retro_hw_render_callback *hwr = video_driver_get_hw_context(); video_driver_monitor_reset(); video_driver_init(); if (!video_driver_is_video_cache_context_ack() && hwr->context_reset) hwr->context_reset(); video_driver_unset_video_cache_context_ack(); runloop_ctl(RUNLOOP_CTL_SET_FRAME_TIME_LAST, NULL); } if (flags & DRIVER_AUDIO) { audio_driver_init(); audio_driver_new_devices_list(); } /* Only initialize camera driver if we're ever going to use it. */ if ((flags & DRIVER_CAMERA) && camera_driver_ctl(RARCH_CAMERA_CTL_IS_ACTIVE, NULL)) camera_driver_ctl(RARCH_CAMERA_CTL_INIT, NULL); /* Only initialize location driver if we're ever going to use it. */ if ((flags & DRIVER_LOCATION) && location_driver_ctl(RARCH_LOCATION_CTL_IS_ACTIVE, NULL)) init_location(); #ifdef HAVE_MENU if (flags & DRIVER_MENU) { menu_driver_ctl(RARCH_MENU_CTL_INIT, NULL); menu_driver_ctl(RARCH_MENU_CTL_CONTEXT_RESET, NULL); } #endif if (flags & (DRIVER_VIDEO | DRIVER_AUDIO)) { /* Keep non-throttled state as good as possible. */ if (input_driver_is_nonblock_state()) driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL); } }