mirror of https://github.com/rusefi/rusefi-1.git
[SAFE] Debug cleanups (#1403)
* electronic throttle: inprove debug * idle thread: show debug info for configured idle driver * gpio-chips: make private functions static
This commit is contained in:
parent
07e6e2c4ad
commit
5987fb8b88
|
@ -126,12 +126,9 @@ void setDcMotorDuty(size_t index, float duty) {
|
|||
}
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
void showDcMotorInfo(Logging* logger) {
|
||||
for (int i = 0 ; i < engine->etbActualCount; i++) {
|
||||
EtbHardware *etb = &etbHardware[i];
|
||||
void showDcMotorInfo(Logging* logger, int i) {
|
||||
EtbHardware *etb = &etbHardware[i];
|
||||
|
||||
scheduleMsg(logger, "ETB %d", i);
|
||||
scheduleMsg(logger, "Motor: dir=%d DC=%f", etb->dcMotor.isOpenDirection(), etb->dcMotor.get());
|
||||
}
|
||||
scheduleMsg(logger, " motor: dir=%d DC=%f", etb->dcMotor.isOpenDirection(), etb->dcMotor.get());
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -20,5 +20,5 @@ void setDcMotorFrequency(size_t index, int hz);
|
|||
void setDcMotorDuty(size_t index, float duty);
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
void showDcMotorInfo(Logging* logger);
|
||||
void showDcMotorInfo(Logging* logger, int i);
|
||||
#endif
|
||||
|
|
|
@ -502,10 +502,15 @@ static void showEthInfo(void) {
|
|||
hwPortname(CONFIG(etbIo[0].controlPin1)),
|
||||
currentEtbDuty,
|
||||
engineConfiguration->etbFreq);
|
||||
scheduleMsg(&logger, "dir1=%s", hwPortname(CONFIG(etbIo[0].directionPin1)));
|
||||
scheduleMsg(&logger, "dir2=%s", hwPortname(CONFIG(etbIo[0].directionPin2)));
|
||||
|
||||
showDcMotorInfo(&logger);
|
||||
int i;
|
||||
for (i = 0; i < engine->etbActualCount; i++) {
|
||||
scheduleMsg(&logger, "ETB%d", i);
|
||||
scheduleMsg(&logger, " dir1=%s", hwPortname(CONFIG(etbIo[i].directionPin1)));
|
||||
scheduleMsg(&logger, " dir2=%s", hwPortname(CONFIG(etbIo[i].directionPin2)));
|
||||
scheduleMsg(&logger, " control=%s", hwPortname(CONFIG(etbIo[i].controlPin1)));
|
||||
scheduleMsg(&logger, " disable=%s", hwPortname(CONFIG(etbIo[i].disablePin)));
|
||||
showDcMotorInfo(&logger, i);
|
||||
}
|
||||
|
||||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
|
|
@ -120,12 +120,16 @@ static void showIdleInfo(void) {
|
|||
getIdlePosition(), boolToString(CONFIG(useStepperIdle)));
|
||||
|
||||
if (CONFIG(useStepperIdle)) {
|
||||
scheduleMsg(logger, "directionPin=%s reactionTime=%.2f", hwPortname(CONFIG(idle).stepperDirectionPin),
|
||||
engineConfiguration->idleStepperReactionTime);
|
||||
scheduleMsg(logger, "stepPin=%s steps=%d", hwPortname(CONFIG(idle).stepperStepPin),
|
||||
engineConfiguration->idleStepperTotalSteps);
|
||||
scheduleMsg(logger, "enablePin=%s/%d", hwPortname(engineConfiguration->stepperEnablePin),
|
||||
engineConfiguration->stepperEnablePinMode);
|
||||
if (CONFIG(useHbridges)) {
|
||||
/* TODO */
|
||||
} else {
|
||||
scheduleMsg(logger, "directionPin=%s reactionTime=%.2f", hwPortname(CONFIG(idle).stepperDirectionPin),
|
||||
engineConfiguration->idleStepperReactionTime);
|
||||
scheduleMsg(logger, "stepPin=%s steps=%d", hwPortname(CONFIG(idle).stepperStepPin),
|
||||
engineConfiguration->idleStepperTotalSteps);
|
||||
scheduleMsg(logger, "enablePin=%s/%d", hwPortname(engineConfiguration->stepperEnablePin),
|
||||
engineConfiguration->stepperEnablePinMode);
|
||||
}
|
||||
} else {
|
||||
if (!CONFIG(isDoubleSolenoidIdle)) {
|
||||
scheduleMsg(logger, "idle valve freq=%d on %s", CONFIG(idle).solenoidFrequency,
|
||||
|
|
|
@ -630,7 +630,7 @@ void requestTLE8888initialization(void) {
|
|||
/* Driver exported functions. */
|
||||
/*==========================================================================*/
|
||||
|
||||
int tle8888_writePad(void *data, unsigned int pin, int value) {
|
||||
static int tle8888_writePad(void *data, unsigned int pin, int value) {
|
||||
|
||||
if ((pin >= TLE8888_OUTPUTS) || (data == NULL))
|
||||
return -1;
|
||||
|
@ -736,7 +736,7 @@ void tle8888_read_reg(uint16_t reg, uint16_t *val)
|
|||
tle8888_spi_rw(chip, CMD_R(reg), val);
|
||||
}
|
||||
|
||||
int tle8888_init(void * data)
|
||||
static int tle8888_init(void * data)
|
||||
{
|
||||
int ret;
|
||||
struct tle8888_priv *chip;
|
||||
|
@ -763,7 +763,7 @@ int tle8888_init(void * data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int tle8888_deinit(void *data)
|
||||
static int tle8888_deinit(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
|
|
Loading…
Reference in New Issue