Fixed CMSIS RTOS wrapper.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14000 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
ad39bd7adb
commit
9bb2f4eadf
|
@ -181,8 +181,9 @@ osStatus osThreadSetPriority(osThreadId thread_id, osPriority newprio) {
|
||||||
|
|
||||||
/* Changing priority.*/
|
/* Changing priority.*/
|
||||||
#if CH_CFG_USE_MUTEXES
|
#if CH_CFG_USE_MUTEXES
|
||||||
if ((tp->prio == tp->realprio) || ((tprio_t)newprio > tp->prio))
|
if ((tp->hdr.pqueue.prio == tp->realprio) ||
|
||||||
tp->prio = (tprio_t)newprio;
|
((tprio_t)newprio > tp->hdr.pqueue.prio))
|
||||||
|
tp->hdr.pqueue.prio = (tprio_t)newprio;
|
||||||
tp->realprio = (tprio_t)newprio;
|
tp->realprio = (tprio_t)newprio;
|
||||||
#else
|
#else
|
||||||
tp->prio = (tprio_t)newprio;
|
tp->prio = (tprio_t)newprio;
|
||||||
|
@ -207,8 +208,8 @@ osStatus osThreadSetPriority(osThreadId thread_id, osPriority newprio) {
|
||||||
case CH_STATE_SNDMSGQ:
|
case CH_STATE_SNDMSGQ:
|
||||||
#endif
|
#endif
|
||||||
/* Re-enqueues tp with its new priority on the queue.*/
|
/* Re-enqueues tp with its new priority on the queue.*/
|
||||||
queue_prio_insert(queue_dequeue(tp),
|
ch_sch_prio_insert(ch_queue_dequeue(&tp->hdr.queue),
|
||||||
(threads_queue_t *)tp->u.wtobjp);
|
(ch_queue_t *)tp->u.wtobjp);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case CH_STATE_READY:
|
case CH_STATE_READY:
|
||||||
|
@ -217,7 +218,7 @@ osStatus osThreadSetPriority(osThreadId thread_id, osPriority newprio) {
|
||||||
tp->state = CH_STATE_CURRENT;
|
tp->state = CH_STATE_CURRENT;
|
||||||
#endif
|
#endif
|
||||||
/* Re-enqueues tp with its new priority on the ready list.*/
|
/* Re-enqueues tp with its new priority on the ready list.*/
|
||||||
chSchReadyI(queue_dequeue(tp));
|
chSchReadyI((thread_t *)ch_queue_dequeue(&tp->hdr.queue));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -556,7 +556,7 @@ static inline osStatus osThreadYield(void) {
|
||||||
*/
|
*/
|
||||||
static inline osPriority osThreadGetPriority(osThreadId thread_id) {
|
static inline osPriority osThreadGetPriority(osThreadId thread_id) {
|
||||||
|
|
||||||
return (osPriority)(NORMALPRIO - thread_id->prio);
|
return (osPriority)(NORMALPRIO - thread_id->hdr.pqueue.prio);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue