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 2021/02/03 15:09:06 UTC

[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2461: stm32 spi bus driver

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


   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### hw/bus/drivers/spi_stm32/src/spi_stm32.c
   <details>
   
   ```diff
   @@ -66,15 +66,15 @@
    
    #if MYNEWT_VAL(SPI_STM32_STAT)
    STATS_SECT_START(spi_stm32_stats_section)
   -    STATS_SECT_ENTRY(read_bytes)
   -    STATS_SECT_ENTRY(written_bytes)
   -    STATS_SECT_ENTRY(dma_transferred_bytes)
   +STATS_SECT_ENTRY(read_bytes)
   +STATS_SECT_ENTRY(written_bytes)
   +STATS_SECT_ENTRY(dma_transferred_bytes)
    STATS_SECT_END
    
    STATS_NAME_START(spi_stm32_stats_section)
   -    STATS_NAME(spi_stm32_stats_section, read_bytes)
   -    STATS_NAME(spi_stm32_stats_section, written_bytes)
   -    STATS_NAME(spi_stm32_stats_section, dma_transferred_bytes)
   +STATS_NAME(spi_stm32_stats_section, read_bytes)
   +STATS_NAME(spi_stm32_stats_section, written_bytes)
   +STATS_NAME(spi_stm32_stats_section, dma_transferred_bytes)
    STATS_NAME_END(spi_stm32_stats_section)
    #endif
    
   @@ -649,8 +649,8 @@
    
    static int
    spi_stm32_read(struct bus_dev *bdev, struct bus_node *bnode,
   -                 uint8_t *buf, uint16_t length, os_time_t timeout,
   -                 uint16_t flags)
   +               uint8_t *buf, uint16_t length, os_time_t timeout,
   +               uint16_t flags)
    {
        struct bus_spi_dev *dev = (struct bus_spi_dev *)bdev;
        struct bus_spi_node *node = (struct bus_spi_node *)bnode;
   @@ -690,8 +690,8 @@
    
    static int
    spi_stm32_write(struct bus_dev *bdev, struct bus_node *bnode,
   -                  const uint8_t *buf, uint16_t length, os_time_t timeout,
   -                  uint16_t flags)
   +                const uint8_t *buf, uint16_t length, os_time_t timeout,
   +                uint16_t flags)
    {
        struct bus_spi_dev *dev = (struct bus_spi_dev *)bdev;
        struct bus_spi_node *node = (struct bus_spi_node *)bnode;
   ```
   
   </details>
   
   #### hw/bus/drivers/spi_stm32/stm32f0xx/src/spidmacfg.c
   <details>
   
   ```diff
   @@ -22,11 +22,13 @@
    #include <stm32f0xx_hal_dma.h>
    
    #define DMA_IRQn(ch) ((ch) == DMA1_CH1 ? DMA1_Ch1_IRQn : \
   -                        ((ch) >= DMA1_CH2 && (ch) <= DMA1_CH3) || ((ch) >= DMA2_CH1 && (ch) <=DMA2_CH2) ? DMA1_Channel2_3_IRQn : \
   -                        DMA1_Channel4_5_IRQn)
   +                      ((ch) >= DMA1_CH2 && (ch) <= DMA1_CH3) || \
   +                      ((ch) >= DMA2_CH1 && (ch) <= DMA2_CH2) ? DMA1_Channel2_3_IRQn : \
   +                      DMA1_Channel4_5_IRQn)
    #define DMA_IRQ_HANDLER(ch) ((ch) == DMA1_CH1 ? stm32_dma1_1_irq_handler : \
   -                        ((ch) >= DMA1_CH2 && (ch) <= DMA1_CH3) || ((ch) >= DMA2_CH1 && (ch) <=DMA2_CH2) ? stm32_dma1_2_3_irq_handler : \
   -                        stm32_dma1_4_5_6_7_irq_handler)
   +                             ((ch) >= DMA1_CH2 && (ch) <= DMA1_CH3) || \
   +                             ((ch) >= DMA2_CH1 && (ch) <= DMA2_CH2) ? stm32_dma1_2_3_irq_handler : \
   +                             stm32_dma1_4_5_6_7_irq_handler)
    
    #define SPI_DMA_RX_CHANNEL_DEFINE(dma, ch, name)                    \
        const struct stm32_dma_cfg DMA ## dma ## _channel ## ch = {     \
   ```
   
   </details>
   
   #### hw/bus/drivers/spi_stm32/stm32l0xx/src/spidmacfg.c
   <details>
   
   ```diff
   @@ -21,7 +21,7 @@
    #include <stm32l0xx_hal_dma.h>
    #include <stm32_common/stm32_dma.h>
    
   -#define DMA_IRQn(ch) ((uint8_t)DMA1_Channel1_IRQn + (((DMA1_CH3) > 3) ? 2 : ((DMA1_CH3) >> 1 )))
   +#define DMA_IRQn(ch) ((uint8_t)DMA1_Channel1_IRQn + (((DMA1_CH3) > 3) ? 2 : ((DMA1_CH3) >> 1)))
    #define DMA_IRQ_HANDLER(ch) (((ch) > DMA1_CH3) ? stm32_dma1_4_5_6_7_irq_handler : stm32_dma1_2_3_irq_handler)
    
    extern DMA_HandleTypeDef *stm32_dma_ch[];
   ```
   
   </details>
   
   #### hw/bus/drivers/spi_stm32/stm32wbxx/src/spidmacfg.c
   <details>
   
   ```diff
   @@ -22,7 +22,7 @@
    #include <stm32_common/stm32_dma.h>
    
    #define SPI_DMA_RX_CHANNEL_DEFINE(dma, ch, spi_num)                         \
   -    const struct stm32_dma_cfg DMA ## dma ## _channel ## ch ## _spi ## spi_num ##_rx = { \
   +    const struct stm32_dma_cfg DMA ## dma ## _channel ## ch ## _spi ## spi_num ## _rx = { \
            DMA ## dma ## _CH ## ch,                                            \
            DMA ## dma ## _Channel ## ch ## _IRQn,                              \
            stm32_dma ## dma ## _ ## ch ## _irq_handler,                        \
   @@ -40,7 +40,7 @@
        }
    
    #define SPI_DMA_TX_CHANNEL_DEFINE(dma, ch, spi_num)                         \
   -    const struct stm32_dma_cfg DMA ## dma ## _channel ## ch ## _spi ## spi_num ##_tx = { \
   +    const struct stm32_dma_cfg DMA ## dma ## _channel ## ch ## _spi ## spi_num ## _tx = { \
            DMA ## dma ## _CH ## ch,                                            \
            DMA ## dma ## _Channel ## ch ## _IRQn,                              \
            stm32_dma ## dma ## _ ## ch ## _irq_handler,                        \
   ```
   
   </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