From 5e64a9fec2e17d008b9488faa027d2beaa130a88 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 5 Mar 2008 10:59:11 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@215 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/chdelta.c | 4 ++-- src/chevents.c | 32 ++++++++++++++++---------------- src/chinit.c | 2 +- src/chmsg.c | 16 ++++++++-------- src/chmtx.c | 10 +++++----- src/chqueues.c | 38 +++++++++++++++++++------------------- src/chschd.c | 12 ++++++------ src/chsem.c | 20 ++++++++++---------- src/chserial.c | 28 ++++++++++++++-------------- src/chsleep.c | 2 +- src/chthreads.c | 16 ++++++++-------- src/include/ch.h | 3 --- src/include/debug.h | 8 ++++---- src/include/delta.h | 12 ++++++------ src/include/events.h | 18 +++++++++--------- src/include/messages.h | 14 +++++--------- src/include/mutexes.h | 4 ++-- src/include/queues.h | 36 ++++++++++++++++++------------------ src/include/scheduler.h | 16 ++++++++-------- src/include/semaphores.h | 16 ++++++++-------- src/include/serial.h | 26 +++++++++++++------------- src/include/sleep.h | 4 ++-- src/include/threads.h | 34 +++++++++++++++++----------------- src/lib/evtimer.h | 2 +- src/templates/chtypes.h | 25 ++++++++++++++----------- 25 files changed, 197 insertions(+), 201 deletions(-) (limited to 'src') diff --git a/src/chdelta.c b/src/chdelta.c index 16dfac5bc..ef4493b79 100644 --- a/src/chdelta.c +++ b/src/chdelta.c @@ -33,7 +33,7 @@ DeltaList dlist; void chVTInit(void) { dlist.dl_next = dlist.dl_prev = (VirtualTimer *)&dlist; - dlist.dl_dtime = (t_time)-1; + dlist.dl_dtime = (systime_t)-1; } /** @@ -50,7 +50,7 @@ void chVTInit(void) { * @note Must be called with the interrupts disabled. * @note The associated function is invoked by an interrupt handler. */ -void chVTSetI(VirtualTimer *vtp, t_time time, t_vtfunc vtfunc, void *par) { +void chVTSetI(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par) { vtp->vt_par = par; vtp->vt_func = vtfunc; diff --git a/src/chevents.c b/src/chevents.c index 9fd2e4543..75ac8b322 100644 --- a/src/chevents.c +++ b/src/chevents.c @@ -31,11 +31,11 @@ * @param eid numeric identifier assigned to the Event Listener. The identifier * is used as index for the event callback function. * The value must range between zero and the size, in bit, of the - * \p t_eventid type minus one. + * \p eventid_t type minus one. * @note Multiple Event Listeners can use the same event identifier, the * listener will share the callback function. */ -void chEvtRegister(EventSource *esp, EventListener *elp, t_eventid eid) { +void chEvtRegister(EventSource *esp, EventListener *elp, eventid_t eid) { chSysLock(); @@ -77,7 +77,7 @@ void chEvtUnregister(EventSource *esp, EventListener *elp) { * Clears the pending events specified in the mask. * @param mask the events to be cleared */ -void chEvtClear(t_eventmask mask) { +void chEvtClear(eventmask_t mask) { chSysLock(); @@ -125,7 +125,7 @@ void chEvtSendI(EventSource *esp) { * event handler is specified then the handler is executed before returning. * @param ewmask mask of the events that should be served by the function, * \p ALL_EVENTS enables all the sources - * @param handlers an array of \p t_evhandler. The array must be + * @param handlers an array of \p evhandler_t. The array must be * have indexes from zero up the higher registered event * identifier. The array can be \p NULL or contain \p NULL * elements (no callbacks specified). @@ -136,8 +136,8 @@ void chEvtSendI(EventSource *esp) { * This means that Event Listeners with a lower event identifier have * an higher priority. */ -t_eventid chEvtWait(t_eventmask ewmask, - const t_evhandler handlers[]) { +eventid_t chEvtWait(eventmask_t ewmask, + const evhandler_t handlers[]) { return chEvtWaitTimeout(ewmask, handlers, TIME_INFINITE); } @@ -148,7 +148,7 @@ t_eventid chEvtWait(t_eventmask ewmask, * executed before returning. * @param ewmask mask of the events that should be served by the function, * \p ALL_EVENTS enables all the sources - * @param handlers an array of \p t_evhandler. The array must be + * @param handlers an array of \p evhandler_t. The array must be * have indexes from zero up the higher registered event * identifier. The array can be NULL or contain NULL elements * (no callback specified). @@ -162,11 +162,11 @@ t_eventid chEvtWait(t_eventmask ewmask, * @note The function is available only if the \p CH_USE_EVENTS_TIMEOUT * option is enabled in \p chconf.h. */ -t_eventid chEvtWaitTimeout(t_eventmask ewmask, - const t_evhandler handlers[], - t_time time) { - t_eventid i; - t_eventmask m; +eventid_t chEvtWaitTimeout(eventmask_t ewmask, + const evhandler_t handlers[], + systime_t time) { + eventid_t i; + eventmask_t m; chSysLock(); @@ -189,10 +189,10 @@ t_eventid chEvtWaitTimeout(t_eventmask ewmask, } #else /* !CH_USE_EVENTS_TIMEOUT */ -t_eventid chEvtWait(t_eventmask ewmask, - const t_evhandler handlers[]) { - t_eventid i; - t_eventmask m; +eventid_t chEvtWait(eventmask_t ewmask, + const evhandler_t handlers[]) { + eventid_t i; + eventmask_t m; chSysLock(); diff --git a/src/chinit.c b/src/chinit.c index 06ee2fc9b..213f8b4e8 100644 --- a/src/chinit.c +++ b/src/chinit.c @@ -55,7 +55,7 @@ void chSysInit(void) { * serve interrupts in its context while keeping the lowest energy saving * mode compatible with the system status. */ - chThdCreate(IDLEPRIO, 0, waIdleThread, sizeof(waIdleThread), (t_tfunc)_IdleThread, NULL); + chThdCreate(IDLEPRIO, 0, waIdleThread, sizeof(waIdleThread), (tfunc_t)_IdleThread, NULL); } /** diff --git a/src/chmsg.c b/src/chmsg.c index 91a6cc9fd..ae90c8264 100644 --- a/src/chmsg.c +++ b/src/chmsg.c @@ -32,7 +32,7 @@ * @param msg the message, it can be a pointer to a complex structure * @return the return message from \p chMsgRelease() */ -t_msg chMsgSend(Thread *tp, t_msg msg) { +msg_t chMsgSend(Thread *tp, msg_t msg) { chSysLock(); @@ -70,7 +70,7 @@ t_msg chMsgSend(Thread *tp, t_msg msg) { * a \p chMsgWait(). The use case is that the server thread is waiting * for both messages AND events while waiting into \p chEvtWait(). */ -t_msg chMsgSendWithEvent(Thread *tp, t_msg msg, EventSource *esp) { +msg_t chMsgSendWithEvent(Thread *tp, msg_t msg, EventSource *esp) { chSysLock(); @@ -103,8 +103,8 @@ t_msg chMsgSendWithEvent(Thread *tp, t_msg msg, EventSource *esp) { * you invoke \p chMsgRelease() because the sending thread is * suspended until then. */ -t_msg chMsgWait(void) { - t_msg msg; +msg_t chMsgWait(void) { + msg_t msg; chSysLock(); @@ -127,12 +127,12 @@ t_msg chMsgWait(void) { * suspended until then. Always remember that the message data is not * copied between the sender and the receiver, just a pointer is passed. */ -t_msg chMsgGet(void) { - t_msg msg; +msg_t chMsgGet(void) { + msg_t msg; chSysLock(); - msg = chMsgIsPendingI(currp) ? chMsgGetI(currp) : NULL; + msg = chMsgIsPendingI(currp) ? chMsgGetI(currp) : (msg_t)NULL; chSysUnlock(); return msg; @@ -149,7 +149,7 @@ t_msg chMsgGet(void) { * The condition is not checked in order to make this code as fast as * possible. */ -void chMsgRelease(t_msg msg) { +void chMsgRelease(msg_t msg) { chSysLock(); diff --git a/src/chmtx.c b/src/chmtx.c index b76902477..6d9e4e18f 100644 --- a/src/chmtx.c +++ b/src/chmtx.c @@ -106,8 +106,8 @@ void chMtxLockS(Mutex *mp) { * @param mp pointer to the \p Mutex structure * @return \p TRUE if the mutex was successfully acquired else \p FALSE */ -t_bool chMtxTryLock(Mutex *mp) { - t_bool b; +bool_t chMtxTryLock(Mutex *mp) { + bool_t b; chSysLock(); @@ -126,7 +126,7 @@ t_bool chMtxTryLock(Mutex *mp) { * @note This function must be called within a \p chSysLock() / \p chSysUnlock() * block. */ -t_bool chMtxTryLockS(Mutex *mp) { +bool_t chMtxTryLockS(Mutex *mp) { if (mp->m_owner != NULL) return FALSE; @@ -161,7 +161,7 @@ void chMtxUnlock(void) { /* * Recalculates the optimal thread priority by scanning the owned mutexes list. */ - t_prio newprio = currp->p_realprio; + tprio_t newprio = currp->p_realprio; mp = currp->p_mtxlist; while (mp != NULL) { if (chMtxQueueNotEmptyS(mp) && (mp->m_queue.p_next->p_prio > newprio)) @@ -201,7 +201,7 @@ void chMtxUnlockS(void) { /* * Recalculates the optimal thread priority by scanning the owned mutexes list. */ - t_prio newprio = currp->p_realprio; + tprio_t newprio = currp->p_realprio; mp = currp->p_mtxlist; while (mp != NULL) { if (chMtxQueueNotEmptyS(mp) && (mp->m_queue.p_next->p_prio > newprio)) diff --git a/src/chqueues.c b/src/chqueues.c index eafa50d42..ec456c5f1 100644 --- a/src/chqueues.c +++ b/src/chqueues.c @@ -35,7 +35,7 @@ * @param inotify pointer to a callback function that is invoked when * some data is read from the Queue. The value can be \p NULL. */ -void chIQInit(Queue *qp, uint8_t *buffer, t_size size, t_qnotify inotify) { +void chIQInit(Queue *qp, uint8_t *buffer, size_t size, qnotify_t inotify) { qp->q_buffer = qp->q_rdptr = qp->q_wrptr = buffer; qp->q_top = buffer + size; @@ -68,7 +68,7 @@ void chIQReset(Queue *qp) { * @note This function must be called with interrupts disabled or from an * interrupt handler. */ -t_msg chIQPutI(Queue *qp, uint8_t b) { +msg_t chIQPutI(Queue *qp, uint8_t b) { if (chIQIsFull(qp)) return Q_FULL; @@ -86,7 +86,7 @@ t_msg chIQPutI(Queue *qp, uint8_t b) { * @param qp pointer to a \p Queue structure * @return a byte from the queue or \p Q_RESET if the queue was reset */ -t_msg chIQGet(Queue *qp) { +msg_t chIQGet(Queue *qp) { uint8_t b; chSysLock(); @@ -119,9 +119,9 @@ t_msg chIQGet(Queue *qp) { * @note The function is available only if the \p CH_USE_QUEUES_TIMEOUT * option is enabled in \p chconf.h. */ -t_msg chIQGetTimeout(Queue *qp, t_time time) { +msg_t chIQGetTimeout(Queue *qp, systime_t time) { uint8_t b; - t_msg msg; + msg_t msg; chSysLock(); @@ -153,9 +153,9 @@ t_msg chIQGetTimeout(Queue *qp, t_time time) { * @note The function is not atomic, if you need atomicity it is suggested * to use a semaphore for mutual exclusion. */ -t_size chIQRead(Queue *qp, uint8_t *buffer, t_size n) { +size_t chIQRead(Queue *qp, uint8_t *buffer, size_t n) { - t_size r = 0; + size_t r = 0; while (n--) { chSysLock(); @@ -193,7 +193,7 @@ t_size chIQRead(Queue *qp, uint8_t *buffer, t_size n) { * @param onotify pointer to a callback function that is invoked when * some data is written in the Queue. The value can be \p NULL. */ -void chOQInit(Queue *qp, uint8_t *buffer, t_size size, t_qnotify onotify) { +void chOQInit(Queue *qp, uint8_t *buffer, size_t size, qnotify_t onotify) { qp->q_buffer = qp->q_rdptr = qp->q_wrptr = buffer; qp->q_top = buffer + size; @@ -211,7 +211,7 @@ void chOQReset(Queue *qp) { chSysLock(); qp->q_rdptr = qp->q_wrptr = qp->q_buffer; - chSemResetI(&qp->q_sem, (t_cnt)(qp->q_top - qp->q_buffer)); + chSemResetI(&qp->q_sem, (cnt_t)(qp->q_top - qp->q_buffer)); chSysUnlock(); } @@ -245,7 +245,7 @@ void chOQPut(Queue *qp, uint8_t b) { * @note This function must be called with interrupts disabled or from an * interrupt handler. */ -t_msg chOQGetI(Queue *qp) { +msg_t chOQGetI(Queue *qp) { uint8_t b; if (chOQIsEmpty(qp)) @@ -268,9 +268,9 @@ t_msg chOQGetI(Queue *qp) { * @note The function is not atomic, if you need atomicity it is suggested * to use a semaphore for mutual exclusion. */ -t_size chOQWrite(Queue *qp, uint8_t *buffer, t_size n) { +size_t chOQWrite(Queue *qp, uint8_t *buffer, size_t n) { - t_size w = 0; + size_t w = 0; while (n--) { chSysLock(); @@ -311,8 +311,8 @@ t_size chOQWrite(Queue *qp, uint8_t *buffer, t_size n) { * @param onotify pointer to a callback function that is invoked when * some data is written to the queue. The value can be \p NULL. */ -void chHDQInit(HalfDuplexQueue *qp, uint8_t *buffer, t_size size, - t_qnotify inotify, t_qnotify onotify) { +void chHDQInit(HalfDuplexQueue *qp, uint8_t *buffer, size_t size, + qnotify_t inotify, qnotify_t onotify) { qp->hdq_buffer = qp->hdq_rdptr = qp->hdq_wrptr = buffer; qp->hdq_top = buffer + size; @@ -328,7 +328,7 @@ void chHDQInit(HalfDuplexQueue *qp, uint8_t *buffer, t_size size, * @param qp pointer to a \p HalfDuplexQueue structure * @return the byte value or \p Q_RESET if the queue was reset */ -t_msg chHDQGetReceive(HalfDuplexQueue *qp) { +msg_t chHDQGetReceive(HalfDuplexQueue *qp) { uint8_t b; chSysLock(); @@ -363,9 +363,9 @@ t_msg chHDQGetReceive(HalfDuplexQueue *qp) { * @note The function is available only if the \p CH_USE_QUEUES_TIMEOUT * option is enabled in \p chconf.h. */ -t_msg chHDQGetReceiveTimeout(HalfDuplexQueue *qp, t_time time) { +msg_t chHDQGetReceiveTimeout(HalfDuplexQueue *qp, systime_t time) { uint8_t b; - t_msg msg; + msg_t msg; chSysLock(); @@ -431,7 +431,7 @@ void chHDQPutTransmit(HalfDuplexQueue *qp, uint8_t b) { * @note This function must be called with interrupts disabled or from an * interrupt handler. */ -t_msg chHDQGetTransmitI(HalfDuplexQueue *qp) { +msg_t chHDQGetTransmitI(HalfDuplexQueue *qp) { uint8_t b; if (!chHDQIsTransmitting(qp)) @@ -454,7 +454,7 @@ t_msg chHDQGetTransmitI(HalfDuplexQueue *qp) { * @note This function must be called with interrupts disabled or from an * interrupt handler. */ -t_msg chHDQPutReceiveI(HalfDuplexQueue *qp, uint8_t b) { +msg_t chHDQPutReceiveI(HalfDuplexQueue *qp, uint8_t b) { if (chHDQIsTransmitting(qp)) return Q_FULL; diff --git a/src/chschd.c b/src/chschd.c index 4f92f92ce..7a14df518 100644 --- a/src/chschd.c +++ b/src/chschd.c @@ -54,9 +54,9 @@ void chSchInit(void) { */ #ifdef CH_OPTIMIZE_SPEED /* NOTE: it is inlined in this module only.*/ -INLINE void chSchReadyI(Thread *tp, t_msg msg) { +INLINE void chSchReadyI(Thread *tp, msg_t msg) { #else -void chSchReadyI(Thread *tp, t_msg msg) { +void chSchReadyI(Thread *tp, msg_t msg) { #endif Thread *cp = rlist.r_queue.p_next; @@ -78,7 +78,7 @@ void chSchReadyI(Thread *tp, t_msg msg) { * @note The function must be called in the system mutex zone. * @note The function is not meant to be used in the user code directly. */ -void chSchGoSleepS(t_tstate newstate) { +void chSchGoSleepS(tstate_t newstate) { Thread *otp; (otp = currp)->p_state = newstate; @@ -108,7 +108,7 @@ static void wakeup(void *p) { * @note The function must be called in the system mutex zone. * @note The function is not meant to be used in the user code directly. */ -t_msg chSchGoSleepTimeoutS(t_tstate newstate, t_time time) { +msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) { VirtualTimer vt; chVTSetI(&vt, time, wakeup, currp); @@ -130,7 +130,7 @@ t_msg chSchGoSleepTimeoutS(t_tstate newstate, t_time time) { * @note It is equivalent to a \p chSchReadyI() followed by a * \p chSchRescheduleS() but much more efficient. */ -void chSchWakeupS(Thread *ntp, t_msg msg) { +void chSchWakeupS(Thread *ntp, msg_t msg) { if (ntp->p_prio <= currp->p_prio) chSchReadyI(ntp, msg); @@ -181,7 +181,7 @@ void chSchRescheduleS(void) { * @return \p TRUE if there is a thread that should go in running state * immediatly else \p FALSE. */ -t_bool chSchRescRequiredI(void) { +bool_t chSchRescRequiredI(void) { if (isempty(&rlist.r_queue)) return FALSE; diff --git a/src/chsem.c b/src/chsem.c index 47ea2fc50..cbbac8909 100644 --- a/src/chsem.c +++ b/src/chsem.c @@ -31,7 +31,7 @@ * @param n initial value of the semaphore counter. Must be non-negative. * @note Can be called with interrupts disabled or enabled. */ -void chSemInit(Semaphore *sp, t_cnt n) { +void chSemInit(Semaphore *sp, cnt_t n) { chDbgAssert(n >= 0, "chsem.c, chSemInit()"); fifo_init(&sp->s_queue); @@ -46,7 +46,7 @@ void chSemInit(Semaphore *sp, t_cnt n) { * instead than a signal because the \p chSemWait() will return * \p RDY_RESET instead of \p RDY_OK. */ -void chSemReset(Semaphore *sp, t_cnt n) { +void chSemReset(Semaphore *sp, cnt_t n) { chSysLock(); @@ -65,8 +65,8 @@ void chSemReset(Semaphore *sp, t_cnt n) { * \p RDY_RESET instead of \p RDY_OK. * @note This function does not reschedule. */ -void chSemResetI(Semaphore *sp, t_cnt n) { - t_cnt cnt; +void chSemResetI(Semaphore *sp, cnt_t n) { + cnt_t cnt; chDbgAssert(n >= 0, "chsem.c, chSemResetI()"); cnt = sp->s_cnt; @@ -80,8 +80,8 @@ void chSemResetI(Semaphore *sp, t_cnt n) { * @param sp pointer to a \p Semaphore structure * @return the function can return \p RDY_OK or \p RDY_RESET. */ -t_msg chSemWait(Semaphore *sp) { - t_msg msg; +msg_t chSemWait(Semaphore *sp) { + msg_t msg; chSysLock(); @@ -98,7 +98,7 @@ t_msg chSemWait(Semaphore *sp) { * @note This function must be called with interrupts disabled. * @note This function cannot be called by an interrupt handler. */ -t_msg chSemWaitS(Semaphore *sp) { +msg_t chSemWaitS(Semaphore *sp) { if (--sp->s_cnt < 0) { fifo_insert(currp, &sp->s_queue); @@ -116,8 +116,8 @@ t_msg chSemWaitS(Semaphore *sp) { * @param time the number of ticks before the operation fails * @return the function can return \p RDY_OK, \p RDY_TIMEOUT or \p RDY_RESET. */ -t_msg chSemWaitTimeout(Semaphore *sp, t_time time) { - t_msg msg; +msg_t chSemWaitTimeout(Semaphore *sp, systime_t time) { + msg_t msg; chSysLock(); @@ -137,7 +137,7 @@ t_msg chSemWaitTimeout(Semaphore *sp, t_time time) { * @note The function is available only if the \p CH_USE_SEMAPHORES_TIMEOUT * option is enabled in \p chconf.h. */ -t_msg chSemWaitTimeoutS(Semaphore *sp, t_time time) { +msg_t chSemWaitTimeoutS(Semaphore *sp, systime_t time) { if (--sp->s_cnt < 0) { fifo_insert(currp, &sp->s_queue); diff --git a/src/chserial.c b/src/chserial.c index 8ed682cdf..b57dc96a4 100644 --- a/src/chserial.c +++ b/src/chserial.c @@ -40,8 +40,8 @@ * some data is written in the Queue. The value can be \p NULL. */ void chFDDInit(FullDuplexDriver *sd, - uint8_t *ib, t_size isize, t_qnotify inotify, - uint8_t *ob, t_size osize, t_qnotify onotify) { + uint8_t *ib, size_t isize, qnotify_t inotify, + uint8_t *ob, size_t osize, qnotify_t onotify) { chIQInit(&sd->sd_iqueue, ib, isize, inotify); chEvtInit(&sd->sd_ievent); @@ -74,9 +74,9 @@ void chFDDIncomingDataI(FullDuplexDriver *sd, uint8_t b) { * queue is empty (the lower driver usually disables the interrupt * source when this happens). */ -t_msg chFDDRequestDataI(FullDuplexDriver *sd) { +msg_t chFDDRequestDataI(FullDuplexDriver *sd) { - t_msg b = chOQGetI(&sd->sd_oqueue); + msg_t b = chOQGetI(&sd->sd_oqueue); if (b < Q_OK) chEvtSendI(&sd->sd_oevent); return b; @@ -88,7 +88,7 @@ t_msg chFDDRequestDataI(FullDuplexDriver *sd) { * @param sd pointer to a \p FullDuplexDriver structure * @param mask condition flags to be added to the mask */ -void chFDDAddFlagsI(FullDuplexDriver *sd, t_dflags mask) { +void chFDDAddFlagsI(FullDuplexDriver *sd, dflags_t mask) { sd->sd_flags |= mask; chEvtSendI(&sd->sd_sevent); @@ -100,8 +100,8 @@ void chFDDAddFlagsI(FullDuplexDriver *sd, t_dflags mask) { * @return the condition flags modified since last time this function was * invoked */ -t_dflags chFDDGetAndClearFlags(FullDuplexDriver *sd) { - t_dflags mask; +dflags_t chFDDGetAndClearFlags(FullDuplexDriver *sd) { + dflags_t mask; mask = sd->sd_flags; sd->sd_flags = SD_NO_ERROR; @@ -122,8 +122,8 @@ t_dflags chFDDGetAndClearFlags(FullDuplexDriver *sd) { * @param onotify pointer to a callback function that is invoked when * some data is written in the queue. The value can be \p NULL. */ -void chHDDInit(HalfDuplexDriver *sd, uint8_t *b, t_size size, - t_qnotify inotify, t_qnotify onotify) { +void chHDDInit(HalfDuplexDriver *sd, uint8_t *b, size_t size, + qnotify_t inotify, qnotify_t onotify) { chHDQInit(&sd->sd_queue, b, size, inotify, onotify); chEvtInit(&sd->sd_ievent); @@ -155,9 +155,9 @@ void chHDDIncomingDataI(HalfDuplexDriver *sd, uint8_t b) { * queue is empty (the lower driver usually disables the interrupt * source when this happens). */ -t_msg chHDDRequestDataI(HalfDuplexDriver *sd) { +msg_t chHDDRequestDataI(HalfDuplexDriver *sd) { - t_msg b = chHDQGetTransmitI(&sd->sd_queue); + msg_t b = chHDQGetTransmitI(&sd->sd_queue); if (b < Q_OK) chEvtSendI(&sd->sd_oevent); return b; @@ -169,7 +169,7 @@ t_msg chHDDRequestDataI(HalfDuplexDriver *sd) { * @param sd pointer to a \p HalfDuplexDriver structure * @param mask condition flags to be added to the mask */ -void chHDDAddFlagsI(HalfDuplexDriver *sd, t_dflags mask) { +void chHDDAddFlagsI(HalfDuplexDriver *sd, dflags_t mask) { sd->sd_flags |= mask; chEvtSendI(&sd->sd_sevent); @@ -181,8 +181,8 @@ void chHDDAddFlagsI(HalfDuplexDriver *sd, t_dflags mask) { * @return the condition flags modified since last time this function was * invoked */ -t_dflags chHDDGetAndClearFlags(HalfDuplexDriver *sd) { - t_dflags mask; +dflags_t chHDDGetAndClearFlags(HalfDuplexDriver *sd) { + dflags_t mask; mask = sd->sd_flags; sd->sd_flags = SD_NO_ERROR; diff --git a/src/chsleep.c b/src/chsleep.c index 9dad520c7..859333b79 100644 --- a/src/chsleep.c +++ b/src/chsleep.c @@ -29,7 +29,7 @@ * Suspends the invoking thread for the specified time. * @param time the system ticks number */ -void chThdSleep(t_time time) { +void chThdSleep(systime_t time) { chSysLock(); diff --git a/src/chthreads.c b/src/chthreads.c index 26a0cd1d9..1dcda4597 100644 --- a/src/chthreads.c +++ b/src/chthreads.c @@ -27,8 +27,8 @@ /* * Initializes a thread structure. */ -void _InitThread(t_prio prio, t_tmode mode, Thread *tp) { - static t_tid nextid = 0; +void _InitThread(tprio_t prio, tmode_t mode, Thread *tp) { + static tid_t nextid = 0; tp->p_tid = nextid++; tp->p_flags = mode; @@ -89,8 +89,8 @@ static void memfill(uint8_t *p, uint32_t n, uint8_t v) { * @note A thread can terminate by calling \p chThdExit() or by simply * returning from its main function. */ -Thread *chThdCreate(t_prio prio, t_tmode mode, void *workspace, - t_size wsize, t_tfunc pf, void *arg) { +Thread *chThdCreate(tprio_t prio, tmode_t mode, void *workspace, + size_t wsize, tfunc_t pf, void *arg) { Thread *tp = workspace; chDbgAssert((wsize > UserStackSize(0)) && (prio <= HIGHPRIO) && @@ -121,7 +121,7 @@ Thread *chThdCreate(t_prio prio, t_tmode mode, void *workspace, * Changes the thread priority, reschedules if necessary. * @param newprio the new priority of the invoking thread */ -void chThdSetPriority(t_prio newprio) { +void chThdSetPriority(tprio_t newprio) { chDbgAssert(newprio <= HIGHPRIO, "chthreads.c, chThdSetPriority()") chSysLock(); @@ -211,7 +211,7 @@ void chThdTerminate(Thread *tp) { * @param msg the thread exit code. The code can be retrieved by using * \p chThdWait(). */ -void chThdExit(t_msg msg) { +void chThdExit(msg_t msg) { chSysLock(); @@ -235,8 +235,8 @@ void chThdExit(t_msg msg) { * @note The function is available only if the \p CH_USE_WAITEXIT * option is enabled in \p chconf.h. */ -t_msg chThdWait(Thread *tp) { - t_msg msg; +msg_t chThdWait(Thread *tp) { + msg_t msg; chSysLock(); diff --git a/src/include/ch.h b/src/include/ch.h index 52d3dd772..4f729a450 100644 --- a/src/include/ch.h +++ b/src/include/ch.h @@ -100,9 +100,6 @@ #ifndef TRUE #define TRUE 1 #endif -#ifndef NULL -#define NULL 0 -#endif #ifdef __cplusplus extern "C" { diff --git a/src/include/debug.h b/src/include/debug.h index 226d80dd6..f902e1ebb 100644 --- a/src/include/debug.h +++ b/src/include/debug.h @@ -38,13 +38,13 @@ typedef struct { void *cse_wtobjp; - t_time cse_time; - UWORD16 cse_state: 4; - UWORD16 cse_tid: 12; + systime_t cse_time; + uint16_t cse_state: 4; + uint16_t cse_tid: 12; } CtxSwcEvent; typedef struct { - t_size tb_size; + size_t tb_size; CtxSwcEvent *tb_ptr; CtxSwcEvent tb_buffer[TRACE_BUFFER_SIZE]; } TraceBuffer; diff --git a/src/include/delta.h b/src/include/delta.h index 4365eb482..1f7a584f0 100644 --- a/src/include/delta.h +++ b/src/include/delta.h @@ -28,7 +28,7 @@ #ifdef CH_USE_VIRTUAL_TIMERS /** Virtual Timer callback function.*/ -typedef void (*t_vtfunc)(void *); +typedef void (*vtfunc_t)(void *); typedef struct VirtualTimer VirtualTimer; @@ -41,10 +41,10 @@ struct VirtualTimer { /** Previous timer in the delta list.*/ VirtualTimer *vt_prev; /** Time delta before timeout.*/ - t_time vt_dtime; + systime_t vt_dtime; /** Timer callback function pointer. The pointer is reset to zero after the callback is invoked.*/ - t_vtfunc vt_func; + vtfunc_t vt_func; /** Timer callback function parameter.*/ void *vt_par; }; @@ -63,7 +63,7 @@ typedef struct { /** Last timer in the list.*/ VirtualTimer *dl_prev; /** Not used but it must be set to /p MAXDELTA.*/ - t_time dl_dtime; + systime_t dl_dtime; } DeltaList; extern DeltaList dlist; @@ -74,7 +74,7 @@ extern DeltaList dlist; \ --dlist.dl_next->vt_dtime; \ while (!(vtp = dlist.dl_next)->vt_dtime) { \ - t_vtfunc fn = vtp->vt_func; \ + vtfunc_t fn = vtp->vt_func; \ vtp->vt_func = 0; \ (vtp->vt_next->vt_prev = (VirtualTimer *)&dlist)->vt_next = vtp->vt_next; \ fn(vtp->vt_par); \ @@ -91,7 +91,7 @@ extern DeltaList dlist; extern "C" { #endif void chVTInit(void); - void chVTSetI(VirtualTimer *vtp, t_time time, t_vtfunc vtfunc, void *par); + void chVTSetI(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par); void chVTResetI(VirtualTimer *vtp); #ifdef __cplusplus } diff --git a/src/include/events.h b/src/include/events.h index 78b695910..8cfb0109f 100644 --- a/src/include/events.h +++ b/src/include/events.h @@ -41,7 +41,7 @@ struct EventListener { /** Thread interested in the Event Source.*/ Thread *el_listener; /** Event identifier associated by the thread to the Event Source.*/ - t_eventid el_id; + eventid_t el_id; }; /** @@ -74,22 +74,22 @@ typedef struct EventSource { /** Event Handler callback function.*/ -typedef void (*t_evhandler)(t_eventid); +typedef void (*evhandler_t)(eventid_t); #ifdef __cplusplus extern "C" { #endif - void chEvtRegister(EventSource *esp, EventListener *elp, t_eventid eid); + void chEvtRegister(EventSource *esp, EventListener *elp, eventid_t eid); void chEvtUnregister(EventSource *esp, EventListener *elp); - void chEvtClear(t_eventmask mask); + void chEvtClear(eventmask_t mask); void chEvtSend(EventSource *esp); void chEvtSendI(EventSource *esp); - t_eventid chEvtWait(t_eventmask ewmask, - const t_evhandler handlers[]); + eventid_t chEvtWait(eventmask_t ewmask, + const evhandler_t handlers[]); #ifdef CH_USE_EVENTS_TIMEOUT - t_eventid chEvtWaitTimeout(t_eventmask ewmask, - const t_evhandler handlers[], - t_time time); + eventid_t chEvtWaitTimeout(eventmask_t ewmask, + const evhandler_t handlers[], + systime_t time); #endif #ifdef __cplusplus } diff --git a/src/include/messages.h b/src/include/messages.h index a5e88c267..ae6ae9bb3 100644 --- a/src/include/messages.h +++ b/src/include/messages.h @@ -42,17 +42,13 @@ #ifdef __cplusplus extern "C" { #endif - t_msg chMsgSend(Thread *tp, t_msg msg); - t_msg chMsgWait(void); - t_msg chMsgGet(void); - void chMsgRelease(t_msg msg); + msg_t chMsgSend(Thread *tp, msg_t msg); + msg_t chMsgWait(void); + msg_t chMsgGet(void); + void chMsgRelease(msg_t msg); #ifdef CH_USE_MESSAGES_EVENT - t_msg chMsgSendWithEvent(Thread *tp, t_msg msg, EventSource *esp); -#endif - -#ifdef CH_USE_MESSAGES_TIMEOUT - t_msg chMsgSendTimeout(Thread *tp, t_msg msg, t_time time); + msg_t chMsgSendWithEvent(Thread *tp, msg_t msg, EventSource *esp); #endif #ifdef __cplusplus } diff --git a/src/include/mutexes.h b/src/include/mutexes.h index 022e62dea..9e9c704cc 100644 --- a/src/include/mutexes.h +++ b/src/include/mutexes.h @@ -44,8 +44,8 @@ extern "C" { void chMtxInit(Mutex *mp); void chMtxLock(Mutex *mp); void chMtxLockS(Mutex *mp); - t_bool chMtxTryLock(Mutex *mp); - t_bool chMtxTryLockS(Mutex *mp); + bool_t chMtxTryLock(Mutex *mp); + bool_t chMtxTryLockS(Mutex *mp); void chMtxUnlock(void); void chMtxUnlockS(void); void chMtxUnlockAll(void); diff --git a/src/include/queues.h b/src/include/queues.h index a28539fd5..5c480e8cf 100644 --- a/src/include/queues.h +++ b/src/include/queues.h @@ -26,7 +26,7 @@ #define _QUEUES_H_ /** Queue notification callback type.*/ -typedef void (*t_qnotify)(void); +typedef void (*qnotify_t)(void); /** Returned by the queue functions if the operation is successful.*/ #define Q_OK RDY_OK @@ -56,7 +56,7 @@ typedef struct { /** Counter semaphore.*/ Semaphore q_sem; /** Data notification callback.*/ - t_qnotify q_notify; + qnotify_t q_notify; } Queue; /** Returns the queue's buffer size.*/ @@ -91,24 +91,24 @@ extern "C" { * Input Queues functions. An Input Queue is usually written into by an * interrupt handler and read from a thread. */ - void chIQInit(Queue *qp, uint8_t *buffer, t_size size, t_qnotify inotify); + void chIQInit(Queue *qp, uint8_t *buffer, size_t size, qnotify_t inotify); void chIQReset(Queue *qp); - t_msg chIQPutI(Queue *qp, uint8_t b); - t_msg chIQGet(Queue *qp); - t_size chIQRead(Queue *qp, uint8_t *buffer, t_size n); + msg_t chIQPutI(Queue *qp, uint8_t b); + msg_t chIQGet(Queue *qp); + size_t chIQRead(Queue *qp, uint8_t *buffer, size_t n); #ifdef CH_USE_QUEUES_TIMEOUT - t_msg chIQGetTimeout(Queue *qp, t_time time); + msg_t chIQGetTimeout(Queue *qp, systime_t time); #endif /* * Output Queues functions. An Output Queue is usually written into by a * thread and read from an interrupt handler. */ - void chOQInit(Queue *queue, uint8_t *buffer, t_size size, t_qnotify onotify); + void chOQInit(Queue *queue, uint8_t *buffer, size_t size, qnotify_t onotify); void chOQReset(Queue *queue); void chOQPut(Queue *queue, uint8_t b); - t_msg chOQGetI(Queue *queue); - t_size chOQWrite(Queue *queue, uint8_t *buffer, t_size n); + msg_t chOQGetI(Queue *queue); + size_t chOQWrite(Queue *queue, uint8_t *buffer, size_t n); #ifdef __cplusplus } #endif @@ -132,9 +132,9 @@ typedef struct { /** Output counter semaphore.*/ Semaphore hdq_osem; /** Input data notification callback.*/ - t_qnotify hdq_inotify; + qnotify_t hdq_inotify; /** Output data notification callback.*/ - t_qnotify hdq_onotify; + qnotify_t hdq_onotify; } HalfDuplexQueue; /** Returns the queue's buffer size.*/ @@ -164,14 +164,14 @@ typedef struct { #ifdef __cplusplus extern "C" { #endif - void chHDQInit(HalfDuplexQueue *qp, uint8_t *buffer, t_size size, - t_qnotify inotify, t_qnotify onotify); - t_msg chHDQGetReceive(HalfDuplexQueue *qp); + void chHDQInit(HalfDuplexQueue *qp, uint8_t *buffer, size_t size, + qnotify_t inotify, qnotify_t onotify); + msg_t chHDQGetReceive(HalfDuplexQueue *qp); void chHDQPutTransmit(HalfDuplexQueue *qp, uint8_t b); - t_msg chHDQGetTransmitI(HalfDuplexQueue *qp); - t_msg chHDQPutReceiveI(HalfDuplexQueue *qp, uint8_t b); + msg_t chHDQGetTransmitI(HalfDuplexQueue *qp); + msg_t chHDQPutReceiveI(HalfDuplexQueue *qp, uint8_t b); #ifdef CH_USE_QUEUES_TIMEOUT - t_msg chHDQGetReceiveTimeout(HalfDuplexQueue *qp, t_time time); + msg_t chHDQGetReceiveTimeout(HalfDuplexQueue *qp, systime_t time); #endif #ifdef __cplusplus } diff --git a/src/include/scheduler.h b/src/include/scheduler.h index f238002a1..0cd4bff7a 100644 --- a/src/include/scheduler.h +++ b/src/include/scheduler.h @@ -39,13 +39,13 @@ */ typedef struct { ThreadsQueue r_queue; - t_prio r_prio; - t_cnt r_preempt; + tprio_t r_prio; + cnt_t r_preempt; #ifndef CH_CURRP_REGISTER_CACHE Thread *r_current; #endif #ifdef CH_USE_SYSTEMTIME - volatile t_time r_stime; + volatile systime_t r_stime; #endif } ReadyList; @@ -58,13 +58,13 @@ extern ReadyList rlist; extern "C" { #endif void chSchInit(void); - void chSchReadyI(Thread *tp, t_msg msg); - void chSchGoSleepS(t_tstate newstate); - t_msg chSchGoSleepTimeoutS(t_tstate newstate, t_time time); - void chSchWakeupS(Thread *tp, t_msg msg); + void chSchReadyI(Thread *tp, msg_t msg); + void chSchGoSleepS(tstate_t newstate); + msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time); + void chSchWakeupS(Thread *tp, msg_t msg); void chSchDoRescheduleI(void); void chSchRescheduleS(void); - t_bool chSchRescRequiredI(void); + bool_t chSchRescRequiredI(void); #ifdef __cplusplus } #endif diff --git a/src/include/semaphores.h b/src/include/semaphores.h index 0457da81d..c894629a4 100644 --- a/src/include/semaphores.h +++ b/src/include/semaphores.h @@ -34,20 +34,20 @@ typedef struct { /** Queue of the threads sleeping on this Semaphore.*/ ThreadsQueue s_queue; /** The Semaphore counter.*/ - t_cnt s_cnt; + cnt_t s_cnt; } Semaphore; #ifdef __cplusplus extern "C" { #endif - void chSemInit(Semaphore *sp, t_cnt n); - void chSemReset(Semaphore *sp, t_cnt n); - void chSemResetI(Semaphore *sp, t_cnt n); - t_msg chSemWait(Semaphore *sp); - t_msg chSemWaitS(Semaphore *sp); + void chSemInit(Semaphore *sp, cnt_t n); + void chSemReset(Semaphore *sp, cnt_t n); + void chSemResetI(Semaphore *sp, cnt_t n); + msg_t chSemWait(Semaphore *sp); + msg_t chSemWaitS(Semaphore *sp); #ifdef CH_USE_SEMAPHORES_TIMEOUT - t_msg chSemWaitTimeout(Semaphore *sp, t_time time); - t_msg chSemWaitTimeoutS(Semaphore *sp, t_time time); + msg_t chSemWaitTimeout(Semaphore *sp, systime_t time); + msg_t chSemWaitTimeoutS(Semaphore *sp, systime_t time); #endif void chSemSignal(Semaphore *sp); void chSemSignalI(Semaphore *sp); diff --git a/src/include/serial.h b/src/include/serial.h index 4edef1e19..4b7b02b7c 100644 --- a/src/include/serial.h +++ b/src/include/serial.h @@ -41,7 +41,7 @@ #define SD_BREAK_DETECTED 32 /** Serial Driver condition flags type.*/ -typedef uint16_t t_dflags; +typedef uint16_t dflags_t; #ifdef CH_USE_SERIAL_FULLDUPLEX @@ -66,7 +66,7 @@ typedef struct { /** I/O driver status flags. This field should not be read directly but * the \p chFDDGetAndClearFlags() funtion should be used instead.*/ - t_dflags sd_flags; + dflags_t sd_flags; /** Status Change \p EventSource. This event is generated when a * condition flag was changed.*/ EventSource sd_sevent; @@ -76,12 +76,12 @@ typedef struct { extern "C" { #endif void chFDDInit(FullDuplexDriver *sd, - uint8_t *ib, t_size isize, t_qnotify inotify, - uint8_t *ob, t_size osize, t_qnotify onotify); + uint8_t *ib, size_t isize, qnotify_t inotify, + uint8_t *ob, size_t osize, qnotify_t onotify); void chFDDIncomingDataI(FullDuplexDriver *sd, uint8_t b); - t_msg chFDDRequestDataI(FullDuplexDriver *sd); - void chFDDAddFlagsI(FullDuplexDriver *sd, t_dflags mask); - t_dflags chFDDGetAndClearFlags(FullDuplexDriver *sd); + msg_t chFDDRequestDataI(FullDuplexDriver *sd); + void chFDDAddFlagsI(FullDuplexDriver *sd, dflags_t mask); + dflags_t chFDDGetAndClearFlags(FullDuplexDriver *sd); #ifdef __cplusplus } #endif @@ -128,7 +128,7 @@ typedef struct { /** I/O driver status flags. This field should not be read directly but * the \p chHDDGetAndClearFlags() funtion should be used * instead.*/ - t_dflags sd_flags; + dflags_t sd_flags; /** Status Change Event Source. This event is generated when a condition * flag was changed.*/ EventSource sd_sevent; @@ -137,12 +137,12 @@ typedef struct { #ifdef __cplusplus extern "C" { #endif - void chHDDInit(HalfDuplexDriver *sd, uint8_t *b, t_size size, - t_qnotify inotify, t_qnotify onotify); + void chHDDInit(HalfDuplexDriver *sd, uint8_t *b, size_t size, + qnotify_t inotify, qnotify_t onotify); void chHDDIncomingDataI(HalfDuplexDriver *sd, uint8_t b); - t_msg chHDDRequestDataI(HalfDuplexDriver *sd); - void chHDDAddFlagsI(HalfDuplexDriver *sd, t_dflags mask); - t_dflags chHDDGetAndClearFlags(HalfDuplexDriver *sd); + msg_t chHDDRequestDataI(HalfDuplexDriver *sd); + void chHDDAddFlagsI(HalfDuplexDriver *sd, dflags_t mask); + dflags_t chHDDGetAndClearFlags(HalfDuplexDriver *sd); #ifdef __cplusplus } #endif diff --git a/src/include/sleep.h b/src/include/sleep.h index 022b7be23..808fbc560 100644 --- a/src/include/sleep.h +++ b/src/include/sleep.h @@ -29,7 +29,7 @@ extern "C" { #endif #ifdef CH_USE_SLEEP - void chThdSleep(t_time time); + void chThdSleep(systime_t time); #endif /* CH_USE_SLEEP */ #ifdef __cplusplus } @@ -55,7 +55,7 @@ extern "C" { #define chThdSleepUntil(t) { \ chSysLock(); \ chSchGoSleepTimeoutS(PRSLEEP, \ - (t_time)((t) - chSysGetTime())) \ + (systime_t)((t) - chSysGetTime())) \ chSysUnlock(); \ } #endif /* CH_USE_SYSTEMTIME */ diff --git a/src/include/threads.h b/src/include/threads.h index a0c2189da..11674b322 100644 --- a/src/include/threads.h +++ b/src/include/threads.h @@ -39,14 +39,14 @@ struct Thread { Thread *p_prev; /* End of the fields shared with the ThreadsQueue structure. */ /** The thread priority.*/ - t_prio p_prio; + tprio_t p_prio; /* End of the fields shared with the ReadyList structure. */ /** Thread identifier. */ - t_tid p_tid; + tid_t p_tid; /** Current thread state.*/ - t_tstate p_state; + tstate_t p_state; /** Mode flags.*/ - t_tmode p_flags; + tmode_t p_flags; /** Machine dependent processor context.*/ Context p_ctx; /* @@ -56,9 +56,9 @@ struct Thread { */ union { /** Thread wakeup code (only valid when exiting the \p PRREADY state).*/ - t_msg p_rdymsg; + msg_t p_rdymsg; /** The thread exit code (only while in \p PREXIT state).*/ - t_msg p_exitcode; + msg_t p_exitcode; #ifdef CH_USE_SEMAPHORES /** Semaphore where the thread is waiting on (only in \p PRWTSEM state).*/ Semaphore *p_wtsemp; @@ -73,7 +73,7 @@ struct Thread { #endif #ifdef CH_USE_EVENTS /** Enabled events mask (only while in \p PRWTEVENT state).*/ - t_eventmask p_ewmask; + eventmask_t p_ewmask; #endif #ifdef CH_USE_TRACE /** Kernel object where the thread is waiting on. It is only valid when @@ -94,16 +94,16 @@ struct Thread { #endif #ifdef CH_USE_MESSAGES ThreadsQueue p_msgqueue; - t_msg p_msg; + msg_t p_msg; #endif #ifdef CH_USE_EVENTS /** Pending events mask.*/ - t_eventmask p_epending; + eventmask_t p_epending; #endif #ifdef CH_USE_MUTEXES /** Owner mutexes list, \p NULL terminated.*/ Mutex *p_mtxlist; - t_prio p_realprio; + tprio_t p_realprio; #endif }; @@ -159,10 +159,10 @@ struct Thread { #define ABSPRIO 255 /* Not an API, don't use into the application code.*/ -void _InitThread(t_prio prio, t_tmode mode, Thread *tp); +void _InitThread(tprio_t prio, tmode_t mode, Thread *tp); /** Thread function.*/ -typedef t_msg (*t_tfunc)(void *); +typedef msg_t (*tfunc_t)(void *); /* * Threads APIs. @@ -170,10 +170,10 @@ typedef t_msg (*t_tfunc)(void *); #ifdef __cplusplus extern "C" { #endif - Thread *chThdCreate(t_prio prio, t_tmode mode, void *workspace, - t_size wsize, t_tfunc pf, void *arg); - void chThdSetPriority(t_prio newprio); - void chThdExit(t_msg msg); + Thread *chThdCreate(tprio_t prio, tmode_t mode, void *workspace, + size_t wsize, tfunc_t pf, void *arg); + void chThdSetPriority(tprio_t newprio); + void chThdExit(msg_t msg); #ifdef CH_USE_RESUME void chThdResume(Thread *tp); #endif @@ -184,7 +184,7 @@ extern "C" { void chThdTerminate(Thread *tp); #endif #ifdef CH_USE_WAITEXIT - t_msg chThdWait(Thread *tp); + msg_t chThdWait(Thread *tp); #endif #ifdef __cplusplus } diff --git a/src/lib/evtimer.h b/src/lib/evtimer.h index 5999563d1..7b2e01c6d 100644 --- a/src/lib/evtimer.h +++ b/src/lib/evtimer.h @@ -31,7 +31,7 @@ typedef struct { VirtualTimer et_vt; EventSource et_es; - t_time et_interval; + systime_t et_interval; } EvTimer; #ifdef __cplusplus diff --git a/src/templates/chtypes.h b/src/templates/chtypes.h index 08753dc3d..1c4004c6d 100644 --- a/src/templates/chtypes.h +++ b/src/templates/chtypes.h @@ -25,21 +25,24 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ +#define __need_NULL +#define __need_size_t +#include + #if !defined(_STDINT_H) && !defined(__STDINT_H_) #include #endif -typedef int8_t bool_t; -typedef uint8_t t_tmode; /* Thread mode flags, BYTE8 is ok. */ -typedef uint8_t t_tstate; /* Thread state, BYTE8 is ok. */ -typedef uint16_t t_tid; /* Thread id. */ -typedef uint32_t t_prio; /* Priority, use the fastest unsigned type. */ -typedef int32_t t_msg; /* Message, use signed pointer equivalent.*/ -typedef int32_t t_eventid; /* Event Id, use fastest signed.*/ -typedef uint32_t t_eventmask;/* Event Mask, recommended fastest unsigned.*/ -typedef uint32_t t_time; /* Time, recommended fastest unsigned.*/ -typedef int32_t t_cnt; /* Counter, recommended fastest signed.*/ -typedef uint32_t t_size; /* Size, use unsigned pointer equivalent.*/ +typedef int8_t bool_t; /* Signed byte boolean. */ +typedef uint8_t tmode_t; /* Thread mode flags, BYTE8 is ok. */ +typedef uint8_t tstate_t; /* Thread state, BYTE8 is ok. */ +typedef uint16_t tid_t; /* Thread id. */ +typedef uint32_t tprio_t; /* Priority, use the fastest unsigned type. */ +typedef int32_t msg_t; /* Message, use signed pointer equivalent.*/ +typedef int32_t eventid_t; /* Event Id, use fastest signed.*/ +typedef uint32_t eventmask_t;/* Event Mask, recommended fastest unsigned.*/ +typedef uint32_t systime_t; /* System Time, recommended fastest unsigned.*/ +typedef int32_t cnt_t; /* Counter, recommended fastest signed.*/ #define INLINE inline -- cgit v1.2.3