aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include
diff options
context:
space:
mode:
Diffstat (limited to 'os/rt/include')
-rw-r--r--os/rt/include/chbsem.h3
-rw-r--r--os/rt/include/chdebug.h6
-rw-r--r--os/rt/include/chdynamic.h1
-rw-r--r--os/rt/include/chschd.h16
-rw-r--r--os/rt/include/chsys.h6
-rw-r--r--os/rt/include/chvt.h13
6 files changed, 32 insertions, 13 deletions
diff --git a/os/rt/include/chbsem.h b/os/rt/include/chbsem.h
index 46c27483f..ca79665ba 100644
--- a/os/rt/include/chbsem.h
+++ b/os/rt/include/chbsem.h
@@ -267,8 +267,9 @@ static inline void chBSemSignalI(binary_semaphore_t *bsp) {
chDbgCheckClassI();
- if (bsp->bs_sem.s_cnt < 1)
+ if (bsp->bs_sem.s_cnt < 1) {
chSemSignalI(&bsp->bs_sem);
+ }
}
/**
diff --git a/os/rt/include/chdebug.h b/os/rt/include/chdebug.h
index 91ca172a9..728d9bf35 100644
--- a/os/rt/include/chdebug.h
+++ b/os/rt/include/chdebug.h
@@ -165,8 +165,9 @@ typedef struct {
*/
#if !defined(chDbgCheck)
#define chDbgCheck(c) do { \
- if (CH_DBG_ENABLE_CHECKS && !(c)) \
+ if (CH_DBG_ENABLE_CHECKS && !(c)) { \
chSysHalt(__func__); \
+ } \
} while (0)
#endif /* !defined(chDbgCheck) */
@@ -186,8 +187,9 @@ typedef struct {
*/
#if !defined(chDbgAssert)
#define chDbgAssert(c, r) do { \
- if (CH_DBG_ENABLE_ASSERTS && !(c)) \
+ if (CH_DBG_ENABLE_ASSERTS && !(c)) { \
chSysHalt(__func__); \
+ } \
} while (0)
#endif /* !defined(chDbgAssert) */
/** @} */
diff --git a/os/rt/include/chdynamic.h b/os/rt/include/chdynamic.h
index 8a9e05d1e..7a2e0c581 100644
--- a/os/rt/include/chdynamic.h
+++ b/os/rt/include/chdynamic.h
@@ -48,6 +48,7 @@
#if CH_CFG_USE_DYNAMIC && !CH_CFG_USE_WAITEXIT
#error "CH_CFG_USE_DYNAMIC requires CH_CFG_USE_WAITEXIT"
#endif
+
#if CH_CFG_USE_DYNAMIC && !CH_CFG_USE_HEAP && !CH_CFG_USE_MEMPOOLS
#error "CH_CFG_USE_DYNAMIC requires CH_CFG_USE_HEAP and/or CH_CFG_USE_MEMPOOLS"
#endif
diff --git a/os/rt/include/chschd.h b/os/rt/include/chschd.h
index b477f23e2..0679cadd5 100644
--- a/os/rt/include/chschd.h
+++ b/os/rt/include/chschd.h
@@ -613,6 +613,7 @@ static inline thread_t *list_remove(threads_list_t *tlp) {
thread_t *tp = tlp->p_next;
tlp->p_next = tp->p_next;
+
return tp;
}
@@ -638,6 +639,7 @@ static inline thread_t *queue_fifo_remove(threads_queue_t *tqp) {
thread_t *tp = tqp->p_next;
(tqp->p_next = tp->p_next)->p_prev = (thread_t *)tqp;
+
return tp;
}
@@ -645,6 +647,7 @@ static inline thread_t *queue_lifo_remove(threads_queue_t *tqp) {
thread_t *tp = tqp->p_prev;
(tqp->p_prev = tp->p_prev)->p_next = (thread_t *)tqp;
+
return tp;
}
@@ -652,6 +655,7 @@ static inline thread_t *queue_dequeue(thread_t *tp) {
tp->p_prev->p_next = tp->p_next;
tp->p_next->p_prev = tp->p_prev;
+
return tp;
}
#endif /* CH_CFG_OPTIMIZE_SPEED */
@@ -703,8 +707,9 @@ static inline void chSchDoYieldS(void) {
chDbgCheckClassS();
- if (chSchCanYieldS())
+ if (chSchCanYieldS()) {
chSchDoRescheduleBehind();
+ }
}
/**
@@ -720,16 +725,19 @@ static inline void chSchPreemption(void) {
#if CH_CFG_TIME_QUANTUM > 0
if (currp->p_preempt) {
- if (p1 > p2)
+ if (p1 > p2) {
chSchDoRescheduleAhead();
+ }
}
else {
- if (p1 >= p2)
+ if (p1 >= p2) {
chSchDoRescheduleBehind();
+ }
}
#else /* CH_CFG_TIME_QUANTUM == 0 */
- if (p1 >= p2)
+ if (p1 >= p2) {
chSchDoRescheduleAhead();
+ }
#endif /* CH_CFG_TIME_QUANTUM == 0 */
}
diff --git a/os/rt/include/chsys.h b/os/rt/include/chsys.h
index 12423b998..ce3ae530e 100644
--- a/os/rt/include/chsys.h
+++ b/os/rt/include/chsys.h
@@ -369,8 +369,9 @@ static inline void chSysUnlockFromISR(void) {
*/
static inline void chSysUnconditionalLock(void) {
- if (port_irq_enabled(port_get_irq_status()))
+ if (port_irq_enabled(port_get_irq_status())) {
chSysLock();
+ }
}
/**
@@ -382,8 +383,9 @@ static inline void chSysUnconditionalLock(void) {
*/
static inline void chSysUnconditionalUnlock(void) {
- if (!port_irq_enabled(port_get_irq_status()))
+ if (!port_irq_enabled(port_get_irq_status())) {
chSysUnlock();
+ }
}
#if !CH_CFG_NO_IDLE_THREAD || defined(__DOXYGEN__)
diff --git a/os/rt/include/chvt.h b/os/rt/include/chvt.h
index 7c6aff6cc..0a4b3a94c 100644
--- a/os/rt/include/chvt.h
+++ b/os/rt/include/chvt.h
@@ -248,6 +248,7 @@ static inline systime_t chVTGetSystemTime(void) {
chSysLock();
systime = chVTGetSystemTimeX();
chSysUnlock();
+
return systime;
}
@@ -350,8 +351,9 @@ static inline bool chVTIsArmedI(virtual_timer_t *vtp) {
*/
static inline void chVTResetI(virtual_timer_t *vtp) {
- if (chVTIsArmedI(vtp))
+ if (chVTIsArmedI(vtp)) {
chVTDoResetI(vtp);
+ }
}
/**
@@ -474,8 +476,9 @@ static inline void chVTDoTickI(void) {
/* The next element is outside the current time window, the loop
is stopped here.*/
- if ((vtp = ch.vtlist.vt_next)->vt_delta > delta)
+ if ((vtp = ch.vtlist.vt_next)->vt_delta > delta) {
break;
+ }
/* The "last time" becomes this timer's expiration time.*/
delta -= vtp->vt_delta;
@@ -500,10 +503,12 @@ static inline void chVTDoTickI(void) {
else {
/* Updating the alarm to the next deadline, deadline that must not be
closer in time than the minimum time delta.*/
- if (vtp->vt_delta >= CH_CFG_ST_TIMEDELTA)
+ if (vtp->vt_delta >= CH_CFG_ST_TIMEDELTA) {
port_timer_set_alarm(now + vtp->vt_delta);
- else
+ }
+ else {
port_timer_set_alarm(now + CH_CFG_ST_TIMEDELTA);
+ }
}
#endif /* CH_CFG_ST_TIMEDELTA > 0 */
}