void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p) { logger = sharedLogger; console_line_callback = console_line_callback_p; #if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR) || defined(__DOXYGEN__) palSetPadMode(CONSOLE_MODE_SWITCH_PORT, CONSOLE_MODE_SWITCH_PIN, PAL_MODE_INPUT_PULLUP); b_isCommandLineConsoleOverTTL = GET_CONSOLE_MODE_VALUE() == EFI_USE_UART_FOR_CONSOLE; if (isCommandLineConsoleOverTTL()) { /* * Activates the serial * it is important to set 'NONE' as flow control! in terminal application on the PC */ serialConfig.speed = engineConfiguration->uartConsoleSerialSpeed; sdStart(EFI_CONSOLE_UART_DEVICE, &serialConfig); // cannot use pin repository here because pin repository prints to console palSetPadMode(EFI_CONSOLE_RX_PORT, EFI_CONSOLE_RX_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF)); palSetPadMode(EFI_CONSOLE_TX_PORT, EFI_CONSOLE_TX_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF)); isSerialConsoleStarted = true; chEvtRegisterMask((event_source_t *) chnGetEventSource(EFI_CONSOLE_UART_DEVICE), &consoleEventListener, 1); } #else b_isCommandLineConsoleOverTTL = false; #endif /* EFI_PROD_CODE */ chThdCreateStatic(consoleThreadStack, sizeof(consoleThreadStack), NORMALPRIO, (tfunc_t)consoleThreadThreadEntryPoint, NULL); addConsoleAction(SWITCH_TO_BINARY_COMMAND, switchToBinaryProtocol); }
static void printAllInfo(void) { printTemperatureInfo(); printTPSInfo(); #if EFI_WAVE_CHART scheduleMsg(&logger, "waveChartUsedSize=%d", waveChartUsedSize); #endif #if EFI_PROD_CODE scheduleMsg(&logger, "console mode jumper: %s", boolToString(!GET_CONSOLE_MODE_VALUE())); #endif }