Exemplo n.º 1
0
bool isCommandLineConsoleReady(void) {
	if (isCommandLineConsoleOverTTL()) {
		return isSerialConsoleStarted;
	} else {
		return is_usb_serial_ready();
	}
}
Exemplo n.º 2
0
bool isConsoleReady(void) {
	if (isSerialOverUart()) {
		return isSerialConsoleStarted;
	} else {
		return is_usb_serial_ready();
	}
}
Exemplo n.º 3
0
/**
 * this thread has a lower-then-usual stack size so we cannot afford *print* methods here
 */
static void blinkingThread(void *arg) {
	(void) arg;
	chRegSetThreadName("communication blinking");

	initialLedsBlink();

	while (true) {
		int delayMs = is_usb_serial_ready() ? 3 * blinkingPeriod : blinkingPeriod;

#if EFI_INTERNAL_FLASH || defined(__DOXYGEN__)
		if (getNeedToWriteConfiguration()) {
			delayMs = 2 * delayMs;
		}
#endif

		communicationPin.setValue(0);
		warningPin.setValue(0);
		chThdSleepMilliseconds(delayMs);

		communicationPin.setValue(1);
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
		if (isTriggerErrorNow() || isIgnitionTimingError() || consoleByteArrived) {
			consoleByteArrived = false;
			warningPin.setValue(1);
		}
#endif
		chThdSleepMilliseconds(delayMs);

	}
}
Exemplo n.º 4
0
bool sr5IsReady(bool isConsoleRedirect) {
#if EFI_PROD_CODE || defined(__DOXYGEN__)
	if (isCommandLineConsoleOverTTL() ^ isConsoleRedirect) {
		// TS uses USB when console uses serial
		return is_usb_serial_ready();
	} else {
		// TS uses serial when console uses USB
		return true;
	}
#else
	return true;
#endif
}
Exemplo n.º 5
0
static int ts_serial_ready(bool_t isConsoleRedirect) {
#if EFI_PROD_CODE
	if (isSerialOverUart() ^ isConsoleRedirect) {
		// TS uses USB when console uses serial
		return is_usb_serial_ready();
	} else {
		// TS uses serial when console uses USB
		return true;
	}
#else
	return true;
#endif
}
Exemplo n.º 6
0
static int ts_serail_ready(void) {
#if EFI_PROD_CODE
	if (isSerialOverUart()) {
		// TS uses USB when console uses serial
		return is_usb_serial_ready();
	} else {
		// TS uses serial when console uses USB
		return TRUE;
	}
#else
	return TRUE;
#endif
}