aboutsummaryrefslogtreecommitdiff
path: root/Projects/AVRISP-MKII/Lib/V2Protocol.h
diff options
context:
space:
mode:
authorDean Camera <[email protected]>2010-01-25 00:52:45 +0000
committerDean Camera <[email protected]>2010-01-25 00:52:45 +0000
commitb68f7f16499a96e85c7cef4afd9da1a5c69e6a08 (patch)
treed26d7195168de8550665e36dd6a443f2f22ab704 /Projects/AVRISP-MKII/Lib/V2Protocol.h
parent871d9bf1af06fe208ca16cb3b19722bec1300e63 (diff)
downloadqmk_firmware-b68f7f16499a96e85c7cef4afd9da1a5c69e6a08.tar.gz
qmk_firmware-b68f7f16499a96e85c7cef4afd9da1a5c69e6a08.zip
Added explicit ADC channel masks for the standard set of ADC channels, as the single-ended channel MUX masks are not equal to the channel number on some AVR models. Changed demos to use the new channel masks when using the ADC driver.
Diffstat (limited to 'Projects/AVRISP-MKII/Lib/V2Protocol.h')
-rw-r--r--Projects/AVRISP-MKII/Lib/V2Protocol.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/Projects/AVRISP-MKII/Lib/V2Protocol.h b/Projects/AVRISP-MKII/Lib/V2Protocol.h
index 862ea48ef7..5af9fe9bfe 100644
--- a/Projects/AVRISP-MKII/Lib/V2Protocol.h
+++ b/Projects/AVRISP-MKII/Lib/V2Protocol.h
@@ -56,14 +56,22 @@
#endif
/* Macros: */
+ #if !defined(__DOXYGEN__)
+ #define _GETADCMUXMASK2(x, y) x ## y
+ #define _GETADCMUXMASK(x, y) _GETADCMUXMASK2(x, y)
+ #endif
+
/** Programmer ID string, returned to the host during the CMD_SIGN_ON command processing */
- #define PROGRAMMER_ID "AVRISP_MK2"
+ #define PROGRAMMER_ID "AVRISP_MK2"
/** Timeout period for each issued command from the host before it is aborted */
- #define COMMAND_TIMEOUT_MS 200
+ #define COMMAND_TIMEOUT_MS 200
/** Command timeout counter register, GPIOR for speed */
- #define TimeoutMSRemaining GPIOR0
+ #define TimeoutMSRemaining GPIOR0
+
+ /** MUX mask for the VTARGET ADC channel number */
+ #define VTARGET_ADC_CHANNEL_MASK _GETADCMUXMASK(ADC_CHANNEL, VTARGET_ADC_CHANNEL)
/* External Variables: */
extern uint32_t CurrentAddress;