auto-sync
This commit is contained in:
parent
1a1d1b4eb8
commit
25ef6a80e8
|
@ -241,6 +241,11 @@ static msg_t canThread(void *arg) {
|
|||
}
|
||||
|
||||
static void canInfo(void) {
|
||||
if (!engineConfiguration->isCanEnabled) {
|
||||
scheduleMsg(&logger, "CAN is not enabled, please enable & restart");
|
||||
return;
|
||||
}
|
||||
|
||||
scheduleMsg(&logger, "CAN TX %s", hwPortname(boardConfiguration->canTxPin));
|
||||
scheduleMsg(&logger, "CAN RX %s", hwPortname(boardConfiguration->canRxPin));
|
||||
scheduleMsg(&logger, "type=%d canReadEnabled=%s canWriteEnabled=%s period=%d", engineConfiguration->canNbcType,
|
||||
|
@ -260,12 +265,13 @@ void enableFrankensoCan(DECLARE_ENGINE_PARAMETER_F) {
|
|||
}
|
||||
|
||||
void initCan(void) {
|
||||
#if EFI_PROD_CODE
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
addConsoleAction("caninfo", canInfo);
|
||||
if (!engineConfiguration->isCanEnabled)
|
||||
return;
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
#if STM32_CAN_USE_CAN2
|
||||
#if STM32_CAN_USE_CAN2 || defined(__DOXYGEN__)
|
||||
// CAN1 is required for CAN2
|
||||
canStart(&CAND1, &canConfig);
|
||||
canStart(&CAND2, &canConfig);
|
||||
|
@ -274,14 +280,13 @@ void initCan(void) {
|
|||
#endif
|
||||
|
||||
canStart(&EFI_CAN_DEVICE, &canConfig);
|
||||
#if EFI_PROD_CODE
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
|
||||
chThdCreateStatic(canTreadStack, sizeof(canTreadStack), NORMALPRIO, (tfunc_t) canThread, NULL);
|
||||
|
||||
mySetPadMode2("CAN TX", boardConfiguration->canTxPin, PAL_MODE_ALTERNATE(EFI_CAN_TX_AF));
|
||||
mySetPadMode2("CAN RX", boardConfiguration->canRxPin, PAL_MODE_ALTERNATE(EFI_CAN_RX_AF));
|
||||
|
||||
addConsoleAction("caninfo", canInfo);
|
||||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ void assertEqualsM2(const char *msg, float expected, float actual, float EPS) {
|
|||
printf("Validated %s: %f\r\n", msg, expected);
|
||||
}
|
||||
|
||||
void assertEqualsIM(const char *msg, int expected, int actual) {
|
||||
void assertEqualsLM(const char *msg, long expected, long actual) {
|
||||
if (expected != actual) {
|
||||
printf("Assert failed: %s %d while expected %d\r\n", msg, actual, expected);
|
||||
exit(-1);
|
||||
|
|
|
@ -44,7 +44,7 @@ void print(const char *fmt, ...);
|
|||
|
||||
void assertEqualsM2(const char *msg, float expected, float actual, float EPS);
|
||||
void assertEqualsM(const char *msg, float expected, float actual);
|
||||
void assertEqualsIM(const char *msg, int expected, int actual);
|
||||
void assertEqualsLM(const char *msg, long expected, long actual);
|
||||
void assertEquals(float expected, float actual);
|
||||
void assertTrue(float actual);
|
||||
void assertTrueM(const char *msg, float actual);
|
||||
|
|
|
@ -343,23 +343,23 @@ void testRpmCalculator(void) {
|
|||
|
||||
assertREquals((void*)ev0->callback, (void*)turnPinHigh);
|
||||
assertEqualsM("ev 0", st, ev0->momentX);
|
||||
assertEqualsIM("o 0", (int)&enginePins.injectors[0], (int)ev0->param);
|
||||
assertEqualsLM("o 0", (long)&enginePins.injectors[0], (long)ev0->param);
|
||||
|
||||
scheduling_s *ev1 = schedulingQueue.getForUnitText(1);
|
||||
assertEqualsM("ev 1", st, ev1->momentX);
|
||||
assertEqualsIM("o 1", (int)&enginePins.injectors[3], (int)ev1->param);
|
||||
assertEqualsLM("o 1", (long)&enginePins.injectors[3], (long)ev1->param);
|
||||
|
||||
scheduling_s *ev2 = schedulingQueue.getForUnitText(2);
|
||||
assertEqualsIM("o 2", (int)&enginePins.coils[0], (int)ev2->param);
|
||||
assertEqualsLM("o 2", (long)&enginePins.coils[0], (long)ev2->param);
|
||||
|
||||
scheduling_s *ev3 = schedulingQueue.getForUnitText(3);
|
||||
assertEqualsIM("o 3", (int)&enginePins.coils[0], (int)ev3->param);
|
||||
assertEqualsLM("o 3", (long)&enginePins.coils[0], (long)ev3->param);
|
||||
|
||||
scheduling_s *ev4 = schedulingQueue.getForUnitText(4);
|
||||
assertEqualsIM("o 4", (int)&enginePins.injectors[3], (int)ev4->param);
|
||||
assertEqualsLM("o 4", (long)&enginePins.injectors[3], (long)ev4->param);
|
||||
|
||||
scheduling_s *ev5 = schedulingQueue.getForUnitText(5);
|
||||
assertEqualsIM("o 5", (int)&enginePins.injectors[0], (int)ev5->param);
|
||||
assertEqualsLM("o 5", (long)&enginePins.injectors[0], (long)ev5->param);
|
||||
|
||||
schedulingQueue.clear();
|
||||
|
||||
|
|
Loading…
Reference in New Issue