X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/7f9f97c792dee6875fbca9806422bdd7d6c5a657..c58c53dba90fdc19d38f5e5d6957f2ede2a740f3:/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c diff --git a/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c b/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c index c2595e78f..a4709f8f5 100644 --- a/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c +++ b/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c @@ -97,7 +97,7 @@ void V2Params_LoadNonVolatileParamValues(void) */ void V2Params_UpdateParamValues(void) { - #if defined(ADC) + #if (defined(ADC) && !defined(NO_VTARGET_DETECT)) /* Update VTARGET parameter with the latest ADC conversion of VTARGET on supported AVR models */ V2Params_GetParamFromTable(PARAM_VTARGET)->ParamValue = ((5 * 10 * ADC_GetResult()) / 1024); #endif @@ -170,7 +170,7 @@ static ParameterItem_t* V2Params_GetParamFromTable(const uint8_t ParamID) ParameterItem_t* CurrTableItem = ParameterTable; /* Find the parameter in the parameter table if present */ - for (uint8_t TableIndex = 0; TableIndex < (sizeof(ParameterTable) / sizeof(ParameterTable[0])); TableIndex++) + for (uint8_t TableIndex = 0; TableIndex < TABLE_PARAM_COUNT; TableIndex++) { if (ParamID == CurrTableItem->ParamID) return CurrTableItem;