This commit is contained in:
parent
2577c02fc2
commit
049848c577
|
@ -20,10 +20,45 @@
|
||||||
|
|
||||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||||
#include "can_hw.h"
|
#include "can_hw.h"
|
||||||
|
#include "scheduler.h"
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
EXTERN_ENGINE;
|
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) {
|
void setFrankenso_01_LCD(board_configuration_s *boardConfiguration) {
|
||||||
boardConfiguration->HD44780_rs = GPIOE_7;
|
boardConfiguration->HD44780_rs = GPIOE_7;
|
||||||
boardConfiguration->HD44780_e = GPIOE_9;
|
boardConfiguration->HD44780_e = GPIOE_9;
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
void setFrankenso_01_LCD(board_configuration_s *boardConfiguration);
|
void setFrankenso_01_LCD(board_configuration_s *boardConfiguration);
|
||||||
void disableLCD(board_configuration_s *boardConfiguration);
|
void disableLCD(board_configuration_s *boardConfiguration);
|
||||||
|
void test557init(void);
|
||||||
|
|
||||||
void setFrankensoBoardTestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
void setFrankensoBoardTestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
|
|
|
@ -285,6 +285,7 @@ void prepareVoidConfiguration(engine_configuration_s *activeConfiguration) {
|
||||||
}
|
}
|
||||||
engineConfiguration->LIS302DLCsPin = GPIO_UNASSIGNED;
|
engineConfiguration->LIS302DLCsPin = GPIO_UNASSIGNED;
|
||||||
engineConfiguration->flexFuelSensor = GPIO_UNASSIGNED;
|
engineConfiguration->flexFuelSensor = GPIO_UNASSIGNED;
|
||||||
|
engineConfiguration->test557pin = GPIO_UNASSIGNED;
|
||||||
|
|
||||||
boardConfiguration->joystickCenterPin = GPIO_UNASSIGNED;
|
boardConfiguration->joystickCenterPin = GPIO_UNASSIGNED;
|
||||||
boardConfiguration->joystickAPin = GPIO_UNASSIGNED;
|
boardConfiguration->joystickAPin = GPIO_UNASSIGNED;
|
||||||
|
|
|
@ -215,6 +215,8 @@ void runRusEfi(void) {
|
||||||
#endif
|
#endif
|
||||||
startStatusThreads();
|
startStatusThreads();
|
||||||
|
|
||||||
|
test557init();
|
||||||
|
|
||||||
rememberCurrentConfiguration();
|
rememberCurrentConfiguration();
|
||||||
|
|
||||||
print("Running main loop\r\n");
|
print("Running main loop\r\n");
|
||||||
|
@ -272,5 +274,5 @@ int getRusEfiVersion(void) {
|
||||||
if (initBootloader() != 0)
|
if (initBootloader() != 0)
|
||||||
return 123;
|
return 123;
|
||||||
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
||||||
return 20180126;
|
return 20180127;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue