only:shall we be just a little less Toyota

This commit is contained in:
rusefillc 2023-11-01 10:32:53 -04:00
parent 2e62e6fc91
commit 781a236885
6 changed files with 20 additions and 21 deletions

View File

@ -246,11 +246,10 @@ int CanStreamerState::sendDataTimeout(const uint8_t *txbuf, int numBytes, can_sy
while (numBytes > 0) { while (numBytes > 0) {
int len = minI(numBytes, 7); int len = minI(numBytes, 7);
// send the consecutive frames // send the consecutive frames
IsoTpFrameHeader header;
header.frameType = ISO_TP_FRAME_CONSECUTIVE; header.frameType = ISO_TP_FRAME_CONSECUTIVE;
header.index = ((idx++) & 0x0f); header.index = ((idx++) & 0x0f);
header.numBytes = len; header.numBytes = len;
int numSent = sendFrame(header, txbuf + offset, len, timeout); numSent = sendFrame(header, txbuf + offset, len, timeout);
if (numSent < 1) if (numSent < 1)
break; break;
totalNumSent += numSent; totalNumSent += numSent;

View File

@ -86,8 +86,8 @@ void TsChannelBase::writeCrcPacketLarge(const uint8_t responseCode, const uint8_
flush(); flush();
} }
TsChannelBase::TsChannelBase(const char *name) { TsChannelBase::TsChannelBase(const char *p_name) {
this->name = name; this->name = p_name;
} }
void TsChannelBase::assertPacketSize(size_t size, bool allowLongPackets) { void TsChannelBase::assertPacketSize(size_t size, bool allowLongPackets) {

View File

@ -58,10 +58,10 @@ private:
template <int Size, int Offset> template <int Size, int Offset>
class ObdCanSensor: public CanSensorBase { class ObdCanSensor: public CanSensorBase {
public: public:
ObdCanSensor(int PID, float Scale, SensorType type) : ObdCanSensor(int p_PID, float p_Scale, SensorType type) :
CanSensorBase(OBD_TEST_RESPONSE, type, /* timeout, never expire */ 0) { CanSensorBase(OBD_TEST_RESPONSE, type, /* timeout, never expire */ 0) {
this->PID = PID; this->PID = p_PID;
this->Scale = Scale; this->Scale = p_Scale;
} }
void decodeFrame(const CANRxFrame& frame, efitick_t nowNt) override { void decodeFrame(const CANRxFrame& frame, efitick_t nowNt) override {

View File

@ -132,7 +132,7 @@ void kLineThread(void*) {
kvalues[3] = positiveCltWithHighishValueInCaseOfSensorIssue; kvalues[3] = positiveCltWithHighishValueInCaseOfSensorIssue;
chnWrite(klDriver, (const uint8_t *)kvalues, OUT_SIZE); chnWrite(klDriver, (const uint8_t *)kvalues, OUT_SIZE);
uint8_t crc = crc_hondak_calc(kvalues, OUT_SIZE); crc = crc_hondak_calc(kvalues, OUT_SIZE);
chnWrite(klDriver, (const uint8_t *)&crc, 1); chnWrite(klDriver, (const uint8_t *)&crc, 1);
ignoreRecentTransmit = true; ignoreRecentTransmit = true;
} else { } else {

View File

@ -106,7 +106,7 @@ int HIP9011::getGainIndex(DEFINE_HIP_PARAMS) {
* 'TC is typically TINT/(2*Pi*VOUT)' * 'TC is typically TINT/(2*Pi*VOUT)'
* Knock Sensor Training TPIC8101, page 24 * Knock Sensor Training TPIC8101, page 24
*/ */
float HIP9011::getRpmByAngleWindowAndTimeUs(int timeUs, float angleWindowWidth) { float HIP9011::getRpmByAngleWindowAndTimeUs(int timeUs, float p_angleWindowWidth) {
/** /**
* TINT = TC * 2 * PI * VOUT * TINT = TC * 2 * PI * VOUT
*/ */
@ -115,7 +115,7 @@ float HIP9011::getRpmByAngleWindowAndTimeUs(int timeUs, float angleWindowWidth)
* rpm = 60 seconds / time * rpm = 60 seconds / time
* '60000000' because revolutions per MINUTE in uS conversion * '60000000' because revolutions per MINUTE in uS conversion
*/ */
float windowWidthMult = angleWindowWidth / 360.0f; float windowWidthMult = p_angleWindowWidth / 360.0f;
return 60000000.0f / integrationTimeUs * windowWidthMult; return 60000000.0f / integrationTimeUs * windowWidthMult;
} }

View File

@ -212,26 +212,26 @@ void StepperMotor::initialize(StepperHw *hardware, int totalSteps) {
start(); start();
} }
void StepDirectionStepper::initialize(brain_pin_e stepPin, brain_pin_e directionPin, pin_output_mode_e directionPinMode, float reactionTime, brain_pin_e enablePin, pin_output_mode_e enablePinMode) { void StepDirectionStepper::initialize(brain_pin_e p_stepPin, brain_pin_e p_directionPin, pin_output_mode_e p_directionPinMode, float reactionTime, brain_pin_e p_enablePin, pin_output_mode_e p_enablePinMode) {
if (!isBrainPinValid(stepPin) || !isBrainPinValid(directionPin)) { if (!isBrainPinValid(p_stepPin) || !isBrainPinValid(p_directionPin)) {
return; return;
} }
setReactionTime(reactionTime); setReactionTime(reactionTime);
this->directionPinMode = directionPinMode; directionPinMode = p_directionPinMode;
this->directionPin.initPin("Stepper DIR", directionPin, this->directionPinMode); directionPin.initPin("Stepper DIR", p_directionPin, directionPinMode);
this->stepPinMode = OM_DEFAULT; // todo: do we need configurable stepPinMode? stepPinMode = OM_DEFAULT; // todo: do we need configurable stepPinMode?
this->stepPin.initPin("Stepper step", stepPin, this->stepPinMode); stepPin.initPin("Stepper step", p_stepPin, stepPinMode);
this->enablePinMode = enablePinMode; enablePinMode = p_enablePinMode;
this->enablePin.initPin("Stepper EN", enablePin, this->enablePinMode); enablePin.initPin("Stepper EN", p_enablePin, enablePinMode);
// All pins must be 0 for correct hardware startup (e.g. stepper auto-disabling circuit etc.). // All pins must be 0 for correct hardware startup (e.g. stepper auto-disabling circuit etc.).
this->enablePin.setValue(true); // disable stepper enablePin.setValue(true); // disable stepper
this->stepPin.setValue(false); stepPin.setValue(false);
this->directionPin.setValue(false); directionPin.setValue(false);
m_currentDirection = false; m_currentDirection = false;
} }