vss_exti untested

This commit is contained in:
Andrei 2020-08-13 18:27:31 +03:00
parent 45ce812a0f
commit 068f21c616
5 changed files with 32 additions and 1 deletions

View File

@ -6,7 +6,8 @@ export EXTRA_PARAMS="-DDUMMY \
-DDEFAULT_ENGINE_TYPE=MIATA_NA6_VAF \
-DSHORT_BOARD_NAME=frankenso_na6 \
-DHAL_TRIGGER_USE_PAL=TRUE \
-DEFI_VEHICLE_SPEED=FALSE \
-DHAL_VSS_USE_PAL=TRUE \
-DEFI_ICU_INPUTS=FALSE \
-DHAL_USE_ICU=FALSE \
-DEFI_LOGIC_ANALYZER=FALSE \
-DFIRMWARE_ID=\\\"frankensoNA6\\\""

View File

@ -110,6 +110,10 @@
#define HAL_TRIGGER_USE_PAL FALSE
#endif /* HAL_TRIGGER_USE_PAL */
#ifndef HAL_TRIGGER_USE_PAL
#define HAL_TRIGGER_USE_PAL FALSE
#endif /* HAL_TRIGGER_USE_PAL */
// TunerStudio support.
#define EFI_TUNER_STUDIO TRUE
#define EFI_TUNER_STUDIO_VERBOSE TRUE // Debugging output

View File

@ -73,6 +73,10 @@
#define HAL_TRIGGER_USE_PAL FALSE
#endif /* HAL_TRIGGER_USE_PAL */
#ifndef HAL_VSS_USE_PAL
#define HAL_VSS_USE_PAL FALSE
#endif /* HAL_VSS_USE_PAL */
/**
* TunerStudio support.
*/

View File

@ -11,6 +11,7 @@
#include "engine.h"
#include "digital_input_icu.h"
#include "digital_input_exti.h"
#include "pin_repository.h"
#include "can_vss.h"
@ -70,17 +71,34 @@ bool hasVehicleSpeedSensor() {
return CONFIG(vehicleSpeedSensorInputPin) != GPIO_UNASSIGNED;
}
#if HAL_VSS_USE_PAL
static void vsExtiCallback(void *) {
vsAnaWidthCallback();
}
#endif /* HAL_VSS_USE_PAL */
void stopVSSPins(void) {
#if HAL_VSS_USE_PAL
efiExtiDisablePin(activeConfiguration.vehicleSpeedSensorInputPin);
#elif HAL_USE_ICU
stopDigitalCapture("VSS", activeConfiguration.vehicleSpeedSensorInputPin);
#endif /* HAL_VSS_USE_PAL, HAL_USE_ICU */
}
void startVSSPins(void) {
if (!hasVehicleSpeedSensor())
return;
#if HAL_VSS_USE_PAL
ioline_t pal_line = PAL_LINE(getHwPort("vss", CONFIG(vehicleSpeedSensorInputPin)), getHwPin("vss", CONFIG(vehicleSpeedSensorInputPin)));
efiExtiEnablePin("VSS", CONFIG(vehicleSpeedSensorInputPin), PAL_EVENT_MODE_BOTH_EDGES, vsExtiCallback, (void *)pal_line);
#elif HAL_USE_ICU
digital_input_s* vehicleSpeedInput = startDigitalCapture("VSS", CONFIG(vehicleSpeedSensorInputPin));
vehicleSpeedInput->widthListeners.registerCallback((VoidInt) vsAnaWidthCallback, NULL);
#else
#error "HAL_USE_ICU or HAL_VSS_USE_PAL should be enabled to use EFI_VEHICLE_SPEED"
#endif /* HAL_VSS_USE_PAL, HAL_USE_ICU */
}
void initVehicleSpeed(Logging *l) {

View File

@ -110,6 +110,10 @@
#define HAL_TRIGGER_USE_PAL FALSE
#endif /* HAL_TRIGGER_USE_PAL */
#ifndef HAL_VSS_USE_PAL
#define HAL_VSS_USE_PAL FALSE
#endif /* HAL_VSS_USE_PAL */
#define EFI_UART_GPS FALSE
#define EFI_HAS_RESET FALSE
#define EXTREME_TERM_LOGGING FALSE