コード例 #1
0
ファイル: zdroj.c プロジェクト: kubanecxxx/superZdrojModul
/**
 * @brief nastavení celyho zdroje
 *
 * @details defaultní výstupní hodnoty
 *  + output voltage 150mV
 *  + output disabled
 */
void zdrInit(void)
{
	conInit();
	adInit();
	opaInit();
	zLimInit();

	conSetVoltage(150);
}
コード例 #2
0
ファイル: main.c プロジェクト: AlexShiLucky/ChibiOS
/*
 * Simulator main.
 */
int main(int argc, char *argv[]) {

  (void)argc;
  (void)argv;

  /*
   * System initializations.
   * - HAL initialization, this also initializes the configured device drivers
   *   and performs the board-specific initializations.
   * - Kernel initialization, the main() function becomes a thread and the
   *   RTOS is active.
   */
  halInit();
  conInit();
  chSysInit();

  test_execute((BaseSequentialStream *)&CD1);
  if (test_global_fail)
    exit(1);
  else
    exit(0);
}
コード例 #3
0
ファイル: main.c プロジェクト: acourt/NXT-Sensor
/*
 * Simulator main.
 */
int main(int argc, char *argv[]) {
  msg_t result;

  (void)argc;
  (void)argv;

  /*
   * System initializations.
   * - HAL initialization, this also initializes the configured device drivers
   *   and performs the board-specific initializations.
   * - Kernel initialization, the main() function becomes a thread and the
   *   RTOS is active.
   */
  halInit();
  conInit();
  chSysInit();

  result = TestThread(&CD1);
  if (result)
    exit(1);
  else
    exit(0);
}
コード例 #4
0
ファイル: fossil.c プロジェクト: aahud/harvey
void
main(int argc, char* argv[])
{
	char **cmd, *p;
	int i, ncmd, tflag;

	fmtinstall('D', dirfmt);
	fmtinstall('F', fcallfmt);
	fmtinstall('M', dirmodefmt);
	quotefmtinstall();

	/*
	 * Insulate from the invoker's environment.
	 */
	if(rfork(RFREND|RFNOTEG|RFNAMEG) < 0)
		sysfatal("rfork: %r");

	close(0);
	open("/dev/null", OREAD);
	close(1);
	open("/dev/null", OWRITE);

	cmd = nil;
	ncmd = tflag = 0;

	vtAttach();

	ARGBEGIN{
	case '?':
	default:
		usage();
		break;
	case 'c':
		p = EARGF(usage());
		currfsysname = p;
		cmd = vtMemRealloc(cmd, (ncmd+1)*sizeof(char*));
		cmd[ncmd++] = p;
		break;
	case 'D':
		Dflag ^= 1;
		break;
	case 'f':
		p = EARGF(usage());
		currfsysname = foptname = p;
		readCmdPart(p, &cmd, &ncmd);
		break;
	case 'm':
		mempcnt = atoi(EARGF(usage()));
		if(mempcnt <= 0 || mempcnt >= 100)
			usage();
		break;
	case 't':
		tflag = 1;
		break;
	}ARGEND
	if(argc != 0)
		usage();

	consInit();
	cliInit();
	msgInit();
	conInit();
	cmdInit();
	fsysInit();
	exclInit();
	fidInit();

	srvInit();
	lstnInit();
	usersInit();

	for(i = 0; i < ncmd; i++)
		if(cliExec(cmd[i]) == 0)
			fprint(2, "%s: %R\n", cmd[i]);
	vtMemFree(cmd);

	if(tflag && consTTY() == 0)
		consPrint("%s\n", vtGetError());

	vtDetach();
	exits(0);
}
コード例 #5
0
ファイル: main.c プロジェクト: bagobor/gravit
int init(int argc, char *argv[]) {

#if WIN32
    char currentDirectory[MAX_PATH];
#endif

    srand(time(0));

    conInit();
    loadDefaults();
    timerInit();

    if (!commandLineRead(argc, argv))
        return 0;

    if (view.quit)
        return 0;

    if (!state.dontExecuteDefaultScript)
        configRead(findFile(CONFIG_FILE), 0);

#ifndef NO_GUI

    if (!gfxInit())
        return 1;

#endif

    if (state.historyFrames % 2)
        state.historyFrames--;

    fpsInit();

#ifdef WIN32
    // if we've gone this far, lets set the registry key even if it exists...
    GetCurrentDirectory(MAX_PATH, currentDirectory);
    setRegistryString(REGISTRY_NAME_PATH, currentDirectory);
#endif

#ifdef _OPENMP
    conAdd(LHELP, "multi-threaded rendering: max threads = %d.    Found %d processors.", 
                  state.processFrameThreads, omp_get_num_procs());
#endif

#ifndef NO_STDIO_REDIRECT
    // say hi (and keep stdout.txt alive on windows...)
    if(!view.useStdout && !view.screenSaver)
      printf("Welcome to %s.\n", GRAVIT_VERSION);
#endif

#ifdef WITHOUT_AGAR
    conAdd(LHELP, "Welcome to Gravit!");

#ifndef NO_GUI

    conAdd(LHELP, "Quick Start: Hit SPACE to start a new simulation!");
    conAdd(LHELP, "Hold down a mouse button and move it around. Use A and Z keys, or the scroll wheel to zoom in and out.");

#endif
#endif

    return 0;

}