git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@481 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2008-10-25 09:34:25 +00:00
parent 8317685beb
commit 902470d1c5
23 changed files with 71 additions and 261 deletions

View File

@ -17,10 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Configuration file for LPC214x-GCC demo project.
*/
/**
* @addtogroup Config
* @{
@ -34,18 +30,10 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
/** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority. */
#define CH_USE_ROUNDROBIN
/** Configuration option: if specified then the System Timer subsystem is
* included in the kernel.*/
#define CH_USE_SYSTEMTIME
/** Configuration option: if specified then the \p chThdWait() function
* is included in the kernel.*/
#define CH_USE_WAITEXIT
@ -60,8 +48,7 @@
/** Configuration option: if specified then the Semaphores with timeout APIs
* are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_SEMAPHORES.*/
#define CH_USE_SEMAPHORES_TIMEOUT
/** Configuration option: if specified then the Mutexes APIs are included in
@ -86,8 +73,7 @@
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve

View File

@ -17,10 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Configuration file for LPC214x-GCC demo project.
*/
/**
* @addtogroup Config
* @{
@ -34,18 +30,10 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
/** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority. */
#define CH_USE_ROUNDROBIN
/** Configuration option: if specified then the System Timer subsystem is
* included in the kernel.*/
#define CH_USE_SYSTEMTIME
/** Configuration option: if specified then the \p chThdWait() function
* is included in the kernel.*/
#define CH_USE_WAITEXIT
@ -60,8 +48,7 @@
/** Configuration option: if specified then the Semaphores with timeout APIs
* are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_SEMAPHORES.*/
#define CH_USE_SEMAPHORES_TIMEOUT
/** Configuration option: if specified then the Mutexes APIs are included in
@ -74,8 +61,7 @@
/** Configuration option: if specified then the \p chEvtWaitTimeout()
* function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_EVENTS.*/
#define CH_USE_EVENTS_TIMEOUT
/** Configuration option: if specified then the Synchronous Messages APIs are
@ -84,8 +70,7 @@
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve

View File

@ -17,10 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Configuration file for LPC214x-GCC demo project.
*/
/**
* @addtogroup Config
* @{
@ -34,18 +30,10 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
/** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority. */
#define CH_USE_ROUNDROBIN
/** Configuration option: if specified then the System Timer subsystem is
* included in the kernel.*/
#define CH_USE_SYSTEMTIME
/** Configuration option: if specified then the \p chThdWait() function
* is included in the kernel.*/
#define CH_USE_WAITEXIT
@ -60,8 +48,7 @@
/** Configuration option: if specified then the Semaphores with timeout APIs
* are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_SEMAPHORES.*/
#define CH_USE_SEMAPHORES_TIMEOUT
/** Configuration option: if specified then the Mutexes APIs are included in
@ -74,8 +61,7 @@
/** Configuration option: if specified then the \p chEvtWaitTimeout()
* function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_EVENTS.*/
#define CH_USE_EVENTS_TIMEOUT
/** Configuration option: if specified then the Synchronous Messages APIs are
@ -84,8 +70,7 @@
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve

View File

@ -17,10 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Configuration file for LPC214x-GCC demo project.
*/
/**
* @addtogroup Config
* @{
@ -34,18 +30,10 @@
* that this is not related to the compiler optimization options.*/
//#define CH_OPTIMIZE_SPEED
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
/** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority. */
#define CH_USE_ROUNDROBIN
/** Configuration option: if specified then the System Timer subsystem is
* included in the kernel.*/
#define CH_USE_SYSTEMTIME
/** Configuration option: if specified then the \p chThdWait() function
* is included in the kernel.*/
//#define CH_USE_WAITEXIT
@ -60,8 +48,7 @@
/** Configuration option: if specified then the Semaphores with timeout APIs
* are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_SEMAPHORES.*/
//#define CH_USE_SEMAPHORES_TIMEOUT
/** Configuration option: if specified then the Mutexes APIs are included in
@ -74,8 +61,7 @@
/** Configuration option: if specified then the \p chEvtWaitTimeout()
* function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_EVENTS.*/
//#define CH_USE_EVENTS_TIMEOUT
/** Configuration option: if specified then the Synchronous Messages APIs are
@ -84,8 +70,7 @@
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_MESSAGES.*/
//#define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve

View File

@ -17,10 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Configuration file for LPC214x-GCC demo project.
*/
/**
* @addtogroup Config
* @{
@ -34,18 +30,10 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
/** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority. */
#define CH_USE_ROUNDROBIN
/** Configuration option: if specified then the System Timer subsystem is
* included in the kernel.*/
#define CH_USE_SYSTEMTIME
/** Configuration option: if specified then the \p chThdWait() function
* is included in the kernel.*/
#define CH_USE_WAITEXIT
@ -60,8 +48,7 @@
/** Configuration option: if specified then the Semaphores with timeout APIs
* are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_SEMAPHORES.*/
#define CH_USE_SEMAPHORES_TIMEOUT
/** Configuration option: if specified then the Mutexes APIs are included in
@ -74,8 +61,7 @@
/** Configuration option: if specified then the \p chEvtWaitTimeout()
* function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_EVENTS.*/
#define CH_USE_EVENTS_TIMEOUT
/** Configuration option: if specified then the Synchronous Messages APIs are
@ -84,8 +70,7 @@
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve

View File

@ -17,10 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Configuration file for LPC214x-GCC demo project.
*/
/**
* @addtogroup Config
* @{
@ -34,18 +30,10 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
/** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority. */
#define CH_USE_ROUNDROBIN
/** Configuration option: if specified then the System Timer subsystem is
* included in the kernel.*/
#define CH_USE_SYSTEMTIME
/** Configuration option: if specified then the \p chThdWait() function
* is included in the kernel.*/
#define CH_USE_WAITEXIT
@ -60,8 +48,7 @@
/** Configuration option: if specified then the Semaphores with timeout APIs
* are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_SEMAPHORES.*/
#define CH_USE_SEMAPHORES_TIMEOUT
/** Configuration option: if specified then the Mutexes APIs are included in
@ -74,8 +61,7 @@
/** Configuration option: if specified then the \p chEvtWaitTimeout()
* function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_EVENTS.*/
#define CH_USE_EVENTS_TIMEOUT
/** Configuration option: if specified then the Synchronous Messages APIs are
@ -84,8 +70,7 @@
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve

View File

@ -17,10 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Configuration file for LPC214x-GCC demo project.
*/
/**
* @addtogroup Config
* @{
@ -34,18 +30,10 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
/** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority. */
#define CH_USE_ROUNDROBIN
/** Configuration option: if specified then the System Timer subsystem is
* included in the kernel.*/
#define CH_USE_SYSTEMTIME
/** Configuration option: if specified then the \p chThdWait() function
* is included in the kernel.*/
#define CH_USE_WAITEXIT
@ -60,8 +48,7 @@
/** Configuration option: if specified then the Semaphores with timeout APIs
* are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_SEMAPHORES.*/
#define CH_USE_SEMAPHORES_TIMEOUT
/** Configuration option: if specified then the Mutexes APIs are included in
@ -74,8 +61,7 @@
/** Configuration option: if specified then the \p chEvtWaitTimeout()
* function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_EVENTS.*/
#define CH_USE_EVENTS_TIMEOUT
/** Configuration option: if specified then the Synchronous Messages APIs are
@ -84,8 +70,7 @@
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve

View File

@ -17,10 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Configuration file for LPC214x-GCC demo project.
*/
/**
* @addtogroup Config
* @{
@ -34,18 +30,10 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
/** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority. */
#define CH_USE_ROUNDROBIN
/** Configuration option: if specified then the System Timer subsystem is
* included in the kernel.*/
#define CH_USE_SYSTEMTIME
/** Configuration option: if specified then the \p chThdWait() function
* is included in the kernel.*/
#define CH_USE_WAITEXIT
@ -60,8 +48,7 @@
/** Configuration option: if specified then the Semaphores with timeout APIs
* are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_SEMAPHORES.*/
#define CH_USE_SEMAPHORES_TIMEOUT
/** Configuration option: if specified then the Mutexes APIs are included in
@ -74,8 +61,7 @@
/** Configuration option: if specified then the \p chEvtWaitTimeout()
* function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_EVENTS.*/
#define CH_USE_EVENTS_TIMEOUT
/** Configuration option: if specified then the Synchronous Messages APIs are
@ -84,8 +70,7 @@
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve

View File

@ -35,18 +35,10 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
/** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority. */
#define CH_USE_ROUNDROBIN
/** Configuration option: if specified then the System Timer subsystem is
* included in the kernel.*/
#define CH_USE_SYSTEMTIME
/** Configuration option: if specified then the \p chThdWait() function
* is included in the kernel.*/
#define CH_USE_WAITEXIT
@ -61,8 +53,7 @@
/** Configuration option: if specified then the Semaphores with timeout APIs
* are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_SEMAPHORES.*/
#define CH_USE_SEMAPHORES_TIMEOUT
/** Configuration option: if specified then the Mutexes APIs are included in
@ -75,8 +66,7 @@
/** Configuration option: if specified then the \p chEvtWaitTimeout()
* function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_EVENTS.*/
#define CH_USE_EVENTS_TIMEOUT
/** Configuration option: if specified then the Synchronous Messages APIs are
@ -85,8 +75,7 @@
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve

View File

@ -17,10 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Configuration file for MingGW32 demo project.
*/
/**
* @addtogroup Config
* @{
@ -34,18 +30,10 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
/** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority. */
#define CH_USE_ROUNDROBIN
/** Configuration option: if specified then the System Timer subsystem is
* included in the kernel.*/
#define CH_USE_SYSTEMTIME
/** Configuration option: if specified then the \p chThdWait() function
* is included in the kernel.*/
#define CH_USE_WAITEXIT
@ -60,8 +48,7 @@
/** Configuration option: if specified then the Semaphores with timeout APIs
* are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_SEMAPHORES.*/
#define CH_USE_SEMAPHORES_TIMEOUT
/** Configuration option: if specified then the Mutexes APIs are included in
@ -74,8 +61,7 @@
/** Configuration option: if specified then the \p chEvtWaitTimeout()
* function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_EVENTS.*/
#define CH_USE_EVENTS_TIMEOUT
/** Configuration option: if specified then the Synchronous Messages APIs are
@ -84,8 +70,7 @@
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve

View File

@ -249,8 +249,6 @@ INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = __JUST_STUBS__ \
__DOXIGEN__ \
CH_USE_VIRTUAL_TIMERS \
CH_USE_SYSTEMTIME \
CH_USE_WAITEXIT \
CH_USE_SEMAPHORES \
CH_USE_SEMSW \
@ -271,7 +269,8 @@ PREDEFINED = __JUST_STUBS__ \
CH_USE_MESSAGES_PRIORITY \
CH_USE_DEBUG \
CH_USE_TRACE \
CH_USE_DYNAMIC
CH_USE_DYNAMIC \
CH_USE_ROUNDROBIN
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------

View File

@ -351,8 +351,6 @@
* @defgroup VirtualTimers Virtual Timers
* @{
* Virtual Timers APIs.
* In order to use the Virtual Timers the \p CH_USE_VIRTUAL_TIMERS option
* must be specified in \p chconf.h.
* @file src/chdelta.c Virtual Timers code.
* @file delta.h Virtual Timers macros and structures.
*/
@ -362,8 +360,6 @@
* @defgroup Time Time
* @{
* Time related APIs.
* In order to use the Time APIs the \p CH_USE_SLEEP
* option must be specified in \p chconf.h.
* @file include/sleep.h Time macros and structures.
* @file chsleep.c Time functions.
*/
@ -503,9 +499,8 @@
* server threads but just a pointer passed so the exchange is very time
* efficient.<br>
* Messages are usually processed in FIFO order but it is possible to process
* them in priority order by specifying \p P_MSGBYPRIO when creating a server
* thread, \p CH_USE_MESSAGES_PRIORITY must also be specified in \p chconf.h
* in order to enable the feature.<br>
* them in priority order by specifying CH_USE_MESSAGES_PRIORITY
* in \p chconf.h.<br>
* Threads do not need to allocate space for message queues, the mechanism
* just requires two extra pointers in the \p Thread structure (the message
* queue header).<br>

View File

@ -74,11 +74,15 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process,
*****************************************************************************
*** 0.7.3 ***
- CHANGE: Removed the CH_USE_SYSTEMTIME and CH_USE_VIRTUAL_TIMER configuration
options in order to make the chconf.h file simpler. The related subsystems
are almost always required and are now always included.
- Small optimization to the MSP430 serial driver.
- Added dependency informations handling to the MSP430 demo Makefile.
- Removed the performance spreadsheet (it was *very* old) and added a
directory containing the test reports ./docs/reports. Each report shows the
results from the latest test run on each target.
- Small fixes in the documentation.
*** 0.7.2 ***
- NEW: Added a serial driver to the MSP430 port, the MSP430 port now has been

View File

@ -60,11 +60,7 @@ TraceBuffer dbgtb;
void chDbgTrace(Thread *otp, Thread *ntp) {
dbgtb.tb_ptr->cse_wtobjp = otp->p_wtobjp;
#ifdef CH_USE_SYSTEMTIME
dbgtb.tb_ptr->cse_time = chSysGetTime();
#else
dbgtb.tb_ptr->cse_time = 0;
#endif
dbgtb.tb_ptr->cse_state = otp->p_state;
dbgtb.tb_ptr->cse_tid = ntp->p_tid;
if (++dbgtb.tb_ptr >= &dbgtb.tb_buffer[TRACE_BUFFER_SIZE])

View File

@ -24,7 +24,6 @@
#include <ch.h>
#ifdef CH_USE_VIRTUAL_TIMERS
DeltaList dlist;
/**
@ -35,6 +34,7 @@ void chVTInit(void) {
dlist.dl_next = dlist.dl_prev = (void *)&dlist;
dlist.dl_dtime = (systime_t)-1;
dlist.dl_stime = 0;
}
/**
@ -86,6 +86,5 @@ void chVTResetI(VirtualTimer *vtp) {
vtp->vt_next->vt_prev = vtp->vt_prev;
vtp->vt_func = 0;
}
#endif /* CH_USE_VIRTUAL_TIMER */
/** @} */

View File

@ -37,9 +37,7 @@ void chSysInit(void) {
chSchInit();
chDbgInit();
#ifdef CH_USE_VIRTUAL_TIMERS
chVTInit();
#endif
#ifdef CH_USE_HEAP
chHeapInit();
#endif
@ -69,19 +67,14 @@ void chSysInit(void) {
* together with the \p CH_TIME_QUANTUM macro, the round robin interval.
*/
void chSysTimerHandlerI(void) {
#ifdef CH_USE_ROUNDROBIN
/* running thread has not used up quantum yet? */
if (rlist.r_preempt > 0)
/* decrement remaining quantum */
rlist.r_preempt--;
#endif
#ifdef CH_USE_SYSTEMTIME
rlist.r_stime++;
#endif
#ifdef CH_USE_VIRTUAL_TIMERS
chVTDoTickI();
#endif
}
/** @} */

View File

@ -108,7 +108,7 @@ msg_t chIQGet(Queue *qp) {
return b;
}
#ifdef CH_USE_QUEUES_TIMEOUT
#if defined(CH_USE_QUEUES_TIMEOUT) && defined(CH_USE_SEMAPHORES_TIMEOUT)
/**
* Gets a byte from the input queue, if the queue is empty then the
* calling thread is suspended until a byte arrives in the queue or the
@ -118,8 +118,8 @@ msg_t chIQGet(Queue *qp) {
* @return A byte value from the queue.
* @retval Q_TIMEOUT if the specified time expired.
* @retval Q_RESET if the queue was reset.
* @note The function is available only if the \p CH_USE_QUEUES_TIMEOUT
* option is enabled in \p chconf.h.
* @note The function is available only if the \p CH_USE_QUEUES_TIMEOUT and
* \p CH_USE_SEMAPHORES_TIMEOUT options are enabled in \p chconf.h.
*/
msg_t chIQGetTimeout(Queue *qp, systime_t time) {
uint8_t b;
@ -142,7 +142,7 @@ msg_t chIQGetTimeout(Queue *qp, systime_t time) {
chSysUnlock();
return b;
}
#endif /* CH_USE_QUEUES_TIMEOUTS */
#endif /* defined(CH_USE_QUEUES_TIMEOUT) && defined(CH_USE_SEMAPHORES_TIMEOUT) */
/**
* Reads some data from the input queue into the specified buffer. The function
@ -358,7 +358,7 @@ msg_t chHDQGetReceive(HalfDuplexQueue *qp) {
return b;
}
#ifdef CH_USE_QUEUES_TIMEOUT
#if defined(CH_USE_QUEUES_TIMEOUT) && defined(CH_USE_SEMAPHORES_TIMEOUT)
/**
* Reads a byte from the receive queue, if the queue is empty or is in
* transmission mode then the invoking thread is suspended.
@ -366,8 +366,8 @@ msg_t chHDQGetReceive(HalfDuplexQueue *qp) {
* @param time the number of ticks before the operation timouts
* @return The byte value.
* @retval Q_TIMEOUT if a timeout occurs.
* @note The function is available only if the \p CH_USE_QUEUES_TIMEOUT
* option is enabled in \p chconf.h.
* @note The function is available only if the \p CH_USE_QUEUES_TIMEOUT and
* \p CH_USE_SEMAPHORES_TIMEOUT options are enabled in \p chconf.h.
*/
msg_t chHDQGetReceiveTimeout(HalfDuplexQueue *qp, systime_t time) {
uint8_t b;
@ -394,7 +394,7 @@ msg_t chHDQGetReceiveTimeout(HalfDuplexQueue *qp, systime_t time) {
chSysUnlock();
return b;
}
#endif
#endif /* defined(CH_USE_QUEUES_TIMEOUT) && defined(CH_USE_SEMAPHORES_TIMEOUT) */
/**
* Writes a byte into the transmit queue. If the buffer contains unread

View File

@ -39,9 +39,6 @@ void chSchInit(void) {
#ifdef CH_USE_ROUNDROBIN
rlist.r_preempt = CH_TIME_QUANTUM;
#endif
#ifdef CH_USE_SYSTEMTIME
rlist.r_stime = 0;
#endif
}
/**
@ -94,7 +91,6 @@ void chSchGoSleepS(tstate_t newstate) {
chSysSwitchI(otp, currp);
}
#ifdef CH_USE_VIRTUAL_TIMERS
/*
* Timeout wakeup callback.
*/
@ -130,7 +126,6 @@ msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) {
chVTResetI(&vt);
return currp->p_rdymsg;
}
#endif /* CH_USE_VIRTUAL_TIMERS */
/**
* Wakes up a thread.

View File

@ -35,7 +35,6 @@ void chThdSleep(systime_t time) {
chSysUnlock();
}
#ifdef CH_USE_SYSTEMTIME
/**
* Checks if the current system time is within the specified time window.
* @param start the start of the time window (inclusive)
@ -47,6 +46,5 @@ bool_t chSysInTimeWindow(systime_t start, systime_t end) {
return end >= start ? (time >= start) && (time < end) :
(time >= start) || (time < end);
}
#endif /* CH_USE_SYSTEMTIME */
/** @} */

View File

@ -25,8 +25,6 @@
#ifndef _DELTA_H_
#define _DELTA_H_
#ifdef CH_USE_VIRTUAL_TIMERS
/** Virtual Timer callback function.*/
typedef void (*vtfunc_t)(void *);
@ -37,17 +35,17 @@ typedef struct VirtualTimer VirtualTimer;
* @extends DeltaList
*/
struct VirtualTimer {
/** Next timer in the delta list.*/
VirtualTimer *vt_next;
/** Previous timer in the delta list.*/
VirtualTimer *vt_prev;
/** Time delta before timeout.*/
systime_t vt_dtime;
/** Timer callback function pointer. The pointer is reset to zero after
the callback is invoked.*/
vtfunc_t vt_func;
/** Timer callback function parameter.*/
void *vt_par;
/** Next timer in the delta list.*/
VirtualTimer *vt_next;
/** Previous timer in the delta list.*/
VirtualTimer *vt_prev;
/** Time delta before timeout.*/
systime_t vt_dtime;
/** Timer callback function pointer. The pointer is reset to zero after
the callback is invoked.*/
vtfunc_t vt_func;
/** Timer callback function parameter.*/
void *vt_par;
};
/**
@ -57,17 +55,19 @@ struct VirtualTimer {
* is often used in the code.
*/
typedef struct {
/** Next timer in the list (the one that will be triggered next).*/
VirtualTimer *dl_next;
/** Last timer in the list.*/
VirtualTimer *dl_prev;
/** Not used but it must be set to -1.*/
systime_t dl_dtime;
/** Next timer in the list (the one that will be triggered next).*/
VirtualTimer *dl_next;
/** Last timer in the list.*/
VirtualTimer *dl_prev;
/** Not used but it must be set to -1.*/
systime_t dl_dtime;
volatile systime_t dl_stime;
} DeltaList;
extern DeltaList dlist;
#define chVTDoTickI() { \
dlist.dl_stime++; \
if (&dlist != (DeltaList *)dlist.dl_next) { \
VirtualTimer *vtp; \
\
@ -100,8 +100,6 @@ extern "C" {
/** Returns TRUE if the speciified timer is armed.*/
#define chVTIsArmedI(vtp) ((vtp)->vt_func != NULL)
#endif /* CH_USE_VIRTUAL_TIMER */
#endif /* _DELTA_H_ */
/** @} */

View File

@ -48,9 +48,6 @@ typedef struct {
/** the currently running thread */
Thread *r_current;
#endif
#ifdef CH_USE_SYSTEMTIME
volatile systime_t r_stime;
#endif
} ReadyList;
extern ReadyList rlist;

View File

@ -46,29 +46,22 @@
extern "C" {
#endif
void chThdSleep(systime_t time);
#ifdef CH_USE_SYSTEMTIME
bool_t chSysInTimeWindow(systime_t start, systime_t end);
#endif /* CH_USE_SYSTEMTIME */
bool_t chSysInTimeWindow(systime_t start, systime_t end);
#ifdef __cplusplus
}
#endif
#ifdef CH_USE_SYSTEMTIME
/**
* Returns the number of system ticks since the \p chSysInit() invocation.
* @return the system ticks number
* @note The counter can reach its maximum and then returns to zero.
* @note This function is designed to work with the \p chThdSleepUntil().
* @note The function is available only if the \p CH_USE_SYSTEMTIME
* option is enabled in \p chconf.h.
*/
#define chSysGetTime() rlist.r_stime
#define chSysGetTime() dlist.dl_stime
/**
* Suspends the invoking thread until the system time arrives to the specified
* value.
* @note The function is available only if the \p CH_USE_SYSTEMTIME
* option is enabled in \p chconf.h.
*/
#define chThdSleepUntil(t) { \
chSysLock(); \
@ -76,7 +69,6 @@ bool_t chSysInTimeWindow(systime_t start, systime_t end);
(systime_t)((t) - chSysGetTime())); \
chSysUnlock(); \
}
#endif /* CH_USE_SYSTEMTIME */
#endif /* _SLEEP_H_ */

View File

@ -35,18 +35,10 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
/** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority.*/
#define CH_USE_ROUNDROBIN
/** Configuration option: if specified then the System Timer subsystem is
* included in the kernel.*/
#define CH_USE_SYSTEMTIME
/** Configuration option: if specified then the \p chThdWait() function
* is included in the kernel.*/
#define CH_USE_WAITEXIT
@ -61,8 +53,7 @@
/** Configuration option: if specified then the Semaphores with timeout APIs
* are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_SEMAPHORES.*/
#define CH_USE_SEMAPHORES_TIMEOUT
/** Configuration option: if specified then the Mutexes APIs are included in
@ -75,8 +66,7 @@
/** Configuration option: if specified then the \p chEvtWaitTimeout()
* function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_EVENTS.*/
#define CH_USE_EVENTS_TIMEOUT
/** Configuration option: if specified then the Synchronous Messages APIs are
@ -85,8 +75,7 @@
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
* @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve