uint16_t COMPARE_TYPE
The timer overflow type.
Definition board_avr2560.h:32
static constexpr uint32_t MICROS_PER_DEG_1_RPM
At 1 RPM, each degree of angular rotation takes this many microseconds.
Definition crankMaths.h:15
uint16_t timeToAngle(uint32_t time) noexcept
Converts a time interval in microsecods to the equivalent degrees of angular (crank) rotation at curr...
COMPARE_TYPE angleToTimerTicks(uint16_t angle) noexcept
Converts angular degrees to the equivalent timer ticks at current RPM.
static int16_t ignitionLimits(int16_t angle)
Makes one pass at nudging the angle to within [0,CRANK_ANGLE_MAX_IGN].
Definition crankMaths.h:51
static constexpr uint32_t MAX_REVOLUTION_TIME
Maximum time in µS that one crank revolution can take.
Definition crankMaths.h:43
uint32_t angleToTime(uint16_t angle) noexcept
Converts angular degrees to the time interval that amount of rotation will take at current RPM.
static constexpr uint16_t MAX_RPM
The maximum rpm that the ECU will attempt to run at.
Definition crankMaths.h:22
void setAngleConverterRevolutionTime(uint32_t revolutionTime) noexcept
Set the revolution time, from which some of the degree<-->angle conversions are derived.
Definition crankMaths.cpp:31
static constexpr uint16_t MIN_REVOLUTION_TIME
Minimum time in µS that one crank revolution can take.
Definition crankMaths.h:36
static uint16_t injectorLimits(uint16_t angle)
Clamp the angle to within [0,CRANK_ANGLE_MAX_INJ].
Definition crankMaths.h:56
static constexpr uint16_t MIN_RPM
Absolute minimum RPM that the crank math (& therefore all of Speeduino) can be used with.
Definition crankMaths.h:29
int16_t CRANK_ANGLE_MAX_IGN
Definition globals.cpp:32
int16_t CRANK_ANGLE_MAX_INJ
The number of crank degrees that the system track over. Typically 720 divided by the number of squirt...
Definition globals.cpp:33
#define UDIV_ROUND_UP(n, d, t)
Rounding up unsigned integer division.
Definition maths.h:126
#define UDIV_ROUND_CLOSEST(n, d, t)
Rounded unsigned integer division.
Definition maths.h:107
static TIntegral readSerialIntegralTimeout(void)
Reads an integral type, timing out if necessary.
Definition comms.cpp:175
static constexpr uint32_t MICROS_PER_MIN
Self-explanatory.
Definition maths.h:22
static int16_t nudge(int16_t min, int16_t max, int16_t value, int16_t nudgeAmount)
Make one pass at correcting the value into the range [min, max)
Definition maths.h:351