aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-03-06 16:17:41 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-03-06 16:17:41 +0000
commit9a77cde34ecdb532fec139d01458a66459ce0758 (patch)
treee64e2ab608268d8569b92fa09cc4d7aac100d5ad /os/rt
parent0678da6352ac484d560086a7f08b533c171b3ef1 (diff)
downloadChibiOS-9a77cde34ecdb532fec139d01458a66459ce0758.tar.gz
ChibiOS-9a77cde34ecdb532fec139d01458a66459ce0758.tar.bz2
ChibiOS-9a77cde34ecdb532fec139d01458a66459ce0758.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7719 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt')
-rw-r--r--os/rt/src/chdynamic.c3
-rw-r--r--os/rt/src/chregistry.c6
-rw-r--r--os/rt/src/chschd.c1
-rw-r--r--os/rt/src/chthreads.c6
4 files changed, 9 insertions, 7 deletions
diff --git a/os/rt/src/chdynamic.c b/os/rt/src/chdynamic.c
index 185a456b3..c2fca8534 100644
--- a/os/rt/src/chdynamic.c
+++ b/os/rt/src/chdynamic.c
@@ -93,7 +93,8 @@ void chThdRelease(thread_t *tp) {
chSysLock();
chDbgAssert(tp->p_refs > 0, "not referenced");
- refs = --tp->p_refs;
+ tp->p_refs--;
+ refs = tp->p_refs;
chSysUnlock();
/* If the references counter reaches zero and the thread is in its
diff --git a/os/rt/src/chregistry.c b/os/rt/src/chregistry.c
index bd49925af..76a5190b4 100644
--- a/os/rt/src/chregistry.c
+++ b/os/rt/src/chregistry.c
@@ -81,9 +81,9 @@ ROMCONST chdebug_t ch_debug = {
{'m', 'a', 'i', 'n'},
(uint8_t)0,
(uint8_t)sizeof (chdebug_t),
- (uint16_t)((CH_KERNEL_MAJOR << 11) |
- (CH_KERNEL_MINOR << 6) |
- (CH_KERNEL_PATCH << 0)),
+ (uint16_t)(((unsigned)CH_KERNEL_MAJOR << 11U) |
+ ((unsigned)CH_KERNEL_MINOR << 6U) |
+ ((unsigned)CH_KERNEL_PATCH << 0U)),
(uint8_t)sizeof (void *),
(uint8_t)sizeof (systime_t),
(uint8_t)sizeof (thread_t),
diff --git a/os/rt/src/chschd.c b/os/rt/src/chschd.c
index 3e7f84002..bcafb26b5 100644
--- a/os/rt/src/chschd.c
+++ b/os/rt/src/chschd.c
@@ -304,7 +304,6 @@ static void wakeup(void *p) {
(void) queue_dequeue(tp);
break;
default:
- chDbgAssert(false, "unexpected state");
break;
}
tp->p_u.rdymsg = MSG_TIMEOUT;
diff --git a/os/rt/src/chthreads.c b/os/rt/src/chthreads.c
index 3f5f35878..ee58694bc 100644
--- a/os/rt/src/chthreads.c
+++ b/os/rt/src/chthreads.c
@@ -219,7 +219,8 @@ thread_t *chThdCreateStatic(void *wsp, size_t size,
#endif
chSysLock();
- chSchWakeupS(tp = chThdCreateI(wsp, size, prio, pf, arg), MSG_OK);
+ tp = chThdCreateI(wsp, size, prio, pf, arg);
+ chSchWakeupS(tp, MSG_OK);
chSysUnlock();
return tp;
@@ -331,7 +332,8 @@ void chThdSleep(systime_t time) {
void chThdSleepUntil(systime_t time) {
chSysLock();
- if ((time -= chVTGetSystemTimeX()) > 0) {
+ time -= chVTGetSystemTimeX();
+ if (time > 0U) {
chThdSleepS(time);
}
chSysUnlock();