diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-10 15:34:02 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-10 15:34:02 +0000 |
commit | 55d20075bd0f66b24292cb229be355a2369a9a61 (patch) | |
tree | 1b6d3e8aa2d735420bd620dfb87928b9c3bdb862 /os/common | |
parent | ade53fbc15fcf754ccb29e90f19cb2f921a90288 (diff) | |
download | ChibiOS-55d20075bd0f66b24292cb229be355a2369a9a61.tar.gz ChibiOS-55d20075bd0f66b24292cb229be355a2369a9a61.tar.bz2 ChibiOS-55d20075bd0f66b24292cb229be355a2369a9a61.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9066 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/common')
-rw-r--r-- | os/common/abstractions/nasa_osal/src/osapi.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/os/common/abstractions/nasa_osal/src/osapi.c b/os/common/abstractions/nasa_osal/src/osapi.c index c4b55ed14..bd6448d2a 100644 --- a/os/common/abstractions/nasa_osal/src/osapi.c +++ b/os/common/abstractions/nasa_osal/src/osapi.c @@ -483,19 +483,16 @@ int32 OS_TimerCreate(uint32 *timer_id, const char *timer_name, return OS_ERR_NO_FREE_IDS;
}
- chSysLock();
-
- strncpy(otp->name, timer_name, OS_MAX_API_NAME);
+ strncpy(otp->name, timer_name, OS_MAX_API_NAME - 1);
chVTObjectInit(&otp->vt);
otp->start_time = 0;
otp->interval_time = 0;
otp->callback_ptr = callback_ptr;
otp->is_free = 0; /* Note, last.*/
+ *timer_id = (uint32)otp;
*clock_accuracy = (uint32)(1000000 / CH_CFG_ST_FREQUENCY);
- chSysUnlock();
-
return OS_SUCCESS;
}
@@ -727,7 +724,7 @@ int32 OS_QueueCreate(uint32 *queue_id, const char *queue_name, }
/* Initializing object static parts.*/
- strncpy(oqp->name, queue_name, OS_MAX_API_NAME);
+ strncpy(oqp->name, queue_name, OS_MAX_API_NAME - 1);
chMBObjectInit(&oqp->mb, oqp->q_buffer, (size_t)queue_depth);
chSemObjectInit(&oqp->free_msgs, (cnt_t)queue_depth);
chPoolObjectInit(&oqp->messages, msgsize, NULL);
@@ -983,7 +980,7 @@ int32 OS_QueueGetInfo (uint32 queue_id, OS_queue_prop_t *queue_prop) { }
strncpy(queue_prop->name, oqp->name, OS_MAX_API_NAME - 1);
- queue_prop->creator = (uint32)0;
+ queue_prop->creator = (uint32)0;
/* Leaving the critical zone.*/
chSysRestoreStatusX(sts);
|