trigger signal debug pins - logic level output #2959
This commit is contained in:
parent
8dff4c3c31
commit
aed7afa1d4
|
@ -19,6 +19,7 @@
|
||||||
#include "buttonshift.h"
|
#include "buttonshift.h"
|
||||||
#include "gear_controller.h"
|
#include "gear_controller.h"
|
||||||
#include "limp_manager.h"
|
#include "limp_manager.h"
|
||||||
|
#include "pin_repository.h"
|
||||||
|
|
||||||
#if EFI_SIGNAL_EXECUTOR_ONE_TIMER
|
#if EFI_SIGNAL_EXECUTOR_ONE_TIMER
|
||||||
// PROD real firmware uses this implementation
|
// PROD real firmware uses this implementation
|
||||||
|
@ -89,6 +90,8 @@ public:
|
||||||
|
|
||||||
const char *prevOutputName = nullptr;
|
const char *prevOutputName = nullptr;
|
||||||
|
|
||||||
|
PinRepository pinRepository;
|
||||||
|
|
||||||
InjectionEvent primeInjEvent;
|
InjectionEvent primeInjEvent;
|
||||||
|
|
||||||
IEtbController *etbControllers[ETB_COUNT] = {nullptr};
|
IEtbController *etbControllers[ETB_COUNT] = {nullptr};
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
EXTERN_ENGINE;
|
EXTERN_ENGINE;
|
||||||
|
|
||||||
|
|
||||||
void efiSetPadUnused(brain_pin_e brainPin DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
void efiSetPadUnused(brain_pin_e brainPin DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
/* input with pull up, is it safe? */
|
/* input with pull up, is it safe? */
|
||||||
|
|
|
@ -9,12 +9,10 @@
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2020
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pin_repository.h"
|
#include "engine.h"
|
||||||
|
|
||||||
EXTERN_ENGINE;
|
EXTERN_ENGINE;
|
||||||
|
|
||||||
static PinRepository pinRepository;
|
|
||||||
|
|
||||||
// todo: move this into PinRepository class
|
// todo: move this into PinRepository class
|
||||||
static const char *PIN_USED[BRAIN_PIN_TOTAL_PINS];
|
static const char *PIN_USED[BRAIN_PIN_TOTAL_PINS];
|
||||||
|
|
||||||
|
@ -85,7 +83,7 @@ bool brain_pin_markUsed(brain_pin_e brainPin, const char *msg DECLARE_ENGINE_PAR
|
||||||
}
|
}
|
||||||
|
|
||||||
getBrainUsedPin(index PASS_ENGINE_PARAMETER_SUFFIX) = msg;
|
getBrainUsedPin(index PASS_ENGINE_PARAMETER_SUFFIX) = msg;
|
||||||
pinRepository.totalPinsUsed++;
|
ENGINE(pinRepository).totalPinsUsed++;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +97,7 @@ void brain_pin_markUnused(brain_pin_e brainPin DECLARE_ENGINE_PARAMETER_SUFFIX)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (getBrainUsedPin(index PASS_ENGINE_PARAMETER_SUFFIX) != nullptr)
|
if (getBrainUsedPin(index PASS_ENGINE_PARAMETER_SUFFIX) != nullptr)
|
||||||
pinRepository.totalPinsUsed--;
|
ENGINE(pinRepository).totalPinsUsed--;
|
||||||
getBrainUsedPin(index PASS_ENGINE_PARAMETER_SUFFIX) = nullptr;
|
getBrainUsedPin(index PASS_ENGINE_PARAMETER_SUFFIX) = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +188,7 @@ static void reportPins(void) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
efiPrintf("Total pins count: %d", pinRepository.totalPinsUsed);
|
efiPrintf("Total pins count: %d", ENGINE(pinRepository).totalPinsUsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void printSpiConfig(const char *msg, spi_device_e device) {
|
void printSpiConfig(const char *msg, spi_device_e device) {
|
||||||
|
@ -284,7 +282,7 @@ bool gpio_pin_markUsed(ioportid_t port, ioportmask_t pin, const char *msg) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
getBrainUsedPin(index) = msg;
|
getBrainUsedPin(index) = msg;
|
||||||
pinRepository.totalPinsUsed++;
|
engine->pinRepository.totalPinsUsed++;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,7 +295,7 @@ void gpio_pin_markUnused(ioportid_t port, ioportmask_t pin) {
|
||||||
int index = getPortPinIndex(port, pin);
|
int index = getPortPinIndex(port, pin);
|
||||||
|
|
||||||
if (getBrainUsedPin(index) != NULL)
|
if (getBrainUsedPin(index) != NULL)
|
||||||
pinRepository.totalPinsUsed--;
|
ENGINE(pinRepository).totalPinsUsed--;
|
||||||
getBrainUsedPin(index) = nullptr;
|
getBrainUsedPin(index) = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue