Merck / Mbed OS SmartCap_OS5

Dependencies:   nRF51822

Revision:
4:1bfa16834dd4
Parent:
2:def2c045c43a
Child:
7:090f9eea7b3c
--- a/hw.cpp	Tue Dec 20 15:13:35 2016 +0000
+++ b/hw.cpp	Tue Jan 24 16:29:51 2017 +0000
@@ -70,7 +70,7 @@
 /// This provides a result = Voltage/3.6*1023
 /// @param chan is the channel to read
 /// @param times is the number of readings to take
-/// @return sum of all the readings
+/// @return avg of all the readings
 uint16_t adc_read(int chan, int num_readings)
 {
     uint16_t result = 0;
@@ -88,7 +88,7 @@
                               (ADC_CONFIG_EXTREFSEL_None << ADC_CONFIG_EXTREFSEL_Pos);
             break;
 
-        case ADC_CHAN_OPTO:
+        case ADC_CHAN_SOUND:
             NRF_ADC->CONFIG = (ADC_CONFIG_RES_10bit << ADC_CONFIG_RES_Pos) |
                               (ADC_CONFIG_INPSEL_AnalogInputOneThirdPrescaling << ADC_CONFIG_INPSEL_Pos) |
                               (ADC_CONFIG_REFSEL_VBG << ADC_CONFIG_REFSEL_Pos) |