aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-03-07 19:29:14 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-03-07 19:29:14 +0000
commit61d31e7dc4bd9978aa886ae8bfbd2c3969fe8de6 (patch)
tree5a5fd374e230dcb1ea7bababb2cdcc258c5348a4 /os
parenta56487ecb91b086f35b637916cd05d33432eefc6 (diff)
downloadChibiOS-61d31e7dc4bd9978aa886ae8bfbd2c3969fe8de6.tar.gz
ChibiOS-61d31e7dc4bd9978aa886ae8bfbd2c3969fe8de6.tar.bz2
ChibiOS-61d31e7dc4bd9978aa886ae8bfbd2c3969fe8de6.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7733 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/rt/include/chqueues.h10
-rw-r--r--os/rt/src/chqueues.c28
2 files changed, 19 insertions, 19 deletions
diff --git a/os/rt/include/chqueues.h b/os/rt/include/chqueues.h
index 232501469..f07990629 100644
--- a/os/rt/include/chqueues.h
+++ b/os/rt/include/chqueues.h
@@ -129,7 +129,7 @@ typedef io_queue_t output_queue_t;
*/
#define _INPUTQUEUE_DATA(name, buffer, size, inotify, link) { \
_THREADS_QUEUE_DATA(name), \
- 0, \
+ 0U, \
(uint8_t *)(buffer), \
(uint8_t *)(buffer) + (size), \
(uint8_t *)(buffer), \
@@ -239,17 +239,17 @@ extern "C" {
qnotify_t infy, void *link);
void chIQResetI(input_queue_t *iqp);
msg_t chIQPutI(input_queue_t *iqp, uint8_t b);
- msg_t chIQGetTimeout(input_queue_t *iqp, systime_t time);
+ msg_t chIQGetTimeout(input_queue_t *iqp, systime_t timeout);
size_t chIQReadTimeout(input_queue_t *iqp, uint8_t *bp,
- size_t n, systime_t time);
+ size_t n, systime_t timeout);
void chOQObjectInit(output_queue_t *oqp, uint8_t *bp, size_t size,
qnotify_t onfy, void *link);
void chOQResetI(output_queue_t *oqp);
- msg_t chOQPutTimeout(output_queue_t *oqp, uint8_t b, systime_t time);
+ msg_t chOQPutTimeout(output_queue_t *oqp, uint8_t b, systime_t timeout);
msg_t chOQGetI(output_queue_t *oqp);
size_t chOQWriteTimeout(output_queue_t *oqp, const uint8_t *bp,
- size_t n, systime_t time);
+ size_t n, systime_t timeout);
#ifdef __cplusplus
}
#endif
diff --git a/os/rt/src/chqueues.c b/os/rt/src/chqueues.c
index 49bf49f24..1a9564a07 100644
--- a/os/rt/src/chqueues.c
+++ b/os/rt/src/chqueues.c
@@ -162,7 +162,7 @@ msg_t chIQPutI(input_queue_t *iqp, uint8_t b) {
* buffer or before entering the state @p CH_STATE_WTQUEUE.
*
* @param[in] iqp pointer to an @p input_queue_t structure
- * @param[in] time the number of ticks before the operation timeouts,
+ * @param[in] timeout the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout.
@@ -173,7 +173,7 @@ msg_t chIQPutI(input_queue_t *iqp, uint8_t b) {
*
* @api
*/
-msg_t chIQGetTimeout(input_queue_t *iqp, systime_t time) {
+msg_t chIQGetTimeout(input_queue_t *iqp, systime_t timeout) {
uint8_t b;
chSysLock();
@@ -182,7 +182,7 @@ msg_t chIQGetTimeout(input_queue_t *iqp, systime_t time) {
}
while (chIQIsEmptyI(iqp)) {
- msg_t msg = chThdEnqueueTimeoutS(&iqp->q_waiting, time);
+ msg_t msg = chThdEnqueueTimeoutS(&iqp->q_waiting, timeout);
if (msg < Q_OK) {
chSysUnlock();
return msg;
@@ -217,7 +217,7 @@ msg_t chIQGetTimeout(input_queue_t *iqp, systime_t time) {
* @param[out] bp pointer to the data buffer
* @param[in] n the maximum amount of data to be transferred, the
* value 0 is reserved
- * @param[in] time the number of ticks before the operation timeouts,
+ * @param[in] timeout the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout.
@@ -227,7 +227,7 @@ msg_t chIQGetTimeout(input_queue_t *iqp, systime_t time) {
* @api
*/
size_t chIQReadTimeout(input_queue_t *iqp, uint8_t *bp,
- size_t n, systime_t time) {
+ size_t n, systime_t timeout) {
qnotify_t nfy = iqp->q_notify;
size_t r = 0;
@@ -240,7 +240,7 @@ size_t chIQReadTimeout(input_queue_t *iqp, uint8_t *bp,
}
while (chIQIsEmptyI(iqp)) {
- if (chThdEnqueueTimeoutS(&iqp->q_waiting, time) != Q_OK) {
+ if (chThdEnqueueTimeoutS(&iqp->q_waiting, timeout) != Q_OK) {
chSysUnlock();
return r;
}
@@ -255,8 +255,8 @@ size_t chIQReadTimeout(input_queue_t *iqp, uint8_t *bp,
/*lint -restore*/
iqp->q_rdptr = iqp->q_buffer;
}
-
chSysUnlock(); /* Gives a preemption chance in a controlled point.*/
+
r++;
n--;
if (n == 0U) {
@@ -327,7 +327,7 @@ void chOQResetI(output_queue_t *oqp) {
*
* @param[in] oqp pointer to an @p output_queue_t structure
* @param[in] b the byte value to be written in the queue
- * @param[in] time the number of ticks before the operation timeouts,
+ * @param[in] timeout the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout.
@@ -339,11 +339,11 @@ void chOQResetI(output_queue_t *oqp) {
*
* @api
*/
-msg_t chOQPutTimeout(output_queue_t *oqp, uint8_t b, systime_t time) {
+msg_t chOQPutTimeout(output_queue_t *oqp, uint8_t b, systime_t timeout) {
chSysLock();
while (chOQIsFullI(oqp)) {
- msg_t msg = chThdEnqueueTimeoutS(&oqp->q_waiting, time);
+ msg_t msg = chThdEnqueueTimeoutS(&oqp->q_waiting, timeout);
if (msg < Q_OK) {
chSysUnlock();
return msg;
@@ -415,7 +415,7 @@ msg_t chOQGetI(output_queue_t *oqp) {
* @param[out] bp pointer to the data buffer
* @param[in] n the maximum amount of data to be transferred, the
* value 0 is reserved
- * @param[in] time the number of ticks before the operation timeouts,
+ * @param[in] timeout the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout.
@@ -425,7 +425,7 @@ msg_t chOQGetI(output_queue_t *oqp) {
* @api
*/
size_t chOQWriteTimeout(output_queue_t *oqp, const uint8_t *bp,
- size_t n, systime_t time) {
+ size_t n, systime_t timeout) {
qnotify_t nfy = oqp->q_notify;
size_t w = 0;
@@ -434,7 +434,7 @@ size_t chOQWriteTimeout(output_queue_t *oqp, const uint8_t *bp,
chSysLock();
while (true) {
while (chOQIsFullI(oqp)) {
- if (chThdEnqueueTimeoutS(&oqp->q_waiting, time) != Q_OK) {
+ if (chThdEnqueueTimeoutS(&oqp->q_waiting, timeout) != Q_OK) {
chSysUnlock();
return w;
}
@@ -452,8 +452,8 @@ size_t chOQWriteTimeout(output_queue_t *oqp, const uint8_t *bp,
if (nfy != NULL) {
nfy(oqp);
}
-
chSysUnlock(); /* Gives a preemption chance in a controlled point.*/
+
w++;
n--;
if (n == 0U) {