auto-sync
This commit is contained in:
parent
025f9c9a35
commit
12f0e0019f
|
@ -37,20 +37,7 @@
|
|||
// return interpolate(5000, 1.1, 8000, 1, rpm);
|
||||
// return interpolate(500, 0.5, 5000, 1.1, rpm);
|
||||
//}
|
||||
/**
|
||||
* @return time needed to rotate crankshaft by one degree, in milliseconds.
|
||||
* @deprecated
|
||||
*/
|
||||
float getOneDegreeTimeMs(int rpm) {
|
||||
return 1000.0f * 60 / 360 / rpm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return time needed to rotate crankshaft by one degree, in microseconds.
|
||||
*/
|
||||
float getOneDegreeTimeUs(int rpm) {
|
||||
return 1000000.0f * 60 / 360 / rpm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return number of milliseconds in one crankshaft revolution
|
||||
|
|
|
@ -32,8 +32,22 @@ extern "C"
|
|||
|
||||
float getDefaultFuel(int rpm, float map);
|
||||
|
||||
float getOneDegreeTimeMs(int rpm);
|
||||
float getOneDegreeTimeUs(int rpm);
|
||||
/**
|
||||
* So that's how 'inline' syntax for both GCC and IAR
|
||||
* It is interesting to mention that GCC compiler chooses not to inline this function.
|
||||
*
|
||||
* @return time needed to rotate crankshaft by one degree, in milliseconds.
|
||||
* @deprecated use at least Us, maybe event Nt
|
||||
*/
|
||||
inline float getOneDegreeTimeMs(int rpm) {
|
||||
return 1000.0f * 60 / 360 / rpm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return time needed to rotate crankshaft by one degree, in microseconds.
|
||||
*/
|
||||
#define getOneDegreeTimeUs(rpm) (1000000.0f * 60 / 360 / (rpm))
|
||||
|
||||
float getCrankshaftRevolutionTimeMs(int rpm);
|
||||
|
||||
int isCrankingRT(engine_configuration_s *engineConfiguration, int rpm);
|
||||
|
|
|
@ -173,11 +173,9 @@ int getRevolutionCounter(void) {
|
|||
* @return Current crankshaft angle, 0 to 720 for four-stroke
|
||||
*/
|
||||
float getCrankshaftAngle(uint64_t timeUs) {
|
||||
uint64_t timeSinceZeroAngle = timeUs - rpmState.lastRpmEventTimeUs;
|
||||
uint64_t timeSinceZeroAngleUs = timeUs - rpmState.lastRpmEventTimeUs;
|
||||
|
||||
float cRevolutionTimeMs = getCrankshaftRevolutionTimeMs(rpmState.rpm());
|
||||
|
||||
return 360.0 * timeSinceZeroAngle / cRevolutionTimeMs / 1000;
|
||||
return timeSinceZeroAngleUs / getOneDegreeTimeUs(rpmState.rpm());
|
||||
}
|
||||
|
||||
void initRpmCalculator(void) {
|
||||
|
|
|
@ -235,5 +235,5 @@ void firmwareError(const char *fmt, ...) {
|
|||
}
|
||||
|
||||
int getRusEfiVersion(void) {
|
||||
return 20140911;
|
||||
return 20140912;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// This file was generated by Version2Header
|
||||
// Thu Sep 11 18:42:44 EDT 2014
|
||||
// Fri Sep 12 10:36:39 EDT 2014
|
||||
#ifndef VCS_VERSION
|
||||
#define VCS_VERSION "4633"
|
||||
#define VCS_VERSION "4660"
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue