diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/kernel/include/ch.h | 1 | ||||
-rw-r--r-- | os/kernel/include/chbsem.h | 22 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/port.dox | 14 |
3 files changed, 26 insertions, 11 deletions
diff --git a/os/kernel/include/ch.h b/os/kernel/include/ch.h index 3641c826f..d048b99b7 100644 --- a/os/kernel/include/ch.h +++ b/os/kernel/include/ch.h @@ -74,6 +74,7 @@ #include "chvt.h"
#include "chschd.h"
#include "chsem.h"
+#include "chbsem.h"
#include "chmtx.h"
#include "chcond.h"
#include "chevents.h"
diff --git a/os/kernel/include/chbsem.h b/os/kernel/include/chbsem.h index 238ee2607..5726cd350 100644 --- a/os/kernel/include/chbsem.h +++ b/os/kernel/include/chbsem.h @@ -94,7 +94,7 @@ typedef struct { *
* @init
*/
-#define chBSemInit(bsp, taken) chSemInit(&bsp->bs_sem, taken ? 0 : 1)
+#define chBSemInit(bsp, taken) chSemInit(&(bsp)->bs_sem, (taken) ? 0 : 1)
/**
* @brief Wait operation on the binary semaphore.
@@ -108,7 +108,7 @@ typedef struct { *
* @api
*/
-#define chBSemWait(bsp) chSemWait(&bsp->bs_sem)
+#define chBSemWait(bsp) chSemWait(&(bsp)->bs_sem)
/**
* @brief Wait operation on the binary semaphore.
@@ -122,7 +122,7 @@ typedef struct { *
* @sclass
*/
-#define chBSemWaitS(bsp) chSemWaitS(&bsp->bs_sem)
+#define chBSemWaitS(bsp) chSemWaitS(&(bsp)->bs_sem)
/**
* @brief Wait operation on the binary semaphore.
@@ -143,7 +143,7 @@ typedef struct { *
* @api
*/
-#define chBSemWaitTimeout(bsp, time) chSemWaitTimeout(&bsp->bs_sem, time)
+#define chBSemWaitTimeout(bsp, time) chSemWaitTimeout(&(bsp)->bs_sem, (time))
/**
* @brief Wait operation on the binary semaphore.
@@ -164,7 +164,7 @@ typedef struct { *
* @sclass
*/
-#define chBSemWaitTimeoutS(bsp, time) chSemWaitTimeoutS(&bsp->bs_sem, time)
+#define chBSemWaitTimeoutS(bsp, time) chSemWaitTimeoutS(&(bsp)->bs_sem, (time))
/**
* @brief Reset operation on the binary semaphore.
@@ -180,7 +180,7 @@ typedef struct { *
* @api
*/
-#define chBSemReset(bsp, taken) chSemReset(&bsp->bs_sem, taken ? 0 : 1)
+#define chBSemReset(bsp, taken) chSemReset(&(bsp)->bs_sem, (taken) ? 0 : 1)
/**
* @brief Reset operation on the binary semaphore.
@@ -197,7 +197,7 @@ typedef struct { *
* @iclass
*/
-#define chBSemResetI(bsp, taken) chSemResetI(&bsp->bs_sem, taken ? 0 : 1)
+#define chBSemResetI(bsp, taken) chSemResetI(&(bsp)->bs_sem, (taken) ? 0 : 1)
/**
* @brief Performs a signal operation on a binary semaphore.
@@ -208,7 +208,7 @@ typedef struct { */
#define chBSemSignal(bsp) { \
chSysLock(); \
- chBSemSignalI(bsp); \
+ chBSemSignalI((bsp)); \
chSchRescheduleS(); \
chSysUnlock(); \
}
@@ -222,8 +222,8 @@ typedef struct { * @iclass
*/
#define chBSemSignalI(bsp) { \
- if (bsp->bs_sem.s_cnt < 1) \
- chSemSignalI(&bsp->bs_sem); \
+ if ((bsp)->bs_sem.s_cnt < 1) \
+ chSemSignalI(&(bsp)->bs_sem); \
}
/**
@@ -236,7 +236,7 @@ typedef struct { *
* @iclass
*/
-#define chBSemGetStateI(bsp) ((bsp)->bs_sem.s_cnt > 0 ? 0 : 1)
+#define chBSemGetStateI(bsp) ((bsp)->bs_sem.s_cnt > 0 ? FALSE : TRUE)
#endif /* CH_USE_SEMAPHORES */
diff --git a/os/ports/GCC/ARMCMx/port.dox b/os/ports/GCC/ARMCMx/port.dox index 3556d3196..2f91f27f3 100644 --- a/os/ports/GCC/ARMCMx/port.dox +++ b/os/ports/GCC/ARMCMx/port.dox @@ -106,6 +106,20 @@ * stack where all the interrupts and exceptions are processed.
* - The threads are started in thread-privileged mode.
* - Interrupt nesting and the other advanced core/NVIC features are supported.
+ * - When using an STM32 one of the following macros must be defined on the
+ * compiler command line or in a file named <tt>board.h</tt>:
+ * - @p STM32F10X_LD
+ * - @p STM32F10X_MD
+ * - @p STM32F10X_HD
+ * - @p STM32F10X_CL
+ * .
+ * This is required in order to include a vectors table with the correct
+ * length for the STM32 model, see the file
+ * <tt>./os/ports/GCC/ARMCMx/STM32F10x/vectors.s</tt>.
+ * - The Cortex-Mx port is perfectly generic, support for more devices can be
+ * easily added by adding a subdirectory under <tt>./os/ports/GCC/ARMCMx</tt>
+ * and giving it the name of the new device, then copy the files from another
+ * device into the new directory and customize them for the new device.
* .
* @ingroup gcc
*/
|