Add NO_VTARGET_DETECT compile time option to the AVRISP-MKII clone project, to disabl...
authorDean Camera <dean@fourwalledcubicle.com>
Sat, 13 Feb 2010 03:21:28 +0000 (03:21 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sat, 13 Feb 2010 03:21:28 +0000 (03:21 +0000)
Projects/AVRISP-MKII/AVRISP.txt
Projects/AVRISP-MKII/Lib/V2ProtocolParams.c
Projects/AVRISP-MKII/makefile

index cff8d7d..feccfca 100644 (file)
  *   <tr>\r
  *    <td>VTARGET_ADC_CHANNEL</td>\r
  *    <td>Makefile CDEFS</td>\r
- *    <td>ADC channel number (on supported AVRs) to use for VTARGET level detection.</td> \r
+ *    <td>ADC channel number (on supported AVRs) to use for VTARGET level detection, if NO_VTARGET_DETECT is not defined.</td> \r
  *   </tr>\r
  *   <tr>\r
  *    <td>ENABLE_ISP_PROTOCOL</td>\r
  *        seperate ISP, PDI, and TPI programming headers) but increases programming speed dramatically.\r
  *        <i>Ignored when compiled for the XPLAIN board.</i></td>  \r
  *   </tr>\r
+ *   <tr>\r
+ *    <td>NO_VTARGET_DETECT</td>\r
+ *    <td>Makefile CDEFS</td>\r
+ *    <td>Define to disable VTARGET sampling and reporting on AVR models with an ADC converter. This will cause the programmer\r
+ *        to report a fixed 5V target voltage to the host regardless of the real target voltage.</td>  \r
+ *   </tr>\r
  *  </table>\r
  */\r
index 0078851..a4709f8 100644 (file)
@@ -97,7 +97,7 @@ void V2Params_LoadNonVolatileParamValues(void)
  */\r
 void V2Params_UpdateParamValues(void)\r
 {\r
-       #if defined(ADC)\r
+       #if (defined(ADC) && !defined(NO_VTARGET_DETECT))\r
        /* Update VTARGET parameter with the latest ADC conversion of VTARGET on supported AVR models */\r
        V2Params_GetParamFromTable(PARAM_VTARGET)->ParamValue = ((5 * 10 * ADC_GetResult()) / 1024);\r
        #endif\r
index 2698de8..b0b26c2 100644 (file)
@@ -198,6 +198,7 @@ CDEFS += -DVTARGET_ADC_CHANNEL=2
 CDEFS += -DENABLE_ISP_PROTOCOL\r
 CDEFS += -DENABLE_XPROG_PROTOCOL\r
 #CDEFS += -DXPROG_VIA_HARDWARE_USART\r
+#CDEFS += -DNO_VTARGET_DETECT\r
 \r
 \r
 # Place -D or -U options here for ASM sources\r