wes3 commented on a change in pull request #1266: battery/adc: Add activation 
pin support
URL: https://github.com/apache/mynewt-core/pull/1266#discussion_r202091610
 
 

 ##########
 File path: hw/battery/src/battery_adc.c
 ##########
 @@ -104,6 +122,18 @@ battery_adc_open(struct os_dev *dev, uint32_t timeout, 
void *arg)
         /* Setup channel configuration to use for battery voltage */
         adc_chan_config(bat_adc->adc_dev, bat_adc->cfg.channel,
                 bat_adc->cfg.adc_channel_cfg);
+
+        /* Additional GPIO needed before measurement ? */
+        if (bat_adc->cfg.activation_pin != -1) {
+            /* Should it be activate once or before each measurement */
+            if (bat_adc->cfg.activation_pin_on_open) {
 
 Review comment:
   I have to say I do not understand why you need the activation_pin_on_open 
flag. Why have the extra logic? 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to