本文整理汇总了C++中settings_init函数的典型用法代码示例。如果您正苦于以下问题:C++ settings_init函数的具体用法?C++ settings_init怎么用?C++ settings_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了settings_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main_init
static inline void main_init(void)
{
mcu_init();
sys_time_register_timer((1. / PERIODIC_FREQUENCY), NULL);
stateInit();
actuators_init();
imu_init();
#if USE_AHRS_ALIGNER
ahrs_aligner_init();
#endif
ahrs_init();
settings_init();
mcu_int_enable();
downlink_init();
register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_AUTOPILOT_VERSION, send_autopilot_version);
register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_ALIVE, send_alive);
register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_COMMANDS, send_commands);
register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_ACTUATORS, send_actuators);
// send body_to_imu from here for now
AbiSendMsgBODY_TO_IMU_QUAT(1, orientationGetQuat_f(&imu.body_to_imu));
}
示例2: nvo_init
/**
* Initialise non-volatile stored options
*
* @v nvo Non-volatile options block
* @v nvs Underlying non-volatile storage device
* @v fragments List of option-containing fragments
* @v refcnt Containing object reference counter, or NULL
*/
void nvo_init ( struct nvo_block *nvo, struct nvs_device *nvs,
struct nvo_fragment *fragments, struct refcnt *refcnt ) {
nvo->nvs = nvs;
nvo->fragments = fragments;
settings_init ( &nvo->settings, &nvo_settings_operations, refcnt,
"nvo", 0 );
}
示例3: settings_menu_push
void settings_menu_push(state_stack* stack, void* udata) {
(void) udata;
state_desc mm = {
GAME_SETTINGS_MENU, nullptr,
nullptr, nullptr,
&_event,
nullptr,
&_draw,
&_destroy,
nullptr, nullptr, false,
};
_settings_menu *data = (_settings_menu*) malloc(sizeof(_settings_menu));
menu *pMenu = menu_init(100, 50);
menu_add_entry(pMenu, "Controls");
menu_add_entry(pMenu, "");
menu_add_entry(pMenu, STR_ARROWBIG_LEFT " Save Settings");
menu_add_entry(pMenu, STR_ARROWBIG_LEFT " Discard Changes");
menu_auto_resize(pMenu);
data->m_menu = pMenu;
data->m_settings = settings_init();
input_config_settings(data->m_settings, g_keybinds);
screen_config_settings(data->m_settings, nullptr);
settings_load(data->m_settings, settings_file_path);
mm.m_pData = data;
table_append(stack, &mm);
}
示例4: main
/*
* Main entry point
*/
int
main(int argc ,char **argv)
{
int ret;
/* first, init time */
tc_time_update();
/* Set defaults */
settings_init();
read_args(argc, argv);
/* Init log for outputing debug info */
log_init(clt_settings.log_path);
/* Output debug info */
output_for_debug(argc, argv);
/* Set details for running */
set_details();
ret = tc_event_loop_init(&event_loop, MAX_FD_NUM);
if (ret == TC_EVENT_ERROR) {
log_info(LOG_ERR, "event loop init failed");
return -1;
}
/* Initiate tcpcopy client*/
ret = tcp_copy_init(&event_loop);
if (SUCCESS != ret) {
exit(EXIT_FAILURE);
}
/* Run now */
tc_event_process_cycle(&event_loop);
return 0;
}
示例5: main
int
main(int argc, char **argv)
{
int ret;
settings_init();
if (set_signal_handler(signals) == -1) {
return -1;
}
tc_time_init();
if (read_args(argc, argv) == -1) {
return -1;
}
if (srv_settings.log_path == NULL) {
srv_settings.log_path = "error_intercept.log";
}
if (tc_log_init(srv_settings.log_path) == -1) {
return -1;
}
ret = tc_event_loop_init(&s_event_loop, MAX_FD_NUM);
if (ret == TC_EVENT_ERROR) {
tc_log_info(LOG_ERR, 0, "event loop init failed");
return -1;
}
/* output debug info */
output_for_debug();
if (set_details() == -1) {
return -1;
}
if (interception_init(&s_event_loop, srv_settings.binded_ip,
srv_settings.port) == TC_ERROR)
{
return -1;
}
if (set_timer() == -1) {
return -1;
}
#if (INTERCEPT_COMBINED)
tc_event_timer_add(&s_event_loop, CHECK_INTERVAL, interception_push);
#endif
tc_event_timer_add(&s_event_loop, OUTPUT_INTERVAL,
interception_output_stat);
/* run now */
tc_event_process_cycle(&s_event_loop);
server_release_resources();
return 0;
}
示例6: core_init
void core_init(void)
{
modules_init();
#ifndef WIN32
pidwait_init();
#endif
net_disconnect_init();
net_sendbuffer_init();
signals_init();
settings_init();
commands_init();
nickmatch_cache_init();
chat_protocols_init();
chatnets_init();
expandos_init();
ignore_init();
servers_init();
write_buffer_init();
log_init();
rawlog_init();
channels_init();
queries_init();
nicklist_init();
chat_commands_init();
settings_check();
}
示例7: init_settings
static void
init_settings(void)
{
settings_init();
settings_load();
hotkey_t hk;
settings_get(TRIGGER_KEY, &hk);
INIT_KEY_SETTING(trigger);
settings_get(ENG_KEY, &hk);
INIT_KEY_SETTING(english);
varchar colorstr;
settings_get(PREEDIT_COLOR, colorstr);
INIT_COLOR_SETTING(background_color_btn);
settings_get(PREEDIT_FONT_COLOR, colorstr);
INIT_COLOR_SETTING(font_color_btn);
varchar fontstr;
settings_get(PREEDIT_FONT, fontstr);
gtk_font_button_set_font_name(font_btn, fontstr);
double scale;
settings_get(PREEDIT_OPACITY, &scale);
gtk_adjustment_set_value(opacity_value, scale);
int ncandi;
settings_get(CANDIDATES_SIZE, &ncandi);
gtk_adjustment_set_value(ncandidates, ncandi);
}
示例8: main_init
STATIC_INLINE void main_init( void ) {
mcu_init();
electrical_init();
stateInit();
actuators_init();
#if USE_MOTOR_MIXING
motor_mixing_init();
#endif
radio_control_init();
air_data_init();
#if USE_BARO_BOARD
baro_init();
#endif
imu_init();
#if USE_IMU_FLOAT
imu_float_init();
#endif
ahrs_aligner_init();
ahrs_init();
ins_init();
#if USE_GPS
gps_init();
#endif
autopilot_init();
modules_init();
settings_init();
mcu_int_enable();
#if DATALINK == XBEE
xbee_init();
#endif
#if DATALINK == UDP
udp_init();
#endif
// register the timers for the periodic functions
main_periodic_tid = sys_time_register_timer((1./PERIODIC_FREQUENCY), NULL);
modules_tid = sys_time_register_timer(1./MODULES_FREQUENCY, NULL);
radio_control_tid = sys_time_register_timer((1./60.), NULL);
failsafe_tid = sys_time_register_timer(0.05, NULL);
electrical_tid = sys_time_register_timer(0.1, NULL);
telemetry_tid = sys_time_register_timer((1./TELEMETRY_FREQUENCY), NULL);
#if USE_BARO_BOARD
baro_tid = sys_time_register_timer(1./BARO_PERIODIC_FREQUENCY, NULL);
#endif
}
示例9: main_init
STATIC_INLINE void main_init( void ) {
mcu_init();
electrical_init();
stateInit();
actuators_init();
#if USE_MOTOR_MIXING
// motor_mixing_init();
// servo_mixing_init();
set_servo_init();
#endif
radio_control_init();
baro_init();
imu_init();
autopilot_init();
nav_init();
guidance_h_init();
guidance_v_init();
stabilization_init();
ahrs_aligner_init();
ahrs_init();
ins_init();
#if USE_GPS
gps_init();
#endif
modules_init();
settings_init();
mcu_int_enable();
#if DATALINK == XBEE
xbee_init();
#endif
#if DATALINK == UDP
udp_init();
#endif
// register the timers for the periodic functions
main_periodic_tid = sys_time_register_timer((1./PERIODIC_FREQUENCY), NULL);
modules_tid = sys_time_register_timer(1./MODULES_FREQUENCY, NULL);
radio_control_tid = sys_time_register_timer((1./60.), NULL);
failsafe_tid = sys_time_register_timer(0.05, NULL);
electrical_tid = sys_time_register_timer(0.1, NULL);
baro_tid = sys_time_register_timer(1./BARO_PERIODIC_FREQUENCY, NULL);
telemetry_tid = sys_time_register_timer((1./TELEMETRY_FREQUENCY), NULL);
}
示例10: settings_write_defaults
int settings_write_defaults(const char *path) {
int r = 0;
settings_init(path);
if(conf_write_config(path)) {
r = 1;
}
settings_free();
return r;
}
示例11: main_init
static inline void main_init( void ) {
mcu_init();
sys_time_register_timer((1./PERIODIC_FREQUENCY), NULL);
settings_init();
mcu_int_enable();
}
示例12: init_settings
// init settings
static void init_settings(system_data_t *sysdata)
{
assert(sysdata);
assert(sysdata->settings == NULL);
sysdata->settings = (settings_t *) malloc(sizeof(settings_t));
assert(sysdata->settings);
settings_init(sysdata->settings);
}
示例13: main
/*The Main Program*/
int main(int argc, char** argv) {
/* defines the tray_icon, as well as init gtk*/
g_set_application_name(PACKAGE_NAME);
parse_command_line_options(argc,argv);
register_thread("Main Thread");
if (!queue_init())
print("queue_init FAILED",NULL,ERROR);
print("Glade File",glade_file,DEBUG);
g_thread_init(NULL);
gtk_init(NULL,NULL);
gtk_init(&argc, &argv);
Hosts_lock = g_mutex_new();
Userpath_lock = g_mutex_new();
g_mutex_lock(Userpath_lock);
Userpath = g_strdup(getenv("HOME"));
g_mutex_unlock(Userpath_lock);
settings_init();
rest_init();
if (!xml_init())
print("xml_init FAILED",NULL,ERROR);
init_hostname();
/*sets the tray icon from the create_tray_icon*/
create_tray_icon();
playing_info_music pInfo = {"Artist","Album","Song",0,0,0};
/* declares the playing info struct, and print if, if _DEBUG is definded at the top of msdaemon.c*/
/*inits the dbus and get the first set of info*/
dbus_init();
pInfo = dbus_get_playing_info_music();
print_playing_info_music(pInfo);
get_active_devices(NULL);
update_song_info();
GError *error;
if ( (network_thread = g_thread_create((GThreadFunc)rest_thread_handler, NULL, FALSE, &error)) == NULL){
print("Error Creating Network Thread",error->message,ERROR);
g_error_free(error);
}
if ( (file_thread = g_thread_create((GThreadFunc)file_thread_handler, NULL, FALSE, &error)) == NULL){
print("Error Creating Network Thread",error->message,ERROR);
g_error_free(error);
}
if ( (gui_thread = g_thread_create((GThreadFunc)gui_thread_handler, NULL, FALSE, &error)) == NULL){
print("Error Creating Network Thread",error->message,ERROR);
g_error_free(error);
}
g_timeout_add (1000,(GSourceFunc) get_next_command,NULL);
g_timeout_add (300000,(GSourceFunc) update_active_devices,NULL);
init_status_window(FALSE,glade_file);
start_tray();
g_free(Userpath);
deauthenticate();
return 0;
}
示例14: main
int main(void)
{
// Initialize system upon power-up.
serial_init(); // Setup serial baud rate and interrupts
settings_init(); // Load grbl settings from EEPROM
stepper_init(); // Configure stepper pins and interrupt timers
system_init(); // Configure pinout pins and pin-change interrupt
memset(&sys, 0, sizeof(sys)); // Clear all system variables
sys.abort = true; // Set abort to complete initialization
sei(); // Enable interrupts
// Check for power-up and set system alarm if homing is enabled to force homing cycle
// by setting Grbl's alarm state. Alarm locks out all g-code commands, including the
// startup scripts, but allows access to settings and internal commands. Only a homing
// cycle '$H' or kill alarm locks '$X' will disable the alarm.
// NOTE: The startup script will run after successful completion of the homing cycle, but
// not after disabling the alarm locks. Prevents motion startup blocks from crashing into
// things uncontrollably. Very bad.
#ifdef HOMING_INIT_LOCK
if (bit_istrue(settings.flags,BITFLAG_HOMING_ENABLE)) { sys.state = STATE_ALARM; }
#endif
// Grbl initialization loop upon power-up or a system abort. For the latter, all processes
// will return to this loop to be cleanly re-initialized.
for(;;) {
// TODO: Separate configure task that require interrupts to be disabled, especially upon
// a system abort and ensuring any active interrupts are cleanly reset.
// Reset Grbl primary systems.
serial_reset_read_buffer(); // Clear serial read buffer
gc_init(); // Set g-code parser to default state
spindle_init();
coolant_init();
limits_init();
probe_init();
plan_reset(); // Clear block buffer and planner variables
st_reset(); // Clear stepper subsystem variables.
// Sync cleared gcode and planner positions to current system position.
plan_sync_position();
gc_sync_position();
// Reset system variables.
sys.abort = false;
sys.execute = 0;
if (bit_istrue(settings.flags,BITFLAG_AUTO_START)) { sys.auto_start = true; }
else { sys.auto_start = false; }
// Start Grbl main loop. Processes program inputs and executes them.
protocol_main_loop();
}
return 0; /* Never reached */
}
示例15: core_init
void core_init(void)
{
dialog_type_queue = NULL;
dialog_text_queue = NULL;
client_start_time = time(NULL);
modules_init();
pidwait_init();
net_disconnect_init();
signals_init();
signal_add_first("gui dialog", (SIGNAL_FUNC) sig_gui_dialog);
signal_add_first("irssi init finished", (SIGNAL_FUNC) sig_init_finished);
settings_init();
commands_init();
nickmatch_cache_init();
session_init();
#ifdef HAVE_CAPSICUM
capsicum_init();
#endif
chat_protocols_init();
chatnets_init();
expandos_init();
ignore_init();
servers_init();
write_buffer_init();
log_init();
log_away_init();
rawlog_init();
recode_init();
channels_init();
queries_init();
nicklist_init();
chat_commands_init();
wcwidth_wrapper_init();
settings_add_str("misc", "ignore_signals", "");
settings_add_bool("misc", "override_coredump_limit", FALSE);
#ifdef HAVE_SYS_RESOURCE_H
getrlimit(RLIMIT_CORE, &orig_core_rlimit);
#endif
read_settings();
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
signal_add("irssi init finished", (SIGNAL_FUNC) sig_irssi_init_finished);
settings_check();
module_register("core", "core");
}