auto-sync

This commit is contained in:
rusEfi 2014-12-10 22:04:05 -06:00
parent ce2183b251
commit bc15cf88c7
5 changed files with 37 additions and 4 deletions

View File

@ -302,7 +302,14 @@ void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfigurat
engineConfiguration->analogChartMode = AC_MAP;
boardConfiguration->isFastAdcEnabled = true;
// engineConfiguration->map.sensor.sensorType = MT_DENSO183;
engineConfiguration->map.sensor.sensorType = MT_DODGE_NEON_2003;
// boardConfiguration->canTxPin = GPIOB_6;
// boardConfiguration->canRxPin = GPIOB_12;
// engineConfiguration->canWriteEnabled = true;
// engineConfiguration->canReadEnabled = false;
// engineConfiguration->can_nbc_type = CAN_BUS_NBC_BMW;
}
#endif /* EFI_SUPPORT_DODGE_NEON */

View File

@ -63,7 +63,7 @@ static int DigitLength(int digit) {
static void DisplayErrorCode(int length, int code) {
// todo: I suggest we use 'itoa' method to simplify this logic
for (int iter = length - 1; iter >= 0; iter--) {
int ourDigit = (int)pow(10, iter); // 10^0 = 1, 10^1 = 10, 10^2=100, 10^3 = 1000, ....
int ourDigit = (int)efiPow10(iter); // 10^0 = 1, 10^1 = 10, 10^2=100, 10^3 = 1000, ....
int digit = 1; // as we remember "0" we show as one blink
while (code >= ourDigit) {
code = code - ourDigit;

View File

@ -2185,7 +2185,7 @@
<name>$PROJ_DIR$\..\controllers\algo\main_trigger_callback.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\controllers\algo\malfunction_central.cpp</name>
<name>$PROJ_DIR$\..\controllers\algo\malfunction_central.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\controllers\algo\malfunction_central.h</name>
@ -2498,7 +2498,7 @@
<name>$PROJ_DIR$\..\controllers\lcd_controller.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\controllers\malfunction_indicator.c</name>
<name>$PROJ_DIR$\..\controllers\malfunction_indicator.cpp</name>
</file>
<file>
<name>$PROJ_DIR$\..\controllers\malfunction_indicator.h</name>

View File

@ -151,6 +151,31 @@ bool isSameF(float v1, float v2) {
return absF(v1 - v2) < EPS;
}
int efiPow10(int param) {
switch (param) {
case 0:
return 1;
case 1:
return 10;
case 2:
return 100;
case 3:
return 1000;
case 4:
return 10000;
case 5:
return 100000;
case 6:
return 1000000;
case 7:
return 10000000;
case 8:
return 100000000;
}
return 10 * efiPow10(10 - 1);
}
/**
* string to float
* @return NAN in case of invalid string

View File

@ -34,6 +34,7 @@ extern "C"
const char * boolToString(bool value);
uint32_t efiStrlen(const char *param);
int efiPow10(int param);
bool startsWith(const char *line, const char *prefix);
int indexOf(const char *string, char ch);
float atoff(const char *string);