diff options
author | Stephane D'Alu <sdalu@sdalu.com> | 2016-07-11 22:42:52 +0200 |
---|---|---|
committer | Stephane D'Alu <sdalu@sdalu.com> | 2016-07-11 22:42:52 +0200 |
commit | 5923ee5d506d91431d8a6d4ab26e3054fc380963 (patch) | |
tree | 9a84d1feccc55539ea078cad8c647f490c373eba /os | |
parent | 89b707fd7c353a5d1d6d5fb54efd8eb46ffc8f15 (diff) | |
download | ChibiOS-Contrib-5923ee5d506d91431d8a6d4ab26e3054fc380963.tar.gz ChibiOS-Contrib-5923ee5d506d91431d8a6d4ab26e3054fc380963.tar.bz2 ChibiOS-Contrib-5923ee5d506d91431d8a6d4ab26e3054fc380963.zip |
moved spi to LLD
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/ports/NRF5/LLD/hal_spi_lld.c (renamed from os/hal/ports/NRF5/NRF51822/hal_spi_lld.c) | 15 | ||||
-rw-r--r-- | os/hal/ports/NRF5/LLD/hal_spi_lld.h (renamed from os/hal/ports/NRF5/NRF51822/hal_spi_lld.h) | 4 | ||||
-rw-r--r-- | os/hal/ports/NRF5/NRF51822/platform.mk | 4 | ||||
-rw-r--r-- | os/hal/ports/NRF5/NRF52832/nrf_delay.h | 2 | ||||
-rw-r--r-- | os/hal/ports/NRF5/NRF52832/platform.mk | 4 |
5 files changed, 21 insertions, 8 deletions
diff --git a/os/hal/ports/NRF5/NRF51822/hal_spi_lld.c b/os/hal/ports/NRF5/LLD/hal_spi_lld.c index 83b231f..0e90e3f 100644 --- a/os/hal/ports/NRF5/NRF51822/hal_spi_lld.c +++ b/os/hal/ports/NRF5/LLD/hal_spi_lld.c @@ -15,8 +15,8 @@ */
/**
- * @file NRF51822/spi_lld.c
- * @brief NRF51822 low level SPI driver code.
+ * @file NRF5/LLD/hal_spi_lld.c
+ * @brief NRF5 low level SPI driver code.
*
* @addtogroup SPI
* @{
@@ -76,7 +76,10 @@ static void serve_interrupt(SPIDriver *spip) { // Clear SPI READY event flag
port->EVENTS_READY = 0;
-
+#if CORTEX_MODEL >= 4
+ (void)port->EVENTS_READY;
+#endif
+
if (spip->rxptr != NULL) {
*(uint8_t *)spip->rxptr++ = port->RXD;
}
@@ -209,6 +212,9 @@ void spi_lld_start(SPIDriver *spip) { /* clear events flag */
spip->port->EVENTS_READY = 0;
+#if CORTEX_MODEL >= 4
+ (void)spip->port->EVENTS_READY;
+#endif
}
/**
@@ -366,6 +372,9 @@ uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) { while (spip->port->EVENTS_READY == 0)
;
spip->port->EVENTS_READY = 0;
+#if CORTEX_MODEL >= 4
+ (void)spip->port->EVENTS_READY;
+#endif
return spip->port->RXD;
}
diff --git a/os/hal/ports/NRF5/NRF51822/hal_spi_lld.h b/os/hal/ports/NRF5/LLD/hal_spi_lld.h index 742a10b..afad5ab 100644 --- a/os/hal/ports/NRF5/NRF51822/hal_spi_lld.h +++ b/os/hal/ports/NRF5/LLD/hal_spi_lld.h @@ -15,8 +15,8 @@ */
/**
- * @file NRF51822/spi_lld.h
- * @brief NRF51822 low level SPI driver header.
+ * @file NRF/LLD/hal_spi_lld.h
+ * @brief NRF5 low level SPI driver header.
*
* @addtogroup SPI
* @{
diff --git a/os/hal/ports/NRF5/NRF51822/platform.mk b/os/hal/ports/NRF5/NRF51822/platform.mk index a8526b7..587aebd 100644 --- a/os/hal/ports/NRF5/NRF51822/platform.mk +++ b/os/hal/ports/NRF5/NRF51822/platform.mk @@ -13,7 +13,7 @@ ifneq ($(findstring HAL_USE_SERIAL TRUE,$(HALCONF)),) PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_serial_lld.c endif ifneq ($(findstring HAL_USE_SPI TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/NRF51822/hal_spi_lld.c +PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_spi_lld.c endif ifneq ($(findstring HAL_USE_EXT TRUE,$(HALCONF)),) PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/NRF51822/hal_ext_lld_isr.c \ @@ -46,7 +46,7 @@ PLATFORMSRC = ${CHIBIOS}/os/hal/ports/common/ARMCMx/nvic.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_pal_lld.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_serial_lld.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_st_lld.c \ - ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/NRF51822/hal_spi_lld.c \ + ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_spi_lld.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/NRF51822/hal_ext_lld_isr.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/NRF51822/hal_ext_lld.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/NRF51822/hal_i2c_lld.c \ diff --git a/os/hal/ports/NRF5/NRF52832/nrf_delay.h b/os/hal/ports/NRF5/NRF52832/nrf_delay.h index 55a40e3..9b5df64 100644 --- a/os/hal/ports/NRF5/NRF52832/nrf_delay.h +++ b/os/hal/ports/NRF5/NRF52832/nrf_delay.h @@ -27,7 +27,7 @@ inline static void nrf_delay_us(uint32_t volatile number_of_us) __attribute__((always_inline)); inline static void nrf_delay_us(uint32_t volatile number_of_us) { -register uint32_t delay asm ("r0") = number_of_us; +register uint32_t delay __asm ("r0") = number_of_us; __asm volatile ( ".syntax unified\n" "1:\n" diff --git a/os/hal/ports/NRF5/NRF52832/platform.mk b/os/hal/ports/NRF5/NRF52832/platform.mk index 7ce922f..38bc015 100644 --- a/os/hal/ports/NRF5/NRF52832/platform.mk +++ b/os/hal/ports/NRF5/NRF52832/platform.mk @@ -12,6 +12,9 @@ endif ifneq ($(findstring HAL_USE_SERIAL TRUE,$(HALCONF)),) PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_serial_lld.c endif +ifneq ($(findstring HAL_USE_SPI TRUE,$(HALCONF)),) +PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_spi_lld.c +endif ifneq ($(findstring HAL_USE_GPT TRUE,$(HALCONF)),) PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_gpt_lld.c endif @@ -29,6 +32,7 @@ PLATFORMSRC = ${CHIBIOS}/os/hal/ports/common/ARMCMx/nvic.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/NRF52832/hal_lld.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_pal_lld.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_serial_lld.c \ + ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_spi_lld.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_st_lld.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_gpt_lld.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/NRF5/LLD/hal_wdg_lld.c \ |