Пример #1
0
void initBoardTest(void) {
	is_board_test_mode = true;
	addConsoleAction("n", nextStep);
	addConsoleActionI("set", setIndex);

	chThdCreateStatic(btThreadStack, sizeof(btThreadStack), NORMALPRIO, (tfunc_t) ivThread, NULL);

	// this code is ugly as hell, I had no time to think. Todo: refactor

	processAdcPin(&fastAdc, 0, "fast");
	while (currentIndex < slowAdc.size()) {
		processAdcPin(&slowAdc, currentIndex, "slow");
		currentIndex++;
	}

	currentIndex = 0;

	int pinsCount = sizeof(BLINK_PINS) / sizeof(brain_pin_e);
	while (currentIndex < pinsCount) {
		currentPin = BLINK_PINS[currentIndex];

		printBoardTestState();
		mySetPadMode2("test", currentPin, PAL_STM32_MODE_OUTPUT);

		currentIndex++;
		waitForKey();
	}
	// no buffered logger still, just plain old stdout
	while (1) {
		print("Board test done, thank you! Time to remove that jumper and reboot\r\n");
		print("Bye!\r\n");
		chThdSleepSeconds(1);
	}
}
Пример #2
0
/**
 * @brief This function prints out a list of all available commands
 */
void helpCommand(void) {
#if EFI_PROD_CODE
	if (isBoardTestMode()) {
		printBoardTestState();
		return;
	}
#endif /* EFI_PROD_CODE */

#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__)
	scheduleMsg(logging, "%d actions available", consoleActionCount);
	for (int i = 0; i < consoleActionCount; i++) {
		TokenCallback *current = &consoleActions[i];
		scheduleMsg(logging, "  %s: %d parameters", current->token, getParameterCount(current->parameterType));
	}
#endif
	scheduleMsg(logging, "For more visit http://rusefi.com/wiki/index.php?title=Manual:Software:dev_console_commands");
}