utzig commented on a change in pull request #840: Feature/stm32f3
URL: https://github.com/apache/mynewt-core/pull/840#discussion_r170243543
 
 

 ##########
 File path: hw/bsp/nucleo-f303k8/src/hal_bsp.c
 ##########
 @@ -0,0 +1,168 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include <stddef.h>
+
+#include "os/os_dev.h"
+
+#if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1)
+/*
+ * It is necessary to include uart/uart.h before stm32fxx_hal_uart.h gets 
included
+ * due to a name conflict for UART_PARITY_NONE.
+ */
+#include <uart/uart.h>
+#include <uart_hal/uart_hal.h>
+#endif
+
+#include "assert.h"
+#include "bsp/bsp.h"
+#include "hal/hal_bsp.h"
+#include "hal/hal_flash_int.h"
+#include "hal/hal_gpio.h"
+#include "hal/hal_system.h"
+#include "mcu/mcu.h"
+#include "mcu/stm32f3_bsp.h"
+#include "os/os_cputime.h"
+#include "stm32f3xx.h"
+#include "stm32f3xx_hal.h"
+#include "stm32f3xx_hal_gpio.h"
+#include "stm32f3xx_hal_rcc.h"
+#include "syscfg/syscfg.h"
+
+#if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1)
+static struct uart_dev hal_uart[2];
+
+static const struct stm32f3_uart_cfg uart_cfg[UART_CNT] = {
+#if MYNEWT_VAL(UART_0)
+    {
+        .suc_uart    = USART2,
+        .suc_rcc_reg = &RCC->APB1ENR,
+        .suc_rcc_dev = RCC_APB1ENR_USART2EN,
+        .suc_pin_tx  = MCU_GPIO_PORTA(2),
+        .suc_pin_rx  = MCU_GPIO_PORTA(15),
+        .suc_pin_rts = MCU_GPIO_PORTA(1),
+        .suc_pin_cts = MCU_GPIO_PORTA(0),
+        .suc_pin_af  = GPIO_AF7_USART2,
+        .suc_irqn    = USART2_IRQn
+    }
+#endif
+#if MYNEWT_VAL(UART_0) && MYNEWT_VAL(UART_1)
+    ,
 
 Review comment:
   this `#if` block should not be required... just add the `,` after the `}` 
above...

----------------------------------------------------------------
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