Skip to content

Commit

Permalink
feature: logging of ResistanceProxPilot etc to simplify trouble shooting
Browse files Browse the repository at this point in the history
  • Loading branch information
uhi22 committed May 4, 2024
1 parent 7a1c9c3 commit 12ece2a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
10 changes: 6 additions & 4 deletions ccs/hardwareInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,12 @@ void hardwareInterface_WakeupOtherPeripherals()
}
}

/* send the measured CP duty cycle to the serial console for debugging. */
void hardwareInterface_LogTheCpDuty(void) {
int16_t cpDuty_Percent = (uint8_t)Param::GetInt(Param::ControlPilotDuty);
addToTrace(MOD_HWIF, "cpDuty [%] ", cpDuty_Percent);
/* send the measured CP duty cycle and PP resistance etc to the serial console for debugging. */
void hardwareInterface_LogTheCpPpPhysicalData(void) {
addToTrace(MOD_HWIF, "cpDuty [%] ", (int16_t)Param::GetInt(Param::ControlPilotDuty));
addToTrace(MOD_HWIF, "AdcProximityPilot ", (int16_t)Param::GetInt(Param::AdcProximityPilot));
addToTrace(MOD_HWIF, "ResistanceProxPilot [ohm] ", (int16_t)Param::GetInt(Param::ResistanceProxPilot));
addToTrace(MOD_HWIF, "HardwareVariant ", (int16_t)Param::GetInt(Param::HardwareVariant));
}

void hardwareInterface_cyclic(void)
Expand Down
2 changes: 1 addition & 1 deletion ccs/hardwareInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extern int16_t hardwareInterface_getInletVoltage(void);
extern int16_t hardwareInterface_getChargingTargetVoltage(void);
extern int16_t hardwareInterface_getChargingTargetCurrent(void);
extern void hardwareInterface_WakeupOtherPeripherals();
extern void hardwareInterface_LogTheCpDuty();
extern void hardwareInterface_LogTheCpPpPhysicalData();
extern void hardwareInterface_cyclic(void);
extern void hardwareInterface_init(void);

Expand Down
4 changes: 2 additions & 2 deletions ccs/homeplug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ void runSlacSequencer(void)
{
publishStatus("Starting SLAC", "");
addToTrace(MOD_HOMEPLUG, "[PEVSLAC] Checkpoint100: Sending SLAC_PARAM.REQ...");
hardwareInterface_LogTheCpDuty();
hardwareInterface_LogTheCpPpPhysicalData();
setCheckpoint(100);
composeSlacParamReq();
myEthTransmit();
Expand Down Expand Up @@ -732,7 +732,7 @@ void runSlacSequencer(void)
{
// It was sufficient time to get the answers from the modems.
addToTrace(MOD_HOMEPLUG, "[PEVSLAC] It was sufficient time to get the answers from the modems.");
hardwareInterface_LogTheCpDuty();
hardwareInterface_LogTheCpPpPhysicalData();
// Let's see what we received.
if (!isEvseModemFound())
{
Expand Down
1 change: 1 addition & 0 deletions ccs/pevStateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ static void pev_sendCableCheckReq(void)
that we enter the safe shutdown sequence as intended.
(This is a takeover from https://github.com/uhi22/pyPLC/commit/08af8306c60d57c4c33221a0dbb25919371197f9 ) */
connMgr_ApplOk(31);
hardwareInterface_LogTheCpPpPhysicalData(); /* for trouble shooting, log some physical values to the console */
}

static void pev_sendPreChargeReq(void)
Expand Down

0 comments on commit 12ece2a

Please sign in to comment.