int Dm_Init(void *interpreter) { Tcl_Interp *interp = (Tcl_Interp *)interpreter; static struct bu_cmdtab cmdtab[] = { {"dm_validXType", dm_validXType_tcl}, {"dm_bestXType", dm_bestXType_tcl}, {(const char *)NULL, BU_CMD_NULL} }; struct bu_vls vls = BU_VLS_INIT_ZERO; /* register commands */ register_cmds(interp, cmdtab); bu_vls_strcpy(&vls, "vectorThreshold"); Tcl_LinkVar(interp, bu_vls_addr(&vls), (char *)&vectorThreshold, TCL_LINK_INT); bu_vls_free(&vls); /* initialize display manager object code */ Dmo_Init(interp); Tcl_PkgProvide(interp, "Dm", brlcad_version()); return TCL_OK; }
/* Called by the plugin system when the plugin is loaded. * Registers plugin commands and connects signal handlers. */ static gboolean plugin_load_hook(PurplePlugin *plugin) { purple_debug_info(PLUGIN_ID, "AKA Plugin Loaded.\n") ; /* register any custom plugin commands */ register_cmds(plugin) ; /* register any signal handlers */ connect_signals(plugin) ; /* return TRUE says continue loading the plugin */ return TRUE ; }
/** * Initialize the serial port interface on the Onyx. */ void serial_initialise() { const stm32_pin_info *txi = &PIN_MAP[TX1]; const stm32_pin_info *rxi = &PIN_MAP[RX1]; gpio_set_mode(txi->gpio_device, txi->gpio_bit, GPIO_AF_OUTPUT_OD); gpio_set_mode(rxi->gpio_device, rxi->gpio_bit, GPIO_INPUT_FLOATING); if (txi->timer_device != NULL) { /* Turn off any PWM if there's a conflict on this GPIO bit. */ timer_set_mode(txi->timer_device, txi->timer_channel, TIMER_DISABLED); } register_cmds(); command_stack[0] = cmd_main_menu; command_stack_size = 1; usart_init(USART1); usart_set_baud_rate(USART1, STM32_PCLK2, ERROR_USART_BAUD); usart_enable(USART1); }