mirror of
https://github.com/doppelhub/Honda_Insight_LiBCM.git
synced 2026-06-10 23:47:28 -04:00
'MVO' renamed to 'MDV'
Peter changed the MCMe OBDIIC&C parameter name years ago.
This commit is contained in:
@@ -203,8 +203,8 @@ void printHelp(void)
|
||||
void printVspoofInstructions(void)
|
||||
{
|
||||
Serial.print(F("\n\nVoltage Spoofing Commands:"
|
||||
"\n -'$BVO=_ : +/-/0: increase/decrease/reset BVO (OBDIIC&C parameter 0x0A)"
|
||||
"\n -'$MVO=_ : +/-/0: increase/decrease/reset MVO (OBDIIC&C parameter 0x05)"
|
||||
"\n -'$BVO=_ : +/-/0: increase/decrease/reset OBDIIC&C parameter 0x0A"
|
||||
"\n -'$MDV=_ : +/-/0: increase/decrease/reset OBDIIC&C parameter 0x05"
|
||||
"\n"
|
||||
"\nInstructions:"
|
||||
"\n 1: KeyON, engine not running, no IMA CELs"
|
||||
@@ -424,16 +424,15 @@ void USB_userInterface_executeUserInput(void)
|
||||
else { printText_invalidEntry(); }
|
||||
}
|
||||
|
||||
//$MVO
|
||||
//JTS2doNow: Change to latest name //'mvo' no longer used
|
||||
else if ((line[1]=='M') && (line[2]=='V') && (line[3]=='O'))
|
||||
//$MDV
|
||||
else if ((line[1]=='M') && (line[2]=='D') && (line[3]=='V'))
|
||||
{
|
||||
//MVO affects VPIN output
|
||||
//MDV affects VPIN output
|
||||
Serial.print(' ');
|
||||
if ( (line[4]=='=') &&
|
||||
((line[5]=='+') || (line[5]=='-') || (line[5]=='0')) &&
|
||||
(line[6]==STRING_TERMINATION_CHARACTER) ) { vPackSpoof_offsetMVO_adjust(line[5]); }
|
||||
else if (line[4]==STRING_TERMINATION_CHARACTER) { Serial.print(vPackSpoof_offsetMVO_get()); }
|
||||
(line[6]==STRING_TERMINATION_CHARACTER) ) { vPackSpoof_offsetMDV_adjust(line[5]); }
|
||||
else if (line[4]==STRING_TERMINATION_CHARACTER) { Serial.print(vPackSpoof_offsetMDV_get()); }
|
||||
else { printText_invalidEntry(); }
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ const uint16_t EEPROM_ADDRESS_NEXT_Wh_RECORD = 0x012; //EEPROM range is 0x0
|
||||
const uint16_t EEPROM_ADDRESS_COMPILE_TIME = 0x013; //EEPROM range is 0x013:0x01B ( 9B)
|
||||
const uint16_t EEPROM_ADDRESS_MAX_VCELL_DELTA = 0x01C; //EEPROM range is 0x01C:0x01D ( 2B)
|
||||
const uint16_t EEPROM_ADDRESS_BVO_OFFSET = 0x01E; //EEPROM range is 0x01E ( 1B)
|
||||
const uint16_t EEPROM_ADDRESS_MVO_OFFSET = 0x01F; //EEPROM range is 0x01F ( 1B)
|
||||
const uint16_t EEPROM_ADDRESS_MDV_OFFSET = 0x01F; //EEPROM range is 0x01F ( 1B)
|
||||
//this EEPROM space still available
|
||||
//The following addresses start from end of EEPROM space and work backwards to beginning
|
||||
const uint16_t EEPROM_ADDRESS_BATT_HISTORY = EEPROM_LAST_USABLE_ADDRESS - NUM_BYTES_BATTERY_HISTORY; //0xA57:0xF9F (1536B)
|
||||
@@ -205,8 +205,8 @@ void eeprom_delayKeyON_ms_set(uint8_t delay_ms) { EEPROM.upd
|
||||
|
||||
int8_t eeprom_getVspoofOffset_BVO(void) { return EEPROM.read (EEPROM_ADDRESS_BVO_OFFSET); }
|
||||
void eeprom_setVspoofOffset_BVO(int8_t newOffset_counts) { EEPROM.update(EEPROM_ADDRESS_BVO_OFFSET, newOffset_counts); }
|
||||
int8_t eeprom_getVspoofOffset_MVO(void) { return EEPROM.read (EEPROM_ADDRESS_MVO_OFFSET); }
|
||||
void eeprom_setVspoofOffset_MVO(int8_t newOffset_counts) { EEPROM.update(EEPROM_ADDRESS_MVO_OFFSET, newOffset_counts); }
|
||||
int8_t eeprom_getVspoofOffset_MDV(void) { return EEPROM.read (EEPROM_ADDRESS_MDV_OFFSET); }
|
||||
void eeprom_setVspoofOffset_MDV(int8_t newOffset_counts) { EEPROM.update(EEPROM_ADDRESS_MDV_OFFSET, newOffset_counts); }
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -262,10 +262,10 @@ void eeprom_verifyDataValid(void)
|
||||
EEPROM.update(EEPROM_ADDRESS_BVO_OFFSET, EEPROM_ADDRESS_FORMATTED_VALUE);
|
||||
}
|
||||
|
||||
if (EEPROM.read(EEPROM_ADDRESS_MVO_OFFSET) == EEPROM_ADDRESS_FACTORY_DEFAULT_VALUE_8b)
|
||||
if (EEPROM.read(EEPROM_ADDRESS_MDV_OFFSET) == EEPROM_ADDRESS_FACTORY_DEFAULT_VALUE_8b)
|
||||
{
|
||||
printMessage_RestoringEEPROM(); Serial.print(F("MVO_OFFSET"));
|
||||
EEPROM.update(EEPROM_ADDRESS_MVO_OFFSET, EEPROM_ADDRESS_FORMATTED_VALUE);
|
||||
printMessage_RestoringEEPROM(); Serial.print(F("MDV_OFFSET"));
|
||||
EEPROM.update(EEPROM_ADDRESS_MDV_OFFSET, EEPROM_ADDRESS_FORMATTED_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
|
||||
int8_t eeprom_getVspoofOffset_BVO(void);
|
||||
void eeprom_setVspoofOffset_BVO(int8_t);
|
||||
int8_t eeprom_getVspoofOffset_MVO(void);
|
||||
void eeprom_setVspoofOffset_MVO(int8_t);
|
||||
int8_t eeprom_getVspoofOffset_MDV(void);
|
||||
void eeprom_setVspoofOffset_MDV(int8_t);
|
||||
|
||||
void eeprom_resetDebugValues(void);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ void vPackSpoof_handleKeyOFF(void)
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int8_t vPackSpoof_offsetBVO_get(void) { return eeprom_getVspoofOffset_BVO(); }
|
||||
int8_t vPackSpoof_offsetMVO_get(void) { return eeprom_getVspoofOffset_MVO(); }
|
||||
int8_t vPackSpoof_offsetMDV_get(void) { return eeprom_getVspoofOffset_MDV(); }
|
||||
|
||||
void vPackSpoof_offsetBVO_adjust(uint8_t action)
|
||||
{
|
||||
@@ -46,11 +46,11 @@ void vPackSpoof_offsetBVO_adjust(uint8_t action)
|
||||
else if (action == '0') { eeprom_setVspoofOffset_BVO(0); }
|
||||
}
|
||||
|
||||
void vPackSpoof_offsetMVO_adjust(uint8_t action)
|
||||
void vPackSpoof_offsetMDV_adjust(uint8_t action)
|
||||
{
|
||||
if (action == '+') { eeprom_setVspoofOffset_MVO(eeprom_getVspoofOffset_MVO() + 1); }
|
||||
else if (action == '-') { eeprom_setVspoofOffset_MVO(eeprom_getVspoofOffset_MVO() - 1); }
|
||||
else if (action == '0') { eeprom_setVspoofOffset_MVO(0); }
|
||||
if (action == '+') { eeprom_setVspoofOffset_MDV(eeprom_getVspoofOffset_MDV() + 1); }
|
||||
else if (action == '-') { eeprom_setVspoofOffset_MDV(eeprom_getVspoofOffset_MDV() - 1); }
|
||||
else if (action == '0') { eeprom_setVspoofOffset_MDV(0); }
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -89,7 +89,7 @@ void spoofVoltage_VPINout(void)
|
||||
// V_DIV_CORRECTION = (x * 141) >> 7
|
||||
int16_t pwmCounts_VPIN_out = (int16_t)(intermediateMath / LTC68042result_packVoltage_get());
|
||||
|
||||
pwmCounts_VPIN_out += eeprom_getVspoofOffset_MVO();
|
||||
pwmCounts_VPIN_out += eeprom_getVspoofOffset_MDV();
|
||||
|
||||
//bounds checking
|
||||
if (pwmCounts_VPIN_out > 255) {pwmCounts_VPIN_out = 255;}
|
||||
|
||||
@@ -24,9 +24,10 @@
|
||||
|
||||
int8_t vPackSpoof_offsetBVO_get(void);
|
||||
void vPackSpoof_offsetBVO_adjust(uint8_t action);
|
||||
int8_t vPackSpoof_offsetMVO_get(void);
|
||||
void vPackSpoof_offsetMVO_adjust(uint8_t action);
|
||||
int8_t vPackSpoof_offsetMDV_get(void);
|
||||
void vPackSpoof_offsetMDV_adjust(uint8_t action);
|
||||
|
||||
uint8_t vPackSpoof_getSpoofedPackVoltage(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user