You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2023/06/01 06:57:44 UTC

[mynewt-core] branch master updated: mcu/pic32: Fix build when bus driver is not present

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new fccef3049 mcu/pic32: Fix build when bus driver is not present
fccef3049 is described below

commit fccef30491bed237e567a68b4bf2c3859a073024
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Wed May 31 23:02:19 2023 +0200

    mcu/pic32: Fix build when bus driver is not present
    
    When BUS_DRIVER_PRESENT was not set include files were correctly
    excluded but some SPI related structure that are valid only
    in bus driver build were declared.
    
    Now spiX_cfg is only defined when BUS_DRIVER_PRESENT is present.
---
 hw/mcu/microchip/pic32mz/src/pic32mz_periph.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/mcu/microchip/pic32mz/src/pic32mz_periph.c b/hw/mcu/microchip/pic32mz/src/pic32mz_periph.c
index 2e0d943c3..7168c1495 100644
--- a/hw/mcu/microchip/pic32mz/src/pic32mz_periph.c
+++ b/hw/mcu/microchip/pic32mz/src/pic32mz_periph.c
@@ -153,6 +153,7 @@ static const struct hal_spi_hw_settings spi_5_cfg = {
 };
 #endif
 
+#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
 static const struct bus_spi_dev_cfg spi0_cfg = {
     .spi_num = 0,
     .pin_sck = MCU_GPIO_PORTD(1),
@@ -204,6 +205,7 @@ static const struct bus_spi_dev_cfg spi5_cfg = {
 #endif
 };
 static struct bus_spi_hal_dev spi5_bus;
+#endif
 
 /*
  * I2C_0 -> I2C1