auto-sync

This commit is contained in:
rusEfi 2014-11-03 21:03:18 -06:00
parent 7b1cc151b8
commit 279c00d6ee
2 changed files with 39 additions and 28 deletions

View File

@ -11,61 +11,63 @@
#include "enum_strings.h" #include "enum_strings.h"
#include "error_handling.h" #include "error_handling.h"
/**
* These should be not very long because these are displayed on the LCD as is
*/
const char* getConfigurationName(engine_type_e engineType) { const char* getConfigurationName(engine_type_e engineType) {
switch (engineType) { switch (engineType) {
#if EFI_SUPPORT_DODGE_NEON #if EFI_SUPPORT_DODGE_NEON
case DODGE_NEON_1995: case DODGE_NEON_1995:
return "Neon 1995"; return "Neon95";
case DODGE_NEON_2003: case DODGE_NEON_2003:
return "Neon 2003"; return "Neon03";
#endif /* EFI_SUPPORT_DODGE_NEON */ #endif /* EFI_SUPPORT_DODGE_NEON */
#if EFI_SUPPORT_FORD_ASPIRE #if EFI_SUPPORT_FORD_ASPIRE
case FORD_ASPIRE_1996: case FORD_ASPIRE_1996:
return "Ford Aspire"; return "Aspire";
#endif /* EFI_SUPPORT_FORD_ASPIRE */ #endif /* EFI_SUPPORT_FORD_ASPIRE */
#if EFI_SUPPORT_FORD_FIESTA #if EFI_SUPPORT_FORD_FIESTA
case FORD_FIESTA: case FORD_FIESTA:
return "Ford Fiesta"; return "Fiesta";
#endif /* EFI_SUPPORT_FORD_FIESTA */ #endif /* EFI_SUPPORT_FORD_FIESTA */
#if EFI_SUPPORT_NISSAN_PRIMERA #if EFI_SUPPORT_NISSAN_PRIMERA
case NISSAN_PRIMERA: case NISSAN_PRIMERA:
return "Nissan Primera"; return "Primera";
#endif /* EFI_SUPPORT_NISSAN_PRIMERA */ #endif /* EFI_SUPPORT_NISSAN_PRIMERA */
case HONDA_ACCORD_CD: case HONDA_ACCORD_CD:
return "Honda Accord 3w"; return "Accord3";
case HONDA_ACCORD_CD_TWO_WIRES: case HONDA_ACCORD_CD_TWO_WIRES:
return "Honda Accord 2w"; return "Accord2";
case HONDA_ACCORD_CD_DIP: case HONDA_ACCORD_CD_DIP:
return "Honda Dip"; return "HondaD";
case FORD_INLINE_6_1995: case FORD_INLINE_6_1995:
return "Ford 1995 inline 6"; return "Fordi6";
case GY6_139QMB: case GY6_139QMB:
return "Gy6 139qmb"; return "Gy6139";
case MAZDA_MIATA_NB: case MAZDA_MIATA_NB:
return "Mazda Miata NB"; return "MiataNB";
case MAZDA_323: case MAZDA_323:
return "Mazda 323"; return "M323";
case SATURN_ION_2004: case SATURN_ION_2004:
return "Saturn Ion"; return "Saturn Ion";
case MINI_COOPER_R50: case MINI_COOPER_R50:
return "Mini Cooper R50"; return "CoopR50";
case FORD_ESCORT_GT: case FORD_ESCORT_GT:
return "Ford Escort GT"; return "EscrtGT";
case CITROEN_TU3JP: case CITROEN_TU3JP:
return "Citroen TU3JP"; return "TU3JP";
case ROVER_V8: case ROVER_V8:
return "Rover v8"; return "Rvrv8";
case MITSU_4G93: case MITSU_4G93:
return "Mitsu 4G93"; return "Mi4G93";
case MIATA_1990: case MIATA_1990:
return "Miata 1990"; return "MX590";
case MIATA_1994_DEVIATOR: case MIATA_1994_DEVIATOR:
return "Miata 1994d"; return "MX594d";
case MIATA_1994_SPAGS: case MIATA_1994_SPAGS:
return "Miata 1994s"; return "MX594s";
case MIATA_1996: case MIATA_1996:
return "Miata 1996"; return "MX596";
default: default:
firmwareError("Unexpected: engineType %d", engineType); firmwareError("Unexpected: engineType %d", engineType);
return NULL; return NULL;

View File

@ -15,8 +15,8 @@
#include "rtc_helper.h" #include "rtc_helper.h"
#include "io_pins.h" #include "io_pins.h"
#include "efiGpio.h" #include "efiGpio.h"
#include "svnversion.h"
extern Engine engine;
extern engine_configuration_s *engineConfiguration; extern engine_configuration_s *engineConfiguration;
#define LCD_WIDTH 20 #define LCD_WIDTH 20
@ -30,7 +30,7 @@ char * appendStr(char *ptr, const char *suffix) {
return ptr; return ptr;
} }
static char * prepareVBattMapLine(char *buffer) { static char * prepareVBattMapLine(engine_configuration_s *engineConfiguration, char *buffer) {
char *ptr = buffer; char *ptr = buffer;
*ptr++ = 'V'; *ptr++ = 'V';
ptr = ftoa(ptr, getVBatt(), 10.0f); ptr = ftoa(ptr, getVBatt(), 10.0f);
@ -85,7 +85,7 @@ char * appendPinStatus(char *buffer, io_pin_e pin) {
} }
} }
static char * prepareInfoLine(char *buffer) { static char * prepareInfoLine(engine_configuration_s *engineConfiguration, char *buffer) {
char *ptr = buffer; char *ptr = buffer;
ptr = appendStr(ptr, algorithmStr[engineConfiguration->algorithm]); ptr = appendStr(ptr, algorithmStr[engineConfiguration->algorithm]);
@ -123,10 +123,10 @@ static void prepareCurrentSecondLine(Engine *engine, int index) {
ptr = prepareCltIatTpsLine(engine, buffer); ptr = prepareCltIatTpsLine(engine, buffer);
break; break;
case 1: case 1:
ptr = prepareInfoLine(buffer); ptr = prepareInfoLine(engine->engineConfiguration, buffer);
break; break;
case 2: case 2:
ptr = prepareVBattMapLine(buffer); ptr = prepareVBattMapLine(engine->engineConfiguration, buffer);
break; break;
case 3: case 3:
ptr = prepareStatusLine(buffer); ptr = prepareStatusLine(buffer);
@ -139,12 +139,21 @@ static void prepareCurrentSecondLine(Engine *engine, int index) {
} }
void updateHD44780lcd(Engine *engine) { void updateHD44780lcd(Engine *engine) {
lcd_HD44780_set_position(0, 0);
bool_t isEven = getTimeNowSeconds() % 2 == 0;
if (isEven) {
lcd_HD44780_print_string (VCS_VERSION);
} else {
lcd_HD44780_print_string(getConfigurationName(engine->engineConfiguration->engineType));
}
lcd_HD44780_set_position(0, 9); lcd_HD44780_set_position(0, 9);
/** /**
* this would blink so that we know the LCD is alive * this would blink so that we know the LCD is alive
*/ */
if (getTimeNowSeconds() % 2 == 0) { if (isEven) {
lcd_HD44780_print_char('R'); lcd_HD44780_print_char('R');
} else { } else {
lcd_HD44780_print_char(' '); lcd_HD44780_print_char(' ');