diff --git a/Projects/AVRISP-MKII/AVRISP.txt b/Projects/AVRISP-MKII/AVRISP.txt index cff8d7dff4543ded81de404e3a0f883209c1513d..feccfcabeaaad3b8701c3cf1021c8e8b3509b21d 100644 --- a/Projects/AVRISP-MKII/AVRISP.txt +++ b/Projects/AVRISP-MKII/AVRISP.txt @@ -247,7 +247,7 @@ * <tr> * <td>VTARGET_ADC_CHANNEL</td> * <td>Makefile CDEFS</td> - * <td>ADC channel number (on supported AVRs) to use for VTARGET level detection.</td> + * <td>ADC channel number (on supported AVRs) to use for VTARGET level detection, if NO_VTARGET_DETECT is not defined.</td> * </tr> * <tr> * <td>ENABLE_ISP_PROTOCOL</td> @@ -267,5 +267,11 @@ * seperate ISP, PDI, and TPI programming headers) but increases programming speed dramatically. * <i>Ignored when compiled for the XPLAIN board.</i></td> * </tr> + * <tr> + * <td>NO_VTARGET_DETECT</td> + * <td>Makefile CDEFS</td> + * <td>Define to disable VTARGET sampling and reporting on AVR models with an ADC converter. This will cause the programmer + * to report a fixed 5V target voltage to the host regardless of the real target voltage.</td> + * </tr> * </table> */ diff --git a/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c b/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c index 00788515dde54a6f6d48e962792b651511418a80..a4709f8f504b887a47277f19e48829ef7319f249 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 diff --git a/Projects/AVRISP-MKII/makefile b/Projects/AVRISP-MKII/makefile index 2698de881bd3d494227849241ed52deeef369635..b0b26c24c1e6a90e5d666f285052dc272c577553 100644 --- a/Projects/AVRISP-MKII/makefile +++ b/Projects/AVRISP-MKII/makefile @@ -198,6 +198,7 @@ CDEFS += -DVTARGET_ADC_CHANNEL=2 CDEFS += -DENABLE_ISP_PROTOCOL CDEFS += -DENABLE_XPROG_PROTOCOL #CDEFS += -DXPROG_VIA_HARDWARE_USART +#CDEFS += -DNO_VTARGET_DETECT # Place -D or -U options here for ASM sources