You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/09/29 00:39:51 UTC

[GitHub] ccollins476ad commented on a change in pull request #1432: Add enable/disable SAADC channel to nordic SDK

ccollins476ad commented on a change in pull request #1432: Add enable/disable SAADC channel to nordic SDK
URL: https://github.com/apache/mynewt-core/pull/1432#discussion_r221408365
 
 

 ##########
 File path: hw/mcu/nordic/src/ext/nrfx/drivers/src/nrfx_saadc.c
 ##########
 @@ -627,4 +627,20 @@ void nrfx_saadc_limits_set(uint8_t channel, int16_t limit_low, int16_t limit_hig
         nrf_saadc_int_enable(int_mask);
     }
 }
+
+void nrfx_enable_adc_chan(int chan, nrf_saadc_input_t pselp,
+                          nrf_saadc_input_t pseln)
+{
+    NRFX_ASSERT(m_cb.active_channels < NRF_SAADC_CHANNEL_COUNT);
+    ++m_cb.active_channels;
 
 Review comment:
   Should this function verify that the specified channel is disabled before incrementing `m_cb.active_channels`?  I don't know how important this is, but I noticed that the nrfx code performs this check:
   ```
       if (m_cb.psel[channel].pselp == NRF_SAADC_INPUT_DISABLED) 
       {
           ++m_cb.active_channels;
       }
   ```
   
   A similar comment applies to the disable case.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services