Ejemplo n.º 1
0
static portTASK_FUNCTION(TaskAccelerometer, pvParameters) {
	(void) pvParameters;
	init();
	bool likelyError = 1;
	bool ok = 1;
	int likely = 0;
	int index = 0;
	MMA0_Init();
	
	while (((ok && likely < 2) || (index != likely))) {
		likelyError = taskAccelerometerWork(likelyError);
		ok=!likelyError;
		if (!ok) {
			likely++;
		} else {
			likely = 0;
		}
		index++;
	}
	startError();
}
Ejemplo n.º 2
0
bool GameProcess::start(const QString& folder, const QString& executable, const QStringList &arguments) {
    process = new QProcess();
    QSettings settings;

    process->setWorkingDirectory(folder);

    #ifdef Q_OS_WIN32
    if (debugMonitor == NULL) {
        debugMonitor = new WinDebugMonitor();
    }

    connect(debugMonitor, SIGNAL(outputDebugString(int, QString)), this, SLOT(outputDebugString(int, QString)));

    if (!settings.value("close_after_start", false).toBool() && !debugMonitor->IsInitialized() && settings.value("capture_debug_output", false).toBool()) {
        int ret = debugMonitor->Initialize();

        if (ret != 0)
            ui->textBrowser->append("Warning: Debug Monitor could not be initialized, if you want the debug output enabled please start the launchpad with administrator privileges");
    } else if (!settings.value("capture_debug_output", false).toBool()) {
        if (debugMonitor->IsInitialized()) {
            ui->textBrowser->append("Please restart the launchpad to disable the debug output");
        } else
            ui->textBrowser->append("Capture debug output is disabled");
    }
    #endif

    connect(process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(startError(QProcess::ProcessError)));
    connect(process, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(finished(int,QProcess::ExitStatus)));
    connect(process, SIGNAL(started()), this, SLOT(started()));

    QStringList env = QProcess::systemEnvironment();
    //env.append("SWGCLIENT_MEMORY_SIZE_MB=4096");

    //qDebug() << "env:" << env;
    process->setEnvironment(env);
#ifdef Q_OS_WIN32
    process->start(folder + "\\" + executable, arguments);
#else
    QString wineBinary = settings.value("wine_binary").toString();

    if (wineBinary.isEmpty())
        wineBinary = "wine";

    QString args = settings.value("wine_args").toString();

    QStringList argsList;
    if (!args.isEmpty())
        argsList = Utils::getArgumentList(args);

    argsList.append(folder + "/" + executable);

    qDebug() << argsList;

    QString envs = settings.value("wine_env").toString();
    if (!envs.isEmpty()) {
        env.append(Utils::getArgumentList(envs));

        qDebug() << env;

        process->setEnvironment(env);
    }

    if (!QProcess::startDetached(wineBinary, argsList, folder)) {
        QMessageBox::warning(this, "ERROR", "Could not launch wine!");
    }
#endif
    return true;
}
Ejemplo n.º 3
0
result_t* startsession_1(void* t, CLIENT *client){
	if (_doStart())	return startOk();
	else			return startError();
}