コード例 #1
0
ファイル: main.c プロジェクト: ChrisBeauchene/EECS399
/*
 * 2nd two parameters are 
 * only used if this is an HRT 
 */
void 
main (unsigned long mbd, 
      unsigned long magic, 
      unsigned long mycpuid, 
      unsigned long apicid)

{
    if (mb_is_hrt_environ(mbd)) {

        if (mycpuid == 0) {
            hrt_bsp_init(mbd, magic, mycpuid);
        } else {
            hrt_ap_init(mbd, mycpuid);
        }

    } else {
        /* fall back to normal init */
        default_init(mbd, magic, mycpuid);
    }
}
コード例 #2
0
ファイル: lcd.c プロジェクト: smurk-too/the-holey-junkyard
// main
int main (void)
{
    // initialize display
    default_init();
    
    uint8_t i;
    for (i = 0; msg_one[i] != '\0'; i++) send_char(msg_one[i]);
    
    set_addr_ddram(0x40);
    DATA_PORT = 0; // so that command is not repeated
    _delay_us(50);
    
    for (i = 0; msg_two[i] != '\0'; i++) send_char(msg_two[i]);
    
    // forever
    while (1)
    {
        _delay_ms(500);
        send_cmd(SHIFT_L);        
    }
}
コード例 #3
0
ファイル: farm.c プロジェクト: Vinchal/sheepdog
static int farm_init(void)
{
	sd_dprintf("use farm store driver");
	if (create_directory(obj_path) < 0)
		goto err;

	if (!is_xattr_enabled(obj_path)) {
		sd_eprintf("xattrs are not enabled on %s", obj_path);
		goto err;
	}

	if (snap_init() < 0)
		goto err;

	if (default_init() < 0)
		goto err;

	return SD_RES_SUCCESS;
err:
	return SD_RES_EIO;
}
コード例 #4
0
ファイル: farm.c プロジェクト: ChrisChung/sheepdog
static int farm_init(const char *p)
{
	dprintf("use farm store driver\n");
	if (create_directory(p) < 0)
		goto err;

	if (!is_xattr_enabled(p)) {
		eprintf("xattrs are not enabled on %s\n", p);
		goto err;
	}

	if (snap_init() < 0)
		goto err;

	if (default_init(p) < 0)
		goto err;

	return SD_RES_SUCCESS;
err:
	return SD_RES_EIO;
}
コード例 #5
0
/*
 * Initialize functions
 */
void initialize_internal_variables(char **argv){

	INFO_MSG("Initializing internal variables");
	
#ifdef PRINT_INFO
	int kk=0;
 	INFO_MSG("Printing info");
	for(kk=1; kk<38; kk++) 
		fprintf(stdout, "argv[%d]: %s \n", kk, argv[kk]);
#endif

	int count=1;

		// Basic working file urls
		Urls.a_outputs = argv[count++];
		Urls.halo_file = argv[count++];
		Urls.profiles_file = argv[count++];
		Urls.pk_file = argv[count++];

		// Basic simulation and analysis settings
		Settings.box_size = atof(argv[count++]); 
		Settings.n_part_1D = atoi(argv[count++]); 
		Settings.n_bins = atoi(argv[count++]);
		Settings.n_bins_th = atoi(argv[count++]);
		Settings.r_bins = atoi(argv[count++]);
		Settings.pk_skip = atoi(argv[count++]);
		Settings.halo_skip = atoi(argv[count++]);
		Settings.cat_number = atoi(argv[count++]);
		Settings.fit = atoi(argv[count++]);
		Settings.zStart = atof(argv[count++]);
		Settings.mass_min = atof(argv[count++]);
		Settings.Mmin = atof(argv[count++]);
		Settings.Mmax = atof(argv[count++]);
		Settings.Rmin = atof(argv[count++]);
		Settings.Rmax = atof(argv[count++]);
		Settings.n_min = atof(argv[count++]);
		Settings.use_n_min = atof(argv[count++]);
		Settings.n_haloes_to_use = atoi(argv[count++]); 
		Settings.use_criterion = atoi(argv[count++]); 
	
		// Cosmological parameters
		Cosmo.h = atof(argv[count++]);
		Cosmo.sigma8 = atof(argv[count++]);
		Cosmo.OmegaM = atof(argv[count++]);
		Cosmo.OmegaL = atof(argv[count++]);
		Cosmo.delta_c = atof(argv[count++]);
		Cosmo.spin = atof(argv[count++]);
		Cosmo.virial = atof(argv[count++]);
		GrowthFac.scale_k = atof(argv[count++]);
		NumDen.zMax = atof(argv[count++]);

		// Other urls related parameters
		Urls.output_prefix = argv[count++];
		Urls.halo_list = argv[count++];
		Urls.profile_list = argv[count++];
		Urls.subhalo_list = argv[count++];
		Urls.pk_list = argv[count++];
		Urls.nCatalogueFiles = atoi(argv[count++]);

	set_halo_selection_criterion();
	
	default_init();

}