auto-sync

This commit is contained in:
rusEfi 2014-09-12 10:05:18 -05:00
parent 025f9c9a35
commit 12f0e0019f
5 changed files with 21 additions and 22 deletions

View File

@ -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

View File

@ -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);

View File

@ -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) {

View File

@ -235,5 +235,5 @@ void firmwareError(const char *fmt, ...) {
}
int getRusEfiVersion(void) {
return 20140911;
return 20140912;
}

View File

@ -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