aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-03-03 10:01:59 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-03-03 10:01:59 +0000
commitc1783a234bc6e6f4f3443a11e4da4dc70a7867b5 (patch)
treec79e4658d7d299ecb4baa1e7676e35597949f730 /os
parente10bb0e48feb56384b29b969b41fc931ca000166 (diff)
downloadChibiOS-c1783a234bc6e6f4f3443a11e4da4dc70a7867b5.tar.gz
ChibiOS-c1783a234bc6e6f4f3443a11e4da4dc70a7867b5.tar.bz2
ChibiOS-c1783a234bc6e6f4f3443a11e4da4dc70a7867b5.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9007 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/common/abstractions/nasa_osal/src/osapi.c65
-rw-r--r--os/rt/src/chsys.c2
2 files changed, 65 insertions, 2 deletions
diff --git a/os/common/abstractions/nasa_osal/src/osapi.c b/os/common/abstractions/nasa_osal/src/osapi.c
index 7cf42b5a6..c68154be3 100644
--- a/os/common/abstractions/nasa_osal/src/osapi.c
+++ b/os/common/abstractions/nasa_osal/src/osapi.c
@@ -341,7 +341,7 @@ int32 OS_Milli2Ticks(uint32 milli_seconds) {
/*-- timers API -------------------------------------------------------------*/
/**
- * @brief Binary semaphore creation.
+ * @brief Timer creation.
*
* @param[out] timer_id pointer to a timer id variable
* @param[in] timer_name the timer name
@@ -562,6 +562,18 @@ int32 OS_TimerGetInfo(uint32 timer_id, OS_timer_prop_t *timer_prop) {
/*-- Queues API -------------------------------------------------------------*/
+/**
+ * @brief Queue creation.
+ *
+ * @param[out] queue_id pointer to a queue id variable
+ * @param[in] queue_name the queue name
+ * @param[in] queue_depth desired queue depth
+ * @param[in] data_size maximum message size
+ * @param[in] flags queue option flags
+ * @return An error code.
+ *
+ * @api
+ */
int32 OS_QueueCreate(uint32 *queue_id, const char *queue_name,
uint32 queue_depth, uint32 data_size, uint32 flags) {
osal_queue_t *oqp;
@@ -622,6 +634,14 @@ int32 OS_QueueCreate(uint32 *queue_id, const char *queue_name,
return OS_SUCCESS;
}
+/**
+ * @brief Queue deletion.
+ *
+ * @param[in] queue_id queue id variable
+ * @return An error code.
+ *
+ * @api
+ */
int32 OS_QueueDelete(uint32 queue_id) {
osal_queue_t *oqp = (osal_queue_t *)queue_id;
void *q_buffer, *mb_buffer;
@@ -662,6 +682,19 @@ int32 OS_QueueDelete(uint32 queue_id) {
return OS_SUCCESS;
}
+/**
+ * @brief Retrieves a message from the queue.
+ *
+ * @param[in] queue_id queue id variable
+ * @param[out] data message buffer pointer
+ * @param[in] size size of the buffer
+ * @param[out] size_copied size of the received message
+ * @param[in] timeout timeout in ticks, the special values @p OS_PEND
+ * and @p OS_CHECK can be specified
+ * @return An error code.
+ *
+ * @api
+ */
int32 OS_QueueGet(uint32 queue_id, void *data, uint32 size,
uint32 *size_copied, int32 timeout) {
osal_queue_t *oqp = (osal_queue_t *)queue_id;
@@ -722,6 +755,17 @@ int32 OS_QueueGet(uint32 queue_id, void *data, uint32 size,
return OS_SUCCESS;
}
+/**
+ * @brief Puts a message in the queue.
+ *
+ * @param[in] queue_id queue id variable
+ * @param[in] data message buffer pointer
+ * @param[in] size size of the message
+ * @param[in] flags operation flags
+ * @return An error code.
+ *
+ * @api
+ */
int32 OS_QueuePut(uint32 queue_id, void *data, uint32 size, uint32 flags) {
osal_queue_t *oqp = (osal_queue_t *)queue_id;
msg_t msgsts;
@@ -766,6 +810,15 @@ int32 OS_QueuePut(uint32 queue_id, void *data, uint32 size, uint32 flags) {
return OS_SUCCESS;
}
+/**
+ * @brief Retrieves a queue id by name.
+ *
+ * @param[out] queue_id pointer to a queue id variable
+ * @param[in] sem_name the queue name
+ * @return An error code.
+ *
+ * @api
+ */
int32 OS_QueueGetIdByName(uint32 *queue_id, const char *queue_name) {
osal_queue_t *oqp;
@@ -800,6 +853,16 @@ int32 OS_QueueGetIdByName(uint32 *queue_id, const char *queue_name) {
return OS_ERR_NAME_NOT_FOUND;
}
+/**
+ * @brief Returns queue information.
+ * @note This function can be safely called from timer callbacks or ISRs.
+ *
+ * @param[in] queue_id queue id variable
+ * @param[in] queue_prop queue properties
+ * @return An error code.
+ *
+ * @api
+ */
int32 OS_QueueGetInfo (uint32 queue_id, OS_queue_prop_t *queue_prop) {
osal_queue_t *oqp = (osal_queue_t *)queue_id;
syssts_t sts;
diff --git a/os/rt/src/chsys.c b/os/rt/src/chsys.c
index 850b9b5a9..6864bda9c 100644
--- a/os/rt/src/chsys.c
+++ b/os/rt/src/chsys.c
@@ -143,7 +143,7 @@ void chSysInit(void) {
#if CH_DBG_STATISTICS == TRUE
/* Starting measurement for this thread.*/
- chTMStartMeasurementX(&currp->p_stats);
+ chTMStartMeasurementX(&currp->stats);
#endif
/* It is alive now.*/