summaryrefslogtreecommitdiff
path: root/digital/io-hub/src/common/contact.avr.c
diff options
context:
space:
mode:
authorNicolas Schodet2012-05-08 00:53:51 +0200
committerNicolas Schodet2012-05-08 00:53:51 +0200
commit36e894b04ec6e9927740165a5875356b58b9b2ee (patch)
tree26ffe13e80ae54e79df0090fcf29d3adf590f921 /digital/io-hub/src/common/contact.avr.c
parent631474ab8777ed66fb0d8b827c4c1fce5c0a9a29 (diff)
digital/io-hub: optional pull-up for contacts
Diffstat (limited to 'digital/io-hub/src/common/contact.avr.c')
-rw-r--r--digital/io-hub/src/common/contact.avr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/digital/io-hub/src/common/contact.avr.c b/digital/io-hub/src/common/contact.avr.c
index d6692566..f35f093a 100644
--- a/digital/io-hub/src/common/contact.avr.c
+++ b/digital/io-hub/src/common/contact.avr.c
@@ -45,9 +45,9 @@ void
contact_init (void)
{
/* Pull-up. */
-#define CONTACT(io) IO_SET_ (io);
- CONTACT (CONTACT_COLOR);
- CONTACT (CONTACT_JACK);
+#define CONTACT(io, pullup) if (pullup) IO_SET_ (io);
+ CONTACT (CONTACT_COLOR, 1);
+ CONTACT (CONTACT_JACK, 1);
CONTACT_LIST
#undef CONTACT
/* Default to jack out. */
@@ -86,12 +86,12 @@ uint32_t
contact_all (void)
{
uint32_t contacts = 0, bit = 1;
-#define CONTACT(io) do { \
+#define CONTACT(io, pullup) do { \
contacts |= (IO_GET_ (io) ? bit : 0); \
bit <<= 1; \
} while (0);
- CONTACT (CONTACT_COLOR);
- CONTACT (CONTACT_JACK);
+ CONTACT (CONTACT_COLOR, 1);
+ CONTACT (CONTACT_JACK, 1);
CONTACT_LIST
#undef CONTACT
return contacts;