This commit is contained in:
rusefi 2018-01-28 14:03:58 -05:00
parent 2577c02fc2
commit 049848c577
4 changed files with 40 additions and 1 deletions

View File

@ -20,10 +20,45 @@
#if EFI_PROD_CODE || defined(__DOXYGEN__)
#include "can_hw.h"
#include "scheduler.h"
#endif /* EFI_PROD_CODE */
EXTERN_ENGINE;
#if EFI_PROD_CODE || defined(__DOXYGEN__)
static int periodIndex = 0;
static OutputPin testPin;
scheduling_s *scheduling;
static int test557[] = {100, 100, 200, 200, 500, 500, 500, 5000};
#define TEST_LEN 8
efitimeus_t testTime;
static void toggleTestAndScheduleNext() {
testPin.toggle();
periodIndex = (periodIndex + 1) % TEST_LEN;
testTime += test557[periodIndex];
scheduleByTimestamp(&state->scheduling, switchTimeUs, (schfunc_t) timerCallback, state);
}
void test557init(void) {
if (engineConfiguration->test557pin == GPIO_UNASSIGNED ||
engineConfiguration->test557pin == GPIOA_0) {
return;
}
testPin.initPin("test", engineConfiguration->test557pin);
testPin.setValue(0);
testTime = getTimeNowUs();
toggleTestAndScheduleNext();
}
#endif /* EFI_PROD_CODE */
void setFrankenso_01_LCD(board_configuration_s *boardConfiguration) {
boardConfiguration->HD44780_rs = GPIOE_7;
boardConfiguration->HD44780_e = GPIOE_9;

View File

@ -12,6 +12,7 @@
void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void setFrankenso_01_LCD(board_configuration_s *boardConfiguration);
void disableLCD(board_configuration_s *boardConfiguration);
void test557init(void);
void setFrankensoBoardTestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);

View File

@ -285,6 +285,7 @@ void prepareVoidConfiguration(engine_configuration_s *activeConfiguration) {
}
engineConfiguration->LIS302DLCsPin = GPIO_UNASSIGNED;
engineConfiguration->flexFuelSensor = GPIO_UNASSIGNED;
engineConfiguration->test557pin = GPIO_UNASSIGNED;
boardConfiguration->joystickCenterPin = GPIO_UNASSIGNED;
boardConfiguration->joystickAPin = GPIO_UNASSIGNED;

View File

@ -215,6 +215,8 @@ void runRusEfi(void) {
#endif
startStatusThreads();
test557init();
rememberCurrentConfiguration();
print("Running main loop\r\n");
@ -272,5 +274,5 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20180126;
return 20180127;
}