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) {
int len = minI(numBytes, 7);
// send the consecutive frames
IsoTpFrameHeader header;
header.frameType = ISO_TP_FRAME_CONSECUTIVE;
header.index = ((idx++) & 0x0f);
header.numBytes = len;
int numSent = sendFrame(header, txbuf + offset, len, timeout);
numSent = sendFrame(header, txbuf + offset, len, timeout);
if (numSent < 1)
break;
totalNumSent += numSent;

View File

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

View File

@ -58,10 +58,10 @@ private:
template <int Size, int Offset>
class ObdCanSensor: public CanSensorBase {
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) {
this->PID = PID;
this->Scale = Scale;
this->PID = p_PID;
this->Scale = p_Scale;
}
void decodeFrame(const CANRxFrame& frame, efitick_t nowNt) override {

View File

@ -132,7 +132,7 @@ void kLineThread(void*) {
kvalues[3] = positiveCltWithHighishValueInCaseOfSensorIssue;
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);
ignoreRecentTransmit = true;
} else {

View File

@ -106,7 +106,7 @@ int HIP9011::getGainIndex(DEFINE_HIP_PARAMS) {
* 'TC is typically TINT/(2*Pi*VOUT)'
* 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
*/
@ -115,7 +115,7 @@ float HIP9011::getRpmByAngleWindowAndTimeUs(int timeUs, float angleWindowWidth)
* rpm = 60 seconds / time
* '60000000' because revolutions per MINUTE in uS conversion
*/
float windowWidthMult = angleWindowWidth / 360.0f;
float windowWidthMult = p_angleWindowWidth / 360.0f;
return 60000000.0f / integrationTimeUs * windowWidthMult;
}

View File

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