示例#1
0
文件: main.c 项目: MTN-Software/Panda
void kmain(u32 init_stack) {
    init_esp_start = init_stack;
    init_video();
    puts_color_str("Booting Panda OS ...\n", 0x0B);

    cli();
    time_init();
    gdt_init();
    idt_init();
    kb_init();
    mm_init();
    buf_init();
    file_init();
    inode_init();
    ide_init();
    task_init();
    timer_init();
    sysc_init();

    spawn(init_user);
    sti();
    init = 0;
    while(1) {
        if(!init) {
            printk("kernel running ...\n");
            init = 1;
        }
        sti();
        sched();
    }
}
示例#2
0
/*-------------------------------------------------------------------*/
void AzRgforest::cold_start(const char *param,
                            const AzSmat *m_x,
                            const AzDvect *v_y,
                            const AzSvFeatInfo *featInfo,
                            const AzDvect *v_fixed_dw,
                            const AzOut &out_req)
{
    out = out_req;
    s_config.reset(param);

    AzParam az_param(param);
    int max_tree_num = resetParam(az_param);
    setInput(az_param, m_x, featInfo);
    reg_depth->reset(az_param, out);  /* init regularizer on node depth */
    v_p.reform(v_y->rowNum());
    opt->cold_start(loss_type, data, reg_depth, /* initialize optimizer */
                    az_param, v_y, v_fixed_dw, out, &v_p);
    initTarget(v_y, v_fixed_dw);
    initEnsemble(az_param, max_tree_num); /* initialize tree ensemble */
    fs->reset(az_param, reg_depth, out); /* initialize node search */
    az_param.check(out);
    l_num = 0; /* initialize leaf node counter */

    if (!beVerbose) {
        out.deactivate(); /* shut up after printing everyone's config */
    }

    time_init(); /* initialize time measure ment */
    end_of_initialization();
}
示例#3
0
文件: timeval.c 项目: David-B55/ovs
static void
time_timespec__(struct clock *c, struct timespec *ts)
{
    bool slow_path;

    time_init();

    atomic_read_relaxed(&c->slow_path, &slow_path);
    if (!slow_path) {
        xclock_gettime(c->id, ts);
    } else {
        struct timespec warp;
        struct timespec cache;
        bool stopped;

        ovs_mutex_lock(&c->mutex);
        stopped = c->stopped;
        warp = c->warp;
        cache = c->cache;
        ovs_mutex_unlock(&c->mutex);

        if (!stopped) {
            xclock_gettime(c->id, &cache);
        }
        timespec_add(ts, &cache, &warp);
    }
}
示例#4
0
文件: main.c 项目: trbhoang/Vinix
int main(void)
{
    /* Interrupts are still disabled. Do necessary setups, then enable them. */
    time_init();
    tty_init();
    trap_init();
    sched_init();
    buffer_init();
    hd_init();
    sti();
    move_to_user_mode();
    if (!fork()) {		/* we count on this going ok */
	init();
    }

    /*
     * NOTE!!
     * For any other task 'pause()' would mean we have to get a signal to awaken,
     * but task 0 gets activated at every idle moment (when no other tasks can run).
     * For task0 'pause()' just means we go check if some other task can run, and
     * if not we return here.
     */
    // for(;;) pause();

    return 0;
}
示例#5
0
int main(int argc, char** argv) {
    printf("hello world\n");

    time_init();

    // set up the window
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
    glutInitWindowSize(window_wd, window_ht);
    window = glutCreateWindow("atomos_gpu");
    glutDisplayFunc(tick);
    glutReshapeFunc(reshapeHandler);
    glutKeyboardFunc(keyHandler);
    // glutMouseFunc(mouseHandler);

    assert (maxVolumes > simulation_ht * simulation_ht);
    initPositionMap();
    initConnectionMap();
    initFrameBuffers();


    shader_tick.init(   "shaders/vert.glsl", "shaders/tick.glsl"   );
    shader_display.init("shaders/vert.glsl", "shaders/display.glsl");
    checkGLError();


    doTiming("window setup");
    printf("\n");

    glutMainLoop();

    return 0;
}
示例#6
0
void Setup()
{
	debug_level = 2;

	//set clock to max for init 32MHz
	ClockSetSource(x32MHz);
	//disable 2MHZ osc
	OSC.CTRL = 0b00000010;

	//save power
	turnoff_subsystems();

	EnableInterrupts();

	//init basic peripherals
	led_init();
	uart_init_buffers();
	uart_init();
	time_init();
	buzzer_init();
	battery_init();
	buttons_init();

	//basic power control
	mems_power_init();
	io_init();
	SD_EN_INIT;

	//load configuration
	cfg_load();

	_delay_ms(100);
}
示例#7
0
int main (void) {
    WDTCTL = WDTPW + WDTHOLD;
    P1DIR = 0x03;
    P1OUT = 0x00;

    realtime_t_init();
    time_init();

    if (process_create (p1,10) < 0) {
        return -1;
    }
    if (process_create (p2,10) < 0) {
        return -1;
    }

    //rt processes
    start.sec = 0;
    work.sec=1;
    deadline.msec=100;
    if (process_rt_create (rt_p1,10, start, work, deadline) < 0) {
        return -1;
    }
    start.sec = 0;
    work.sec=1;
    deadline.msec=90;
    if (process_rt_create (rt_p2,10, start, work, deadline) < 0) {
        return -1;
    }

    process_start();
    P1OUT= 0x02;
    while(1);
    return 0;
}
int main(void)
{
	irq_setmask(0);
	irq_setie(1);
	uart_init();
#ifdef CSR_HDMI_OUT0_I2C_W_ADDR
	hdmi_out0_i2c_init();
#endif
#ifdef CSR_HDMI_OUT1_I2C_W_ADDR
	hdmi_out1_i2c_init();
#endif

	puts("\r\nHDMI2USB firmware  http://timvideos.us/");
	print_version();

	fx2_reset_out_write(1);

	config_init();
	time_init();
	processor_init();
	processor_start(config_get(CONFIG_KEY_RESOLUTION));

	// Set HDMI Output 0 to be pattern
#ifdef CSR_HDMI_OUT0_BASE
	processor_set_hdmi_out0_source(VIDEO_IN_PATTERN);
#endif
	// Set HDMI Output 1 to be pattern
#ifdef CSR_HDMI_OUT1_BASE
	processor_set_hdmi_out1_source(VIDEO_IN_PATTERN);
#endif
	processor_update();

	// Reboot the FX2 chip into HDMI2USB mode
#ifdef CSR_FX2_RESET_OUT_ADDR
	//fx2_init();
#endif

	// Set Encoder to be pattern
#ifdef ENCODER_BASE
	processor_set_encoder_source(VIDEO_IN_PATTERN);
	encoder_enable(1);
	processor_update();
#endif
	ci_prompt();
	while(1) {
		processor_service();
		ci_service();

#ifdef CSR_FX2_RESET_OUT_ADDR
		//fx2_service(true);
#endif

/* XXX FIX DDR conflict between DMA and L2 cache */
#if 0
		pattern_service();
#endif
	}

	return 0;
}
示例#9
0
int main(void)
{
	irq_setmask(0);
	irq_setie(1);
	uart_init();

	puts("\nHDMI2USB firmware  http://timvideos.us/");
	printf("Board's DNA: %016x\n", dna_id_read());
	printf("Revision %08x built "__DATE__" "__TIME__"\n", MSC_GIT_ID);

	ci_prompt();
	config_init();
	time_init();
	processor_init();
	processor_start(config_get(CONFIG_KEY_RESOLUTION));
	while(1) {
		processor_service();
		ci_service();
/* XXX FIX DDR conflict between DMA and L2 cache */
#if 0
		pattern_service();
#endif
	}

	return 0;
}
示例#10
0
文件: main.c 项目: qiuhw/linux
void main(void)		/* This really IS void, no error here. */
{			/* The startup routine assumes (well, ...) this */
/*
 * Interrupts are still disabled. Do necessary setups, then
 * enable them
 */
	time_init();
	tty_init();
	trap_init();
	sched_init();
	buffer_init();
	hd_init();
	sti();
	move_to_user_mode();
	if (!fork()) {		/* we count on this going ok */
		init();
	}
/*
 *   NOTE!!   For any other task 'pause()' would mean we have to get a
 * signal to awaken, but task0 is the sole exception (see 'schedule()')
 * as task 0 gets activated at every idle moment (when no other tasks
 * can run). For task0 'pause()' just means we go check if some other
 * task can run, and if not we return here.
 */
	for(;;) pause();
}
示例#11
0
文件: time.c 项目: plujon/hrs3-c
void time_incr(a_time *t, int sec)
{
  if (0 != sec) {
    time_t stamp = time_time(t);
    time_init(t, stamp + sec);
  }
}
示例#12
0
文件: init.c 项目: wcasper/fluid
int init() {
  int status = 0;

  // initialize MPI task numbers
  status = comm_init();
  error_check(&status, "error in comm_init\n");
  if(status) return status;

  // initialize grid
  status = grid_init();
  error_check(&status, "error in grid_init\n");
  if(status) return status;

  // initialize fourier
  status = fourier_init();
  error_check(&status, "error in fourier_init\n");
  if(status) return status;

  // initialize state
  status = state_init();
  error_check(&status, "error in state_init\n");
  if(status) return status;

  // initialize model
  status = model_init();
  error_check(&status, "error in model_init\n");
  if(status) return status;

  // initialize time step
  status = time_init();
  error_check(&status, "error in time_init\n");
  if(status) return status;

  return status;
}
示例#13
0
文件: time.c 项目: plujon/hrs3-c
const a_time *time_now()
{
  static a_time now;
  if (!now.time)
    time_init(&now, time(0));
  return &now;
}
示例#14
0
/* This function is meant to contain board-specific initialization code
 * for, e.g., the I/O pins. The initialization can rely on application-
 * specific board configuration, found in conf_board.h.
 */
void v2x_board_init(void)
{
	irq_initialize_vectors();
	pmic_init();
	sysclk_init();							//configure clock sources for core and USB
	sleepmgr_init();						// Initialize the sleep manager
	ioport_init();							//Initializes the IOPORT service
	pin_init();								//whole chip pin init, modes and initial conditions
	spi_start();							//start SPI driver
	PWR_init();								//sets SR to default states - holds power up
	cpu_irq_enable();
	eeprom_init();							//verifies eeprom safe for use
	menu_init();							//loads menu settings
	time_init();							//starts the RTC
	button_init();							//init button stuffs
	ACL_init();								//configures, but does not start sampling
	GSM_usart_init();						//starts direct serial channel to the SIM module
	CAN_uart_start();						//starts direct serial channel to the ELM module
	canbus_serial_routing(AVR_ROUTING);		//cause the serial 3-state buffer to route the serial path from the ELM to the FTDI 
	udc_start();							//start stack and vbus monitoring
	PWR_hub_start();						//connect the hub to the computer

	//autostart all systems
	delay_ms(500);
	GSM_modem_init();
	CAN_elm_init();
	ACL_set_sample_on();
	PWR_host_start();
}
示例#15
0
void
send_keepAliveNotif_trap(unsigned int clientreg, void *clientarg)
{

        char dpid_str[128];
        struct ofpbuf *request;
        struct vconn *vconn;
        struct ofpbuf *reply;
        struct ofp_switch_features *osf;
        struct ofp_phy_port *opp;
        uint16_t size;
        int i;
        int pid;

        time_init();
        make_openflow(sizeof(struct ofp_header),OFPT_FEATURES_REQUEST , &request);
        update_openflow_length(request);
        vconn_open_block("nl:0", OFP_VERSION, &vconn);
        vconn_transact(vconn, request, &reply);
        vconn_close(vconn);

        osf = (struct ofp_switch_features*) reply->data;
        sprintf(dpid_str, "%"PRIx64"", ntohll(osf->datapath_id));

        netsnmp_variable_list  *var_list = NULL;
        oid snmptrap_oid[] = {1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0};
        oid keepAliveNotif_oid[] = { 1,3,6,1,3,108,0,10 };
        oid dpid_oid[] = { 1,3,6,1,3,108,0,5, 0 };

        /*
         * Set the snmpTrapOid.0 value
         */
        snmp_varlist_add_variable(&var_list,
                        snmptrap_oid, OID_LENGTH(snmptrap_oid),
                        ASN_OBJECT_ID,
                        (u_char*)keepAliveNotif_oid, sizeof(keepAliveNotif_oid));

        /*
         * Add any objects from the trap definition
         */
        snmp_varlist_add_variable(&var_list,
                        dpid_oid, OID_LENGTH(dpid_oid),
                        ASN_OCTET_STR, dpid_str, strlen(dpid_str));

        /*
         * Send the trap to the list of configured destinations
         *  and clean up
         */
        //send_v2trap( var_list );
        if(signal(SIGCHLD, SIG_IGN))
                perror("signal(SIGCHLD, SIG_IGN)");
	if(fork() == 0) {
                execl(SNMP_TRAP_BIN, SNMP_TRAP_BIN, "-v2c", "-c", "public", SNMP_TRAP_HOST, "\"\"", "POMI-MOBILITY-MIB::keepAliveNotif", "POMI-MOBILITY-MIB::dpid.0", "s", dpid_str, NULL);
                exit(0);
        }
        printf("Sent keep-alive trap\n");
        snmp_free_varbind( var_list );

        //return SNMP_ERR_NOERROR;
}
示例#16
0
int main()
{
    // Structures may be initialized at declaration time by putting
    // the list of elements in curly braces.
    struct complex_number c1 = {1.0, 1.0};
    struct complex_number c2;
    c2.re = 2.0;
    c2.im = 4.0;

    printf("c1 = (%f,%f)\n", c1.re, c1.im);
    printf("c2 = (%f,%f)\n", c2.re, c2.im);

    struct complex_number result = complex_add(c1,c2);
    printf("c1 + c2 = (%f,%f)\n", result.re, result.im);

    struct complex_number *c_ptr;
    c_ptr = (struct complex_number*)malloc(sizeof(struct complex_number)); 
    c_ptr->re = 7.0;
    c_ptr->im = -13.0;
    printf("*c_ptr = (%f,%f)\n", c_ptr->re, c_ptr->im);    
    free(c_ptr);
    
    struct time t = {12,15,3};
    time_dump(&t);
    time_init(&t);
    time_dump(&t);

	return 0;
}
示例#17
0
文件: main.c 项目: LastRitter/GridOS
void hal_arch_init(int step)
{
	switch (step)
	{
	case HAL_ARCH_INIT_PHASE_EARLY:
		x86_serial_init();
		early_cpu_init();
		hal_irq_early_init();
		arch_init_irq();
		arch_trap_init();
		time_init();
		printk("\n%s->%s->%d.",__FILE__,__FUNCTION__,__LINE__);
		break;
	case HAL_ARCH_INIT_PHASE_MIDDLE:
		{
			unsigned long fb;
			int w, h, bpp;
			extern void x86_bootloader_get_video_info(unsigned long *fb, int *w, int *h, int *bpp);
			
			/* X86 has fb */
			x86_bootloader_get_video_info(&fb, &w, &h, &bpp);
			hal_fb_register_simple(fb, w, h, bpp, 1);
		}
		break;
	case HAL_ARCH_INIT_PHASE_LATE:
		/* start smp and run cpu_init on each cpu */
		cpu_init();

		//x86_prepare_smp();		
		break;
	}
}
示例#18
0
文件: init.c 项目: mcorley/jos
void
i386_init(void)
{
	extern char edata[], end[];

	// Before doing anything else, complete the ELF loading process.
	// Clear the uninitialized global data (BSS) section of our program.
	// This ensures that all static/global variables start out zero.
	memset(edata, 0, end - edata);

	// Initialize the console.
	// Can't call cprintf until after we do this!
	cons_init();

	cprintf("6828 decimal is %o octal!\n", 6828);

	// Lab 2 memory management initialization functions
	i386_detect_memory();
	i386_vm_init();

	// Lab 3 user environment initialization functions
	env_init();
	idt_init();

	// Lab 4 multitasking initialization functions
	pic_init();
	kclock_init();

	time_init();
	pci_init();

	// Should always have an idle process as first one.
	ENV_CREATE(user_idle);

	// Start fs.
	ENV_CREATE(fs_fs);

#if !defined(TEST_NO_NS)
	// Start ns.
	ENV_CREATE(net_ns);
#endif

#if defined(TEST)
	// Don't touch -- used by grading script!
	ENV_CREATE2(TEST, TESTSIZE);
#else
	// Touch all you want.
	// ENV_CREATE(net_testoutput);
	// ENV_CREATE(user_echosrv);
	// ENV_CREATE(user_httpd);
  // ENV_CREATE(user_writemotd);
	// ENV_CREATE(user_testfile);
	ENV_CREATE(user_icode);
	// ENV_CREATE(user_primes);
#endif // TEST*

	// Schedule and run the first user environment!
	sched_yield();
}
示例#19
0
int
main(int argc, char *argv[])
{
    struct rconn *rconn;
    int error;

    set_program_name(argv[0]);
    register_fault_handlers();
    time_init();
    vlog_init();
    parse_options(argc, argv);
    signal(SIGPIPE, SIG_IGN);

    if (argc - optind != 1) {
        ofp_fatal(0, "missing controller argument; use --help for usage");
    }


    rconn = rconn_create(60, max_backoff);
    error = rconn_connect(rconn, argv[optind]);
    if (error == EAFNOSUPPORT) {
        ofp_fatal(0, "no support for %s vconn", argv[optind]);
    }
    error = dp_new(&dp, dpid, rconn);
    if (listen_pvconn_name) {
        struct pvconn *listen_pvconn;
        int retval;

        retval = pvconn_open(listen_pvconn_name, &listen_pvconn);
        if (retval && retval != EAGAIN) {
            ofp_fatal(retval, "opening %s", listen_pvconn_name);
        }
        dp_add_listen_pvconn(dp, listen_pvconn);
    }
    if (error) {
        ofp_fatal(error, "could not create datapath");
    }
    if (port_list) {
        add_ports(dp, port_list); 
    }

    die_if_already_running();
    daemonize();

    error = vlog_server_listen(NULL, NULL);
    if (error) {
        ofp_fatal(error, "could not listen for vlog connections");
    }

    for (;;) {
        dp_run(dp);
        dp_wait(dp);
        poll_block();
    }

    return 0;
}
示例#20
0
文件: main.c 项目: henryZe/linux0.11
void main(void)		/* This really IS void, no error here. */
{			/* The startup routine assumes (well, ...) this */
/*
 * Interrupts are still disabled. Do necessary setups, then
 * enable them
 */
 	ROOT_DEV = ORIG_ROOT_DEV;
 	drive_info = DRIVE_INFO;
	memory_end = (1<<20) + (EXT_MEM_K<<10);
	memory_end &= 0xfffff000;
	if (memory_end > 16*1024*1024)
		memory_end = 16*1024*1024;
	if (memory_end > 12*1024*1024) 
		buffer_memory_end = 4*1024*1024;
	else if (memory_end > 6*1024*1024)
		buffer_memory_end = 2*1024*1024;
	else
		buffer_memory_end = 1*1024*1024;
	main_memory_start = buffer_memory_end;
#ifdef RAMDISK
	main_memory_start += rd_init(main_memory_start, RAMDISK*1024);
#endif
	mem_init(main_memory_start,memory_end);
	trap_init();
	blk_dev_init();
	chr_dev_init();
	tty_init();
	time_init();
	sched_init();
	buffer_init(buffer_memory_end);
	hd_init();
	floppy_init();
	sti();
	move_to_user_mode();

	setup((void *) &drive_info);
	(void) open("/dev/tty0",O_RDWR,0);
	(void) dup(0);
	(void) dup(0);
	(void) open("/var/process.log",O_CREAT|O_TRUNC|O_WRONLY,0666);
#ifdef dis_func
	(void) open("/var/dis_func.log",O_CREAT|O_TRUNC|O_WRONLY,0666);
#endif

	if (!fork()) {		/* we count on this going ok */
		init();
	}
/*
 *   NOTE!!   For any other task 'pause()' would mean we have to get a
 * signal to awaken, but task0 is the sole exception (see 'schedule()')
 * as task 0 gets activated at every idle moment (when no other tasks
 * can run). For task0 'pause()' just means we go check if some other
 * task can run, and if not we return here.
 */
	for(;;) pause();
}
示例#21
0
文件: menu.c 项目: mikelizal/pilgrim
void menu_init(void) {
    game_init_menu_controls=1;
    menu_pilgrim_x=menu_pilgrim_x0;
    menu_pilgrim_y=menu_pilgrim_y0;
    menu_title_x=menu_title_x0;
    menu_title_y=menu_title_y0;
    time_init();
    menu_estado=MENU_ST_MENU;
//    printf("M  menu\n");
}
示例#22
0
/* Configures the program to die with SIGALRM 'secs' seconds from now, if
 * 'secs' is nonzero, or disables the feature if 'secs' is zero. */
void
time_alarm(unsigned int secs)
{
    sigset_t oldsigs;

    time_init();
    block_sigalrm(&oldsigs);
    deadline = secs ? time_add(time_now(), secs) : TIME_MIN;
    unblock_sigalrm(&oldsigs);
}
void setup(){
    unsigned long long resolution;
    if (!time_init(&resolution)){
        printf("error: could not initialize timer");
        exit(1);
    }

    if (resolution < 1000000)
        printf("warning: timer is not actually at high enough resolution for good measurements!\n");

}
示例#24
0
int main (void)
{
	clunet_init();  
	clunet_set_on_data_received(data_received);	
	time_init();
	sei();
	//eeprom_write_dword((void*)0, 0);
	record_num = eeprom_read_dword((void*)0); // Читаем кол-во записей
	mode_current = eeprom_read_byte((void*)4); // Режим 
	mode_temp = eeprom_read_byte((void*)5); // Временный режим

	disk_initialize(0);	

	unset_bit(DDRA, 3); set_bit(PORTA, 3);	 // Определение сигнала в линии	
	//unset_bit(DDRA, 4);	unset_bit(PORTA, 4); // Открывалка двери, напрямую
	set_bit(DDRA, 4);	unset_bit(PORTA, 4); // Открывалка двери, через реле
	set_bit(DDRA, 5); HANGUP; // Реле снимания трубки
	set_bit(DDRA, 6); MODE_NORMAL; // Реле выбора режима
	unset_bit(DDRG, 0); set_bit(PORTG, 0); // Определение, лежит ли трубка	
	set_bit(DDRD, 6); set_bit(DDRD, 7); // Светодиоды
	unset_bit(DDRA, 7); set_bit(PORTA, 7); // Счётчик оборотов диска

	unset_bit(DDRF, 0); // ADC+
	unset_bit(PORTF, 0);
	unset_bit(DDRF, 1); // ADC-
	unset_bit(PORTF, 1);

	beep(500, 200);
	beep(1500, 200);
	beep(3000, 200);
	_delay_ms(1000);
	if (play_wav_pgm(STARTED_WAV) == 0)
	{
		LED_GREEN_ON;
		while (sound_read() >= 0) ;
		LED_GREEN_OFF;
		sound_stop();
	} else {
		LED_RED_ON;
		beep(3000, 200);
		beep(1500, 200);
		beep(500, 200);
		LED_RED_OFF;
	}
	
	send_current_mode(CLUNET_BROADCAST_ADDRESS);

	while(1)
	{
		if (is_LINE_POWER()) incoming_ring();
		if (OFFHOOK) control_mode();
		transfer_data(); // Передаём данные на досуге.
	}
}
示例#25
0
/* 
    usb_init
*/
void usb_init(void)
{
    
    usb_status           status = USB_OK;
    
    status = usb_host_init(CONTROLLER_ID, &g_video_camera.host_handle);
    if (status != USB_OK) 
    {
        USB_PRINTF("\r\nUSB Host Initialization failed! STATUS: 0x%x", status);
        return;
    }
    /*
     ** since we are going to act as the host driver, register the driver
     ** information for wanted class/subclass/protocols
     */
    status = usb_host_register_driver_info(g_video_camera.host_handle, (void *)DriverInfoTable);
    if (status != USB_OK) 
    {         
        USB_PRINTF("\r\nUSB Initialization driver info failed! STATUS: 0x%x", status);
          return;
    }

    status = usb_host_register_unsupported_device_notify(g_video_camera.host_handle, usb_host_video_unsupported_device_event);
    if (status != USB_OK) 
    {         
        USB_PRINTF("\r\nUSB Initialization driver info failed! STATUS: 0x%x", status);
          return;
    }
    
    g_video_camera.video_camera_control_event = OS_Event_create(0);/* manually clear */
    if (g_video_camera.video_camera_control_event == NULL)
    {
        USB_PRINTF("\r\nOS_Event_create failed!\r\n");
        return;
    }
    
    g_video_camera.video_camera_stream_event = OS_Event_create(0);/* manually clear */
    if (g_video_camera.video_camera_stream_event == NULL)
    {
        USB_PRINTF("\r\nOS_Event_create failed!\r\n");
        return;
    }
    g_video_camera.video_command_ptr = (video_command_t*)OS_Mem_alloc_zero(sizeof(video_command_t));
    if (g_video_camera.video_command_ptr == NULL)
    {
        USB_PRINTF("\r\nOS_Mem_alloc_zero failed!\r\n");
        return;
    }
    g_video_camera.stream_interface_alternate = 0;
   
    time_init();

    USB_PRINTF("Video camera starting...\r\n");
}
示例#26
0
文件: misc.c 项目: 7shi/minix-tools
/*===========================================================================*
 *				hgfs_init				     *
 *===========================================================================*/
PUBLIC int hgfs_init()
{
/* Initialize the library. Return OK on success, or a negative error code
 * otherwise. If EAGAIN is returned, shared folders are disabled; in that
 * case, other operations may be tried (and possibly succeed).
 */

  time_init();

  return rpc_open();
}
示例#27
0
文件: hrs3.c 项目: plujon/hrs3-c
/*
 * hrs3_remaining evaluates whether t falls within the schedule noted
 * by hrsss.  The return value x indicates both (a) whether t is within
 * the schedule and (b) the number of seconds after t that (a) is
 * valid.  A return value of -1 indicates an error.  Otherwise, the
 * high bit of x indicates (a), and all other bits indicate (b).
 */
static a_remaining_result hrs3_remaining__(const char *hrsss, time_t time)
{
  a_hrs3 hrs3;
  if (OK != hrs3_init(&hrs3, hrsss, strlen(hrsss)))
    return remaining_invalid();
  a_time t;
  time_init(&t, time);
  a_remaining_result result = hrs3_remaining(&hrs3, &t);
  hrs3_destroy(&hrs3);
  return result;
}
示例#28
0
文件: main.c 项目: nateglims/SENG5831
void init()
{
    srand(0); /* Obviously not a very good seed but useful for testing... */
    memset(&counts, 0, sizeof(counts));
    time_init();
    led_init();
    menu_init();
    button_init();
    enable_leds();
    sei();
}
示例#29
0
int main(int argc , char * argv[]){
    time_init();
    CGlobalInfo::m_socket.Create(0);

    CGlobalInfo::init_pools(1000);
    assert( CMsgIns::Ins()->Create(4) );

    if ( parse_options(argc, argv, &CGlobalInfo::m_options ) != 0){
        exit(-1);
    }
    return (load_list_of_cap_files(&CGlobalInfo::m_options));
}
示例#30
0
文件: menu.c 项目: mikelizal/pilgrim
void menu_hof(void) {
    game_init_backandgamecenterscores_controls=1;
    menu_estado=MENU_ST_HOF;
    audio_stop_music();
    audio_start_music(AUDIO_MUSIC_HIGHSCORES);
//    printf("M  hof\n");
    menu_hof_x=menu_hof_x0;
    menu_hof_y=menu_hof_y0;
    text_highscores_gentexture(1024,1024);
    time_init();

}