git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10137 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2017-04-02 10:10:03 +00:00
parent 25a9ad2c3a
commit 2000bff59b
2 changed files with 3 additions and 4 deletions

View File

@ -148,19 +148,16 @@ osStatus osThreadTerminate(osThreadId thread_id) {
* @note This can interfere with the priority inheritance mechanism. * @note This can interfere with the priority inheritance mechanism.
*/ */
osStatus osThreadSetPriority(osThreadId thread_id, osPriority newprio) { osStatus osThreadSetPriority(osThreadId thread_id, osPriority newprio) {
osPriority oldprio;
thread_t * tp = (thread_t *)thread_id; thread_t * tp = (thread_t *)thread_id;
chSysLock(); chSysLock();
/* Changing priority.*/ /* Changing priority.*/
#if CH_CFG_USE_MUTEXES #if CH_CFG_USE_MUTEXES
oldprio = (osPriority)tp->realprio;
if ((tp->prio == tp->realprio) || ((tprio_t)newprio > tp->prio)) if ((tp->prio == tp->realprio) || ((tprio_t)newprio > tp->prio))
tp->prio = (tprio_t)newprio; tp->prio = (tprio_t)newprio;
tp->realprio = (tprio_t)newprio; tp->realprio = (tprio_t)newprio;
#else #else
oldprio = tp->prio;
tp->prio = (tprio_t)newprio; tp->prio = (tprio_t)newprio;
#endif #endif
@ -202,7 +199,7 @@ osStatus osThreadSetPriority(osThreadId thread_id, osPriority newprio) {
chSysUnlock(); chSysUnlock();
return oldprio; return osOK;
} }
/** /**

View File

@ -157,6 +157,8 @@
- RT: Merged RT4. - RT: Merged RT4.
- NIL: Merged NIL2. - NIL: Merged NIL2.
- NIL: Added STM32F7 demo. - NIL: Added STM32F7 demo.
- HAL: Fixed osThreadSetPriority() returns old priority instead of a status
code (bug #823)(backported to 16.1.8).
- HAL: Fixed problem in rtcSTM32SetPeriodicWakeup() (bug #821)(backported - HAL: Fixed problem in rtcSTM32SetPeriodicWakeup() (bug #821)(backported
to 16.1.8). to 16.1.8).
- HAL: Fixed STM32 RTCv1 synchronization problem (bug #820)(backported - HAL: Fixed STM32 RTCv1 synchronization problem (bug #820)(backported