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 2020/04/18 12:57:01 UTC

[GitHub] [mynewt-core] caspermeijn opened a new pull request #2275: Battery for PineTime BSP

caspermeijn opened a new pull request #2275: Battery for PineTime BSP
URL: https://github.com/apache/mynewt-core/pull/2275
 
 
   This initializes the ADC for battery voltage measurement for PineTime BSP.
   This also places a ifdef around the  battery shell code, as it doesn't compile when BATTERY_SHELL is disabled.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [mynewt-core] apache-mynewt-bot commented on issue #2275: Battery for PineTime BSP

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #2275: Battery for PineTime BSP
URL: https://github.com/apache/mynewt-core/pull/2275#issuecomment-615865593
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### hw/bsp/pinetime/src/hal_bsp.c
   <details>
   
   ```diff
   @@ -121,7 +121,7 @@
        .div = 1,
    };
    
   -static void 
   +static void
    hal_bsp_battery_init(void)
    {
        int rc;
   ```
   
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [mynewt-core] kasjer commented on a change in pull request #2275: Battery for PineTime BSP

Posted by GitBox <gi...@apache.org>.
kasjer commented on a change in pull request #2275: Battery for PineTime BSP
URL: https://github.com/apache/mynewt-core/pull/2275#discussion_r410698760
 
 

 ##########
 File path: hw/bsp/pinetime/src/hal_bsp.c
 ##########
 @@ -89,6 +92,51 @@ hal_bsp_get_nvic_priority(int irq_num, uint32_t pri)
     return cfg_pri;
 }
 
+static struct adc_dev_cfg hal_bsp_adc_dev_config = {
+    .resolution = ADC_RESOLUTION_10BIT,
+    .oversample = ADC_OVERSAMPLE_DISABLED,
+    .calibrate = false,
+};
+
+static struct adc_chan_cfg hal_bsp_adc_channel_config = {
+    .gain = ADC_GAIN1_6,
+    .reference = ADC_REFERENCE_INTERNAL,
+    .acq_time = ADC_ACQTIME_10US,
+    .pin = NRF_SAADC_INPUT_AIN7,
+    .differential = false,
+    .pin_negative = -1,
+};
+
+static struct battery hal_bsp_battery_dev = {};
 
 Review comment:
   It would be the first time in mynewt code to put = {}; for non stack variable. Not that there is something wrong with this it's just not happened before.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [mynewt-core] apache-mynewt-bot commented on issue #2275: Battery for PineTime BSP

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #2275: Battery for PineTime BSP
URL: https://github.com/apache/mynewt-core/pull/2275#issuecomment-616128161
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [mynewt-core] caspermeijn commented on a change in pull request #2275: Battery for PineTime BSP

Posted by GitBox <gi...@apache.org>.
caspermeijn commented on a change in pull request #2275: Battery for PineTime BSP
URL: https://github.com/apache/mynewt-core/pull/2275#discussion_r410898498
 
 

 ##########
 File path: hw/bsp/pinetime/src/hal_bsp.c
 ##########
 @@ -89,6 +92,51 @@ hal_bsp_get_nvic_priority(int irq_num, uint32_t pri)
     return cfg_pri;
 }
 
+static struct adc_dev_cfg hal_bsp_adc_dev_config = {
+    .resolution = ADC_RESOLUTION_10BIT,
+    .oversample = ADC_OVERSAMPLE_DISABLED,
+    .calibrate = false,
+};
+
+static struct adc_chan_cfg hal_bsp_adc_channel_config = {
+    .gain = ADC_GAIN1_6,
+    .reference = ADC_REFERENCE_INTERNAL,
+    .acq_time = ADC_ACQTIME_10US,
+    .pin = NRF_SAADC_INPUT_AIN7,
+    .differential = false,
+    .pin_negative = -1,
+};
+
+static struct battery hal_bsp_battery_dev = {};
 
 Review comment:
   You are right. This is only valid in C++. And if I read the C spec right it will be initialized to zero because of the static declaration.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on issue #2275: Battery for PineTime BSP

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #2275: Battery for PineTime BSP
URL: https://github.com/apache/mynewt-core/pull/2275#issuecomment-615865593
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### hw/bsp/pinetime/src/hal_bsp.c
   <details>
   
   ```diff
   @@ -121,7 +121,7 @@
        .div = 1,
    };
    
   -static void 
   +static void
    hal_bsp_battery_init(void)
    {
        int rc;
   ```
   
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [mynewt-core] apache-mynewt-bot commented on issue #2275: Battery for PineTime BSP

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #2275: Battery for PineTime BSP
URL: https://github.com/apache/mynewt-core/pull/2275#issuecomment-615869127
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on issue #2275: Battery for PineTime BSP

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #2275: Battery for PineTime BSP
URL: https://github.com/apache/mynewt-core/pull/2275#issuecomment-615869127
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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