aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/spi.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-05-07 08:11:03 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-05-07 08:11:03 +0000
commitbec915e05274a94f2b1a5e2443f04de826dd1f6e (patch)
treecec2044911766f5dc5a7bd8b8c9ffe0fe81734f8 /os/hal/include/spi.h
parent4afa0b98dff9eac6a94c104acf900e15147d2da3 (diff)
parentb43c71424d201583822b26d13d11f7e3634cb515 (diff)
downloadChibiOS-bec915e05274a94f2b1a5e2443f04de826dd1f6e.tar.gz
ChibiOS-bec915e05274a94f2b1a5e2443f04de826dd1f6e.tar.bz2
ChibiOS-bec915e05274a94f2b1a5e2443f04de826dd1f6e.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6916 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include/spi.h')
-rw-r--r--os/hal/include/spi.h22
1 files changed, 4 insertions, 18 deletions
diff --git a/os/hal/include/spi.h b/os/hal/include/spi.h
index 5e0fa9e53..48182e65d 100644
--- a/os/hal/include/spi.h
+++ b/os/hal/include/spi.h
@@ -64,10 +64,6 @@
/* Derived constants and error checks. */
/*===========================================================================*/
-#if SPI_USE_MUTUAL_EXCLUSION && !CH_USE_MUTEXES && !CH_USE_SEMAPHORES
-#error "SPI_USE_MUTUAL_EXCLUSION requires CH_USE_MUTEXES and/or CH_USE_SEMAPHORES"
-#endif
-
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
@@ -229,12 +225,7 @@ typedef enum {
*
* @notapi
*/
-#define _spi_wait_s(spip) { \
- chDbgAssert((spip)->thread == NULL, \
- "_spi_wait(), #1", "already waiting"); \
- (spip)->thread = chThdSelf(); \
- chSchGoSleepS(THD_STATE_SUSPENDED); \
-}
+#define _spi_wait_s(spip) osalThreadSuspendS(&(spip)->thread)
/**
* @brief Wakes up the waiting thread.
@@ -244,14 +235,9 @@ typedef enum {
* @notapi
*/
#define _spi_wakeup_isr(spip) { \
- chSysLockFromIsr(); \
- if ((spip)->thread != NULL) { \
- Thread *tp = (spip)->thread; \
- (spip)->thread = NULL; \
- tp->p_u.rdymsg = RDY_OK; \
- chSchReadyI(tp); \
- } \
- chSysUnlockFromIsr(); \
+ osalSysLockFromISR(); \
+ osalThreadResumeI(&(spip)->thread, MSG_OK); \
+ osalSysUnlockFromISR(); \
}
#else /* !SPI_USE_WAIT */
#define _spi_wait_s(spip)