aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wirish/rules.mk2
-rw-r--r--wirish/wirish_analog.cpp11
2 files changed, 7 insertions, 6 deletions
diff --git a/wirish/rules.mk b/wirish/rules.mk
index 4084448..deb3906 100644
--- a/wirish/rules.mk
+++ b/wirish/rules.mk
@@ -24,6 +24,7 @@ cppSRCS_$(d) := boards.cpp
cppSRCS_$(d) += cxxabi-compat.cpp
cppSRCS_$(d) += HardwareSerial.cpp
cppSRCS_$(d) += Print.cpp
+cppSRCS_$(d) += wirish_analog.cpp
cppSRCS_$(d) += wirish_digital.cpp
cppSRCS_$(d) += wirish_math.cpp
cppSRCS_$(d) += wirish_shift.cpp
@@ -35,7 +36,6 @@ cppSRCS_$(d) += $(WIRISH_BOARD_PATH)/board.cpp
# HardwareSPI.cpp
# HardwareTimer.cpp
# usb_serial.cpp
-# wirish_analog.cpp
# pwm.cpp
# ext_interrupts.cpp
diff --git a/wirish/wirish_analog.cpp b/wirish/wirish_analog.cpp
index 7a12156..91ca0e2 100644
--- a/wirish/wirish_analog.cpp
+++ b/wirish/wirish_analog.cpp
@@ -2,6 +2,7 @@
* The MIT License
*
* Copyright (c) 2010 Perry Hung.
+ * Copyright (c) 2011, 2012 LeafLabs, LLC.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
@@ -25,17 +26,17 @@
*****************************************************************************/
/**
- * @brief Arduino-compatible ADC implementation.
+ * @file wirish/wirish_analog.cpp
+ * @brief Wiring-style analogRead() implementation.
*/
#include <wirish/io.h>
-
#include <libmaple/adc.h>
-
#include <wirish/boards.h>
-/* Assumes that the ADC has been initialized and that the pin is set
- * to INPUT_ANALOG */
+/* Unlike Wiring and Arduino, this assumes that the pin's mode is set
+ * to INPUT_ANALOG. That's faster, but it does require some extra work
+ * on the user's part. Not too much, we think ;). */
uint16 analogRead(uint8 pin) {
const adc_dev *dev = PIN_MAP[pin].adc_device;
if (dev == NULL) {