tiny refactoring (#5646)

Co-authored-by: andreika-git <andrei.home@gmail.com>
This commit is contained in:
rusefillc 2023-10-26 13:04:30 -04:00 committed by GitHub
parent 46c5923f25
commit 2507d4e467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -22,6 +22,7 @@ OutputPin* getVvtOutputPin(int index);
#define BANK_BY_INDEX(index) (index / CAMS_PER_BANK)
#define CAM_BY_INDEX(index) (index % CAMS_PER_BANK)
#define INDEX_BY_BANK_CAM(bank, cam) ((bank) * CAMS_PER_BANK + (cam))
class VvtController : public EngineModule, public ClosedLoopController<angle_t, percent_t>, public vvt_s {
public:

View File

@ -256,7 +256,11 @@ void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
// sensor noise + self-stim = loss of trigger sync
return;
}
handleVvtCamSignal(front, nowNt, index);
}
void handleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
TriggerCentral *tc = getTriggerCentral();
if (index == 0) {
engine->outputChannels.vvtChannel1 = front == TriggerValue::RISE;
} else if (index == 1) {

View File

@ -215,6 +215,7 @@ void hwHandleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp);
void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp);
void hwHandleVvtCamSignal(TriggerValue front, efitick_t timestamp, int index);
void hwHandleVvtCamSignal(bool isRising, efitick_t timestamp, int index);
void handleVvtCamSignal(TriggerValue front, efitick_t timestamp, int index);
void validateTriggerInputs();