aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-08-19 11:45:52 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-08-19 11:45:52 +0000
commitc3b9392212cb43a5496c80f3d2ab61ce4caf1dab (patch)
treec80a98cde7cba0c4d4d97e527211701a3f5dcd83 /os/hal/include
parentb4e2fca4a0ff8ed15625cdbf57cb4e8fe90c7647 (diff)
downloadChibiOS-c3b9392212cb43a5496c80f3d2ab61ce4caf1dab.tar.gz
ChibiOS-c3b9392212cb43a5496c80f3d2ab61ce4caf1dab.tar.bz2
ChibiOS-c3b9392212cb43a5496c80f3d2ab61ce4caf1dab.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6175 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include')
-rw-r--r--os/hal/include/i2c.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/os/hal/include/i2c.h b/os/hal/include/i2c.h
index b70767609..dfae26e64 100644
--- a/os/hal/include/i2c.h
+++ b/os/hal/include/i2c.h
@@ -93,6 +93,32 @@ typedef enum {
/*===========================================================================*/
/**
+ * @brief Wakes up the waiting thread notifying no errors.
+ *
+ * @param[in] i2cp pointer to the @p I2CDriver object
+ *
+ * @notapi
+ */
+#define _i2c_wakeup_isr(i2cp) do { \
+ osalSysLockFromISR(); \
+ osalThreadResumeI(&(i2cp)->thread, MSG_OK); \
+ osalSysUnlockFromISR(); \
+} while(0)
+
+/**
+ * @brief Wakes up the waiting thread notifying errors.
+ *
+ * @param[in] i2cp pointer to the @p I2CDriver object
+ *
+ * @notapi
+ */
+#define _i2c_wakeup_error_isr(i2cp) do { \
+ osalSysLockFromISR(); \
+ osalThreadResumeI(&(i2cp)->thread, MSG_RESET); \
+ osalSysUnlockFromISR(); \
+} while(0)
+
+/**
* @brief Wrap i2cMasterTransmitTimeout function with TIME_INFINITE timeout.
* @api
*/