2020-09-02 12:39:50 -07:00
|
|
|
/**
|
|
|
|
* @file tcu.h
|
|
|
|
* @brief Base classes for gear selection and transmission control
|
|
|
|
*
|
|
|
|
* @date Aug 31, 2020
|
|
|
|
* @author David Holdeman, (c) 2020
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "global.h"
|
|
|
|
#include "io_pins.h"
|
|
|
|
#include "persistent_configuration.h"
|
2023-12-19 12:34:53 -08:00
|
|
|
#include "generated_lookup_engine_configuration.h"
|
2024-01-02 18:49:28 -08:00
|
|
|
#include "tcu_controller_generated.h"
|
2023-08-30 20:11:24 -07:00
|
|
|
#include <rusefi/timer.h>
|
2020-09-02 12:39:50 -07:00
|
|
|
|
2022-04-23 04:34:39 -07:00
|
|
|
#if EFI_TCU
|
2024-01-02 19:38:26 -08:00
|
|
|
class TransmissionControllerBase: public tcu_controller_s {
|
2022-04-23 04:34:39 -07:00
|
|
|
private:
|
|
|
|
Timer m_shiftTimer;
|
|
|
|
bool m_shiftTime;
|
|
|
|
gear_e m_shiftTimeGear;
|
2020-09-02 12:39:50 -07:00
|
|
|
public:
|
2022-04-18 17:09:27 -07:00
|
|
|
virtual void update(gear_e);
|
|
|
|
virtual void init();
|
|
|
|
virtual gear_e getCurrentGear() const;
|
|
|
|
virtual TransmissionControllerMode getMode() const {
|
|
|
|
return TransmissionControllerMode::None;
|
|
|
|
}
|
2020-09-02 12:39:50 -07:00
|
|
|
protected:
|
2022-04-12 16:15:09 -07:00
|
|
|
gear_e currentGear = NEUTRAL;
|
2022-04-18 17:09:27 -07:00
|
|
|
virtual gear_e setCurrentGear(gear_e);
|
2022-04-06 14:37:30 -07:00
|
|
|
void postState();
|
2022-04-23 04:34:39 -07:00
|
|
|
void measureShiftTime(gear_e);
|
|
|
|
float isShiftCompleted();
|
2020-09-02 12:39:50 -07:00
|
|
|
};
|
2022-04-23 04:34:39 -07:00
|
|
|
#endif // EFI_TCU
|