hw: bsp: pic32mz2048_wi-fire: Set UART4 pins Specify the pins of UART4 (default console output) at initialization: RF8 -> U4TX RF2 -> U4RX
Signed-off-by: Francois Berder <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/14656521 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/14656521 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/14656521 Branch: refs/heads/bluetooth5 Commit: 146565214f00fd006970ec749754ad5333f6b41d Parents: bdd92f7 Author: Francois Berder <[email protected]> Authored: Tue May 9 11:29:42 2017 +0200 Committer: Francois Berder <[email protected]> Committed: Wed May 10 13:54:43 2017 +0200 ---------------------------------------------------------------------- hw/bsp/pic32mz2048_wi-fire/src/os_bsp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/14656521/hw/bsp/pic32mz2048_wi-fire/src/os_bsp.c ---------------------------------------------------------------------- diff --git a/hw/bsp/pic32mz2048_wi-fire/src/os_bsp.c b/hw/bsp/pic32mz2048_wi-fire/src/os_bsp.c index 17ac864..ccf5645 100644 --- a/hw/bsp/pic32mz2048_wi-fire/src/os_bsp.c +++ b/hw/bsp/pic32mz2048_wi-fire/src/os_bsp.c @@ -18,6 +18,8 @@ */ #include "hal/hal_bsp.h" +#include "mcu/mcu.h" +#include "mcu/mips_hal.h" #include "syscfg/syscfg.h" #include "uart/uart.h" #if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1) || MYNEWT_VAL(UART_2) || \ @@ -57,6 +59,10 @@ static struct uart_dev os_bsp_uart3; #if MYNEWT_VAL(UART_4) static struct uart_dev os_bsp_uart4; +static const struct mips_uart_cfg uart4_cfg = { + .tx = MCU_GPIO_PORTF(8), + .rx = MCU_GPIO_PORTF(2) +}; #endif #if MYNEWT_VAL(UART_5) @@ -90,7 +96,7 @@ hal_bsp_init(void) #if MYNEWT_VAL(UART_3) rc = os_dev_create((struct os_dev *) &os_bsp_uart3, "uart3", - OS_DEV_INIT_PRIMARY, 0, uart_hal_init, 0); + OS_DEV_INIT_PRIMARY, 0, uart_hal_init, &uart4_cfg); assert(rc == 0); #endif
