refactoring: time to unify digital pin API
trying to fix build
This commit is contained in:
parent
6a5d53fe64
commit
1ad591742b
|
@ -839,6 +839,6 @@ int getRusEfiVersion(void) {
|
|||
if (initBootloader() != 0)
|
||||
return 123;
|
||||
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
||||
return 20191110;
|
||||
return 20191112;
|
||||
}
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
|
|
@ -22,6 +22,6 @@ void startTriggerInputPins(void);
|
|||
void stopTriggerInputPins(void);
|
||||
void setPrimaryChannel(brain_pin_e brainPin);
|
||||
void turnOffTriggerInputPin(brain_pin_e brainPin);
|
||||
void turnOnTriggerInputPin(const char *msg, int index, bool isVvtShaft);
|
||||
void turnOnTriggerInputPin(const char *msg, int index, bool isTriggerShaft);
|
||||
|
||||
#endif /* CRANK_INPUT_H_ */
|
||||
|
|
|
@ -64,8 +64,8 @@ static void cam_callback(void *arg) {
|
|||
}
|
||||
}
|
||||
|
||||
void turnOnTriggerInputPin(const char *msg, int index, bool isVvtShaft) {
|
||||
brain_pin_e brainPin = isVvtShaft ? engineConfiguration->camInputs[index] : CONFIGB(triggerInputPins)[index];
|
||||
void turnOnTriggerInputPin(const char *msg, int index, bool isTriggerShaft) {
|
||||
brain_pin_e brainPin = isTriggerShaft ? CONFIGB(triggerInputPins)[index] : engineConfiguration->camInputs[index];
|
||||
|
||||
scheduleMsg(logger, "turnOnTriggerInputPin(PAL) %s %s", msg, hwPortname(brainPin));
|
||||
|
||||
|
|
|
@ -28,12 +28,12 @@ extern bool hasFirmwareErrorFlag;
|
|||
|
||||
static Logging *logger;
|
||||
|
||||
static void cam_icu_width_callback(void *arg) {
|
||||
static void vvtWidthCallback(void *arg) {
|
||||
(void)arg;
|
||||
hwHandleVvtCamSignal(TV_RISE);
|
||||
}
|
||||
|
||||
static void cam_icu_period_callback(void *arg) {
|
||||
static void vvtPeriodCallback(void *arg) {
|
||||
(void)arg;
|
||||
hwHandleVvtCamSignal(TV_FALL);
|
||||
}
|
||||
|
@ -79,21 +79,21 @@ static void shaftPeriodCallback(bool isPrimary) {
|
|||
hwHandleShaftSignal(signal);
|
||||
}
|
||||
|
||||
void turnOnTriggerInputPin(const char *msg, int index, bool isVvtShaft) {
|
||||
void turnOnTriggerInputPin(const char *msg, int index, bool isTriggerShaft) {
|
||||
|
||||
brain_pin_e brainPin = isVvtShaft ? engineConfiguration->camInputs[index] : CONFIGB(triggerInputPins)[index];
|
||||
brain_pin_e brainPin = isTriggerShaft ? CONFIGB(triggerInputPins)[index] : engineConfiguration->camInputs[index];
|
||||
if (brainPin == GPIO_UNASSIGNED) {
|
||||
return;
|
||||
}
|
||||
|
||||
digital_input_s* input = startDigitalCapture("trigger", brainPin, true);
|
||||
if (isVvtShaft) {
|
||||
input->setWidthCallback((VoidInt)(void*)shaftWidthCallback, NULL);
|
||||
input->setPeriodCallback((VoidInt)(void*)shaftPeriodCallback, NULL);
|
||||
} else {
|
||||
if (isTriggerShaft) {
|
||||
void * arg = (void*) (index == 0);
|
||||
input->setWidthCallback((VoidInt)(void*)shaftWidthCallback, arg);
|
||||
input->setPeriodCallback((VoidInt)(void*)shaftPeriodCallback, arg);
|
||||
} else {
|
||||
input->setWidthCallback((VoidInt)(void*)vvtWidthCallback, NULL);
|
||||
input->setPeriodCallback((VoidInt)(void*)vvtPeriodCallback, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue