Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw/mcu/nordic: Fix SPI for non-secure code #3344

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions hw/mcu/nordic/nrf5340/src/hal_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,13 +620,13 @@ hal_spi_init(int spi_num, void *cfg, uint8_t spi_type)
irq_handler = nrf5340_spi0_irq_handler;
if (spi_type == HAL_SPI_TYPE_MASTER) {
#if MYNEWT_VAL(SPI_0_MASTER)
spi->nhs_spi.spim = NRF_SPIM0_S;
spi->nhs_spi.spim = NRF_SPIM0;
#else
assert(0);
#endif
} else {
#if MYNEWT_VAL(SPI_0_SLAVE)
spi->nhs_spi.spis = NRF_SPIS0_S;
spi->nhs_spi.spis = NRF_SPIS0;
#else
assert(0);
#endif
Expand All @@ -640,13 +640,13 @@ hal_spi_init(int spi_num, void *cfg, uint8_t spi_type)
irq_handler = nrf5340_spi1_irq_handler;
if (spi_type == HAL_SPI_TYPE_MASTER) {
#if MYNEWT_VAL(SPI_1_MASTER)
spi->nhs_spi.spim = NRF_SPIM1_S;
spi->nhs_spi.spim = NRF_SPIM1;
#else
assert(0);
#endif
} else {
#if MYNEWT_VAL(SPI_1_SLAVE)
spi->nhs_spi.spis = NRF_SPIS1_S;
spi->nhs_spi.spis = NRF_SPIS1;
#else
assert(0);
#endif
Expand All @@ -660,13 +660,13 @@ hal_spi_init(int spi_num, void *cfg, uint8_t spi_type)
irq_handler = nrf5340_spi2_irq_handler;
if (spi_type == HAL_SPI_TYPE_MASTER) {
#if MYNEWT_VAL(SPI_2_MASTER)
spi->nhs_spi.spim = NRF_SPIM2_S;
spi->nhs_spi.spim = NRF_SPIM2;
#else
assert(0);
#endif
} else {
#if MYNEWT_VAL(SPI_2_SLAVE)
spi->nhs_spi.spis = NRF_SPIS2_S;
spi->nhs_spi.spis = NRF_SPIS2;
#else
assert(0);
#endif
Expand All @@ -680,13 +680,13 @@ hal_spi_init(int spi_num, void *cfg, uint8_t spi_type)
irq_handler = nrf5340_spi3_irq_handler;
if (spi_type == HAL_SPI_TYPE_MASTER) {
#if MYNEWT_VAL(SPI_3_MASTER)
spi->nhs_spi.spim = NRF_SPIM2_S;
spi->nhs_spi.spim = NRF_SPIM3;
#else
assert(0);
#endif
} else {
#if MYNEWT_VAL(SPI_3_SLAVE)
spi->nhs_spi.spis = NRF_SPIS2_S;
spi->nhs_spi.spis = NRF_SPIS3;
#else
assert(0);
#endif
Expand All @@ -699,7 +699,7 @@ hal_spi_init(int spi_num, void *cfg, uint8_t spi_type)
spi->irq_num = SPIM4_IRQn;
irq_handler = nrf5340_spi4_irq_handler;
if (spi_type == HAL_SPI_TYPE_MASTER) {
spi->nhs_spi.spim = NRF_SPIM4_S;
spi->nhs_spi.spim = NRF_SPIM4;
} else {
assert(0);
}
Expand Down
Loading