auto-sync

This commit is contained in:
rusEfi 2015-05-12 20:07:47 -04:00
parent 64e3e2e488
commit a3c7a70cc1
1 changed files with 8 additions and 6 deletions

View File

@ -296,7 +296,8 @@ static char pinNameBuffer[16];
extern AdcDevice fastAdc; extern AdcDevice fastAdc;
#endif #endif
static void printAnalogChannelInfoExt(const char *name, adc_channel_e hwChannel, float adcVoltage) { static void printAnalogChannelInfoExt(const char *name, adc_channel_e hwChannel, float adcVoltage,
float dividerCoeff) {
#if HAL_USE_ADC || defined(__DOXYGEN__) #if HAL_USE_ADC || defined(__DOXYGEN__)
if (hwChannel == EFI_ADC_NONE) { if (hwChannel == EFI_ADC_NONE) {
scheduleMsg(&logger, "ADC is not assigned for %s", name); scheduleMsg(&logger, "ADC is not assigned for %s", name);
@ -307,15 +308,15 @@ static void printAnalogChannelInfoExt(const char *name, adc_channel_e hwChannel,
scheduleMsg(&logger, "fast enabled=%s", boolToString(boardConfiguration->isFastAdcEnabled)); scheduleMsg(&logger, "fast enabled=%s", boolToString(boardConfiguration->isFastAdcEnabled));
} }
float voltage = adcVoltage * engineConfiguration->analogInputDividerCoefficient; float voltage = adcVoltage * dividerCoeff;
scheduleMsg(&logger, "%s ADC%d %s %s rawValue=%f/divided=%fv", name, hwChannel, getAdcMode(hwChannel), scheduleMsg(&logger, "%s ADC%d %s %s rawValue=%f/divided=%fv/divider=%f", name, hwChannel, getAdcMode(hwChannel),
getPinNameByAdcChannel(hwChannel, pinNameBuffer), adcVoltage, voltage); getPinNameByAdcChannel(hwChannel, pinNameBuffer), adcVoltage, voltage, dividerCoeff);
#endif #endif
} }
static void printAnalogChannelInfo(const char *name, adc_channel_e hwChannel) { static void printAnalogChannelInfo(const char *name, adc_channel_e hwChannel) {
#if HAL_USE_ADC || defined(__DOXYGEN__) #if HAL_USE_ADC || defined(__DOXYGEN__)
printAnalogChannelInfoExt(name, hwChannel, getVoltage("print", hwChannel)); printAnalogChannelInfoExt(name, hwChannel, getVoltage("print", hwChannel), engineConfiguration->analogInputDividerCoefficient);
#endif #endif
} }
@ -342,7 +343,8 @@ static void printAnalogInfo(void) {
printAnalogChannelInfo("A/C sw", engineConfiguration->acSwitchAdc); printAnalogChannelInfo("A/C sw", engineConfiguration->acSwitchAdc);
printAnalogChannelInfo("HIP9011", engineConfiguration->hipOutputChannel); printAnalogChannelInfo("HIP9011", engineConfiguration->hipOutputChannel);
printAnalogChannelInfoExt("Vbatt", engineConfiguration->vbattAdcChannel, getVBatt(engineConfiguration)); printAnalogChannelInfoExt("Vbatt", engineConfiguration->vbattAdcChannel, getVoltage("vbatt", engineConfiguration->vbattAdcChannel),
engineConfiguration->vbattDividerCoeff);
} }
static THD_WORKING_AREA(csThreadStack, UTILITY_THREAD_STACK_SIZE); // declare thread stack static THD_WORKING_AREA(csThreadStack, UTILITY_THREAD_STACK_SIZE); // declare thread stack