diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-06-07 14:34:59 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-06-07 14:34:59 +0000 |
commit | 5cad241306f64d0a3c0f7829421e4bf8f4b18fbe (patch) | |
tree | ebbcad6d0cdb19fa5ef0bf5f6dc5cf80dfbdc4d1 /os/hal/include/spi.h | |
parent | 152f34a80c6ffe5fd17809732272823091b854e8 (diff) | |
parent | aec912f13f9aa85cd677353fa556f679c3832970 (diff) | |
download | ChibiOS-5cad241306f64d0a3c0f7829421e4bf8f4b18fbe.tar.gz ChibiOS-5cad241306f64d0a3c0f7829421e4bf8f4b18fbe.tar.bz2 ChibiOS-5cad241306f64d0a3c0f7829421e4bf8f4b18fbe.zip |
I2C. Merged code from trunk.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3036 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include/spi.h')
-rw-r--r-- | os/hal/include/spi.h | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/os/hal/include/spi.h b/os/hal/include/spi.h index ccf3e4e63..104dd9d3e 100644 --- a/os/hal/include/spi.h +++ b/os/hal/include/spi.h @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
@@ -120,7 +121,7 @@ typedef enum { * @iclass
*/
#define spiStartIgnoreI(spip, n) { \
- (spip)->spd_state = SPI_ACTIVE; \
+ (spip)->state = SPI_ACTIVE; \
spi_lld_ignore(spip, n); \
}
@@ -142,7 +143,7 @@ typedef enum { * @iclass
*/
#define spiStartExchangeI(spip, n, txbuf, rxbuf) { \
- (spip)->spd_state = SPI_ACTIVE; \
+ (spip)->state = SPI_ACTIVE; \
spi_lld_exchange(spip, n, txbuf, rxbuf); \
}
@@ -162,7 +163,7 @@ typedef enum { * @iclass
*/
#define spiStartSendI(spip, n, txbuf) { \
- (spip)->spd_state = SPI_ACTIVE; \
+ (spip)->state = SPI_ACTIVE; \
spi_lld_send(spip, n, txbuf); \
}
@@ -182,7 +183,7 @@ typedef enum { * @iclass
*/
#define spiStartReceiveI(spip, n, rxbuf) { \
- (spip)->spd_state = SPI_ACTIVE; \
+ (spip)->state = SPI_ACTIVE; \
spi_lld_receive(spip, n, rxbuf); \
}
@@ -215,9 +216,9 @@ typedef enum { * @notapi
*/
#define _spi_wait_s(spip) { \
- chDbgAssert((spip)->spd_thread == NULL, \
+ chDbgAssert((spip)->thread == NULL, \
"_spi_wait(), #1", "already waiting"); \
- (spip)->spd_thread = chThdSelf(); \
+ (spip)->thread = chThdSelf(); \
chSchGoSleepS(THD_STATE_SUSPENDED); \
}
@@ -229,9 +230,9 @@ typedef enum { * @notapi
*/
#define _spi_wakeup_isr(spip) { \
- if ((spip)->spd_thread != NULL) { \
- Thread *tp = (spip)->spd_thread; \
- (spip)->spd_thread = NULL; \
+ if ((spip)->thread != NULL) { \
+ Thread *tp = (spip)->thread; \
+ (spip)->thread = NULL; \
chSysLockFromIsr(); \
chSchReadyI(tp); \
chSysUnlockFromIsr(); \
@@ -257,12 +258,14 @@ typedef enum { * @notapi
*/
#define _spi_isr_code(spip) { \
- if ((spip)->spd_config->spc_endcb) { \
- (spip)->spd_state = SPI_COMPLETE; \
- (spip)->spd_config->spc_endcb(spip); \
- if ((spip)->spd_state == SPI_COMPLETE) \
- (spip)->spd_state = SPI_READY; \
+ if ((spip)->config->end_cb) { \
+ (spip)->state = SPI_COMPLETE; \
+ (spip)->config->end_cb(spip); \
+ if ((spip)->state == SPI_COMPLETE) \
+ (spip)->state = SPI_READY; \
} \
+ else \
+ (spip)->state = SPI_READY; \
_spi_wakeup_isr(spip); \
}
|