aboutsummaryrefslogtreecommitdiffstats
path: root/wirish/wirish_analog.c
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2010-09-01 00:02:36 -0400
committerbnewbold <bnewbold@robocracy.org>2010-09-01 00:02:36 -0400
commitd6a32991684b7bfd8b91e3358dee4ca3fc887021 (patch)
tree535ebe6501bda800363c5f4debccf532d289bc1e /wirish/wirish_analog.c
parent9c9d6c153154981fdedbe3f9ed4a1fb61e2b7776 (diff)
parent0ccec95446d4c7f3ea47a46d267c791fb22bb8d4 (diff)
downloadlibrambutan-d6a32991684b7bfd8b91e3358dee4ca3fc887021.tar.gz
librambutan-d6a32991684b7bfd8b91e3358dee4ca3fc887021.zip
Various fixes, working with Maple
Diffstat (limited to 'wirish/wirish_analog.c')
-rw-r--r--wirish/wirish_analog.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/wirish/wirish_analog.c b/wirish/wirish_analog.c
index f4c1204..1b911bc 100644
--- a/wirish/wirish_analog.c
+++ b/wirish/wirish_analog.c
@@ -30,13 +30,12 @@
#include "wirish.h"
#include "io.h"
-extern const PinMapping PIN_MAP[NR_MAPLE_PINS];
-
/* Assumes that the ADC has been initialized and
* that the pin is set to ANALOG_INPUT */
uint32 analogRead(uint8 pin) {
- if (pin >= NR_ANALOG_PINS)
+ if(PIN_MAP[pin].adc == ADC_INVALID) {
return 0;
+ }
return adc_read(PIN_MAP[pin].adc);
}