diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-01-06 12:18:51 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-01-06 12:18:51 +0000 |
commit | 0116b4d06b31b2adbd03576074bbc8503a023218 (patch) | |
tree | 40dec77117393ea7aa7bc5aaa1c090858e0521c2 /os/hal/platforms/LPC13xx | |
parent | 3d8343e46408a73b7d1d71d25449709a0bdfb152 (diff) | |
download | ChibiOS-0116b4d06b31b2adbd03576074bbc8503a023218.tar.gz ChibiOS-0116b4d06b31b2adbd03576074bbc8503a023218.tar.bz2 ChibiOS-0116b4d06b31b2adbd03576074bbc8503a023218.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2596 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/LPC13xx')
-rw-r--r-- | os/hal/platforms/LPC13xx/hal_lld.c | 2 | ||||
-rw-r--r-- | os/hal/platforms/LPC13xx/hal_lld.h | 10 | ||||
-rw-r--r-- | os/hal/platforms/LPC13xx/spi_lld.c | 28 | ||||
-rw-r--r-- | os/hal/platforms/LPC13xx/spi_lld.h | 6 |
4 files changed, 29 insertions, 17 deletions
diff --git a/os/hal/platforms/LPC13xx/hal_lld.c b/os/hal/platforms/LPC13xx/hal_lld.c index a4575dfce..5babb8d2d 100644 --- a/os/hal/platforms/LPC13xx/hal_lld.c +++ b/os/hal/platforms/LPC13xx/hal_lld.c @@ -29,7 +29,7 @@ #include "hal.h"
/**
- * @brief Register missing in NXP header file. + * @brief Register missing in NXP header file.
*/
#define FLASHCFG (*((volatile uint32_t *)0x4003C010))
diff --git a/os/hal/platforms/LPC13xx/hal_lld.h b/os/hal/platforms/LPC13xx/hal_lld.h index 386ec44a6..ff7445df9 100644 --- a/os/hal/platforms/LPC13xx/hal_lld.h +++ b/os/hal/platforms/LPC13xx/hal_lld.h @@ -101,7 +101,7 @@ /*===========================================================================*/
/**
- * @brief Calculated SYSOSCCTRL setting. + * @brief Calculated SYSOSCCTRL setting.
*/
#if (SYSOSCCLK < 18000000) || defined(__DOXYGEN__)
#define LPC13xx_SYSOSCCTRL 0
@@ -110,7 +110,7 @@ #endif
/**
- * @brief PLL input clock frequency. + * @brief PLL input clock frequency.
*/
#if (LPC13xx_PLLCLK_SOURCE == SYSPLLCLKSEL_SYSOSC) || defined(__DOXYGEN__)
#define LPC13xx_SYSPLLCLKIN SYSOSCCLK
@@ -131,7 +131,7 @@ #endif
/**
- * @brief PSEL mask in SYSPLLCTRL register. + * @brief PSEL mask in SYSPLLCTRL register.
*/
#if (LPC13xx_SYSPLL_DIV == 2) || defined(__DOXYGEN__)
#define LPC13xx_SYSPLLCTRL_PSEL (0 << 5)
@@ -146,7 +146,7 @@ #endif
/**
- * @brief CCP frequency. + * @brief CCP frequency.
*/
#define LPC13xx_SYSPLLCCO (LPC13xx_SYSPLLCLKIN * LPC13xx_SYSPLL_MUL * \
LPC13xx_SYSPLL_DIV)
@@ -181,7 +181,7 @@ #endif
/**
- * @brief Flash wait states. + * @brief Flash wait states.
*/
#if (LPC13xx_SYSCLK <= 20000000) || defined(__DOXYGEN__)
#define LPC13xx_FLASHCFG_FLASHTIM 0
diff --git a/os/hal/platforms/LPC13xx/spi_lld.c b/os/hal/platforms/LPC13xx/spi_lld.c index d7dd8f17f..1a98a7a15 100644 --- a/os/hal/platforms/LPC13xx/spi_lld.c +++ b/os/hal/platforms/LPC13xx/spi_lld.c @@ -59,10 +59,16 @@ static void ssp_fifo_preload(SPIDriver *spip) { while(((ssp->SR & SR_TNF) != 0) && (n > 0)) {
if (spip->spd_txptr != NULL) {
- if ((ssp->CR0 & CR0_DSSMASK) > CR0_DSS8BIT)
- ssp->DR = *(uint16_t *)spip->spd_txptr++;
- else
- ssp->DR = *(uint8_t *)spip->spd_txptr++;
+ if ((ssp->CR0 & CR0_DSSMASK) > CR0_DSS8BIT) {
+ const uint16_t *p = spip->spd_txptr;
+ ssp->DR = *p++;
+ spip->spd_txptr = p;
+ }
+ else {
+ const uint8_t *p = spip->spd_txptr;
+ ssp->DR = *p++;
+ spip->spd_txptr = p;
+ }
}
else
ssp->DR = 0xFFFFFFFF;
@@ -87,10 +93,16 @@ static void spi_serve_interrupt(SPIDriver *spip) { ssp->ICR = ICR_RT | ICR_ROR;
while ((ssp->SR & SR_RNE) != 0) {
if (spip->spd_rxptr != NULL) {
- if ((ssp->CR0 & CR0_DSSMASK) > CR0_DSS8BIT)
- *(uint16_t *)spip->spd_rxptr++ = ssp->DR;
- else
- *(uint8_t *)spip->spd_rxptr++ = ssp->DR;
+ if ((ssp->CR0 & CR0_DSSMASK) > CR0_DSS8BIT) {
+ uint16_t *p = spip->spd_rxptr;
+ *p++ = ssp->DR;
+ spip->spd_rxptr = p;
+ }
+ else {
+ uint8_t *p = spip->spd_rxptr;
+ *p++ = ssp->DR;
+ spip->spd_rxptr = p;
+ }
}
else
(void)ssp->DR;
diff --git a/os/hal/platforms/LPC13xx/spi_lld.h b/os/hal/platforms/LPC13xx/spi_lld.h index 47085c58b..153ce815b 100644 --- a/os/hal/platforms/LPC13xx/spi_lld.h +++ b/os/hal/platforms/LPC13xx/spi_lld.h @@ -35,7 +35,7 @@ /*===========================================================================*/
/**
- * @brief Hardware FIFO depth. + * @brief Hardware FIFO depth.
*/
#define LPC13xx_SSP_FIFO_DEPTH 8
@@ -140,7 +140,7 @@ #endif
/**
- * @brief SCK0 signal selector. + * @brief SCK0 signal selector.
*/
#if !defined(LPC13xx_SPI_SCK0_SELECTOR) || defined(__DOXYGEN__)
#define LPC13xx_SPI_SCK0_SELECTOR SCK0_IS_PIO2_11
@@ -251,7 +251,7 @@ struct SPIDriver { */
LPC_SSP_TypeDef *spd_ssp;
/**
- * @brief Number of bytes yet to be received. + * @brief Number of bytes yet to be received.
*/
uint32_t spd_rxcnt;
/**
|