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/05/21 15:25:06 UTC

[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2293: Temperature sensor nRF52

apache-mynewt-bot commented on pull request #2293:
URL: https://github.com/apache/mynewt-core/pull/2293#issuecomment-632148076


   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### hw/drivers/temp/include/temp/temp.h
   <details>
   
   ```diff
   @@ -24,7 +24,7 @@
    extern "C" {
    #endif
    
   -/** 
   +/**
     * Temperature in centi-degrees Celsius
     */
    typedef int16_t temperature_t;
   @@ -32,8 +32,8 @@
    struct temperature_dev;
    
    /**
   - * This callback is called when the temperature is sampled. The callback 
   - * could be called from an interrupt context. Use temp_get_last_sample() to 
   + * This callback is called when the temperature is sampled. The callback
   + * could be called from an interrupt context. Use temp_get_last_sample() to
     * get the sampled temperature.
     *
     * @param temp_dev The temperature device
   @@ -58,7 +58,7 @@
    };
    
    /**
   - * Set a function to be called when the temperature is sampled. The callback 
   + * Set a function to be called when the temperature is sampled. The callback
     * could be called from an interrupt context.
     *
     * @param temp_dev The temperature device to set the callback for
   ```
   
   </details>
   
   #### hw/drivers/temp/src/temp.c
   <details>
   
   ```diff
   @@ -16,7 +16,7 @@
    
    #include "temp/temp.h"
    
   -int 
   +int
    temp_set_callback(struct temperature_dev *temp_dev, temperature_cb callback, void *arg)
    {
        temp_dev->callback = callback;
   @@ -24,13 +24,13 @@
        return 0;
    }
    
   -int 
   +int
    temp_sample(struct temperature_dev *temp_dev)
    {
        return temp_dev->temp_funcs.temp_sample(temp_dev);
    }
    
   -temperature_t 
   +temperature_t
    temp_get_last_sample(struct temperature_dev *temp_dev)
    {
        return temp_dev->last_temp;
   @@ -40,7 +40,7 @@
    temp_sample_completed(struct temperature_dev * temp_dev, temperature_t sample)
    {
        temp_dev->last_temp = sample;
   -    if(temp_dev->callback) {
   +    if (temp_dev->callback) {
            temp_dev->callback(temp_dev, temp_dev->callback_arg);
        }
    }
   ```
   
   </details>
   
   #### hw/drivers/temp/temp_nrf52/src/temp_nrf52.c
   <details>
   
   ```diff
   @@ -19,12 +19,13 @@
    
    static struct temperature_dev *global_temp_dev;
    
   -static temperature_t nrf52_temp_convert(int32_t raw_measurement)
   +static temperature_t
   +nrf52_temp_convert(int32_t raw_measurement)
    {
        return (raw_measurement * 100) / 4;
    }
    
   -int 
   +int
    nrf52_temp_sample(struct temperature_dev * temp_dev)
    {
        nrf_temp_task_trigger(NRF_TEMP, NRF_TEMP_TASK_START);
   @@ -43,8 +44,8 @@
        }
    }
    
   -int 
   -nrf52_temp_dev_init(struct os_dev *dev, void *arg) 
   +int
   +nrf52_temp_dev_init(struct os_dev *dev, void *arg)
    {
        struct temperature_dev *temp_dev;
    
   @@ -56,7 +57,7 @@
        global_temp_dev = temp_dev;
        NVIC_SetPriority(TEMP_IRQn, (1 << __NVIC_PRIO_BITS) - 1);
        NVIC_SetVector(TEMP_IRQn, (uint32_t) nrf52_temp_irq_handler);
   -    NVIC_EnableIRQ(TEMP_IRQn); 
   +    NVIC_EnableIRQ(TEMP_IRQn);
        nrf_temp_int_enable(NRF_TEMP, 1);
    
        return 0;
   ```
   
   </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