git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@23 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
619b739d93
commit
95b238fc86
|
@ -72,7 +72,7 @@
|
|||
/** Configuration option: if specified then the Semaphores APIs with priority
|
||||
* shift are included in the kernel.
|
||||
* @note requires \p CH_USE_SEMAPHORES.*/
|
||||
//#define CH_USE_RT_SEMAPHORES
|
||||
#define CH_USE_RT_SEMAPHORES
|
||||
|
||||
/** Configuration option: if specified then the Events APIs are included in
|
||||
* the kernel.*/
|
||||
|
@ -82,7 +82,7 @@
|
|||
* function is included in the kernel.
|
||||
* @note requires \p CH_USE_EVENTS.
|
||||
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
|
||||
//#define CH_USE_EVENTS_TIMEOUT
|
||||
#define CH_USE_EVENTS_TIMEOUT
|
||||
|
||||
/** Configuration option: if specified then the Synchronous Messages APIs are
|
||||
* included in the kernel.*/
|
||||
|
@ -92,13 +92,13 @@
|
|||
* function is included in the kernel.
|
||||
* @note requires \p CH_USE_MESSAGES.
|
||||
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
|
||||
//#define CH_USE_MESSAGES_TIMEOUT
|
||||
#define CH_USE_MESSAGES_TIMEOUT
|
||||
|
||||
/** 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.*/
|
||||
//#define CH_USE_MESSAGES_EVENT
|
||||
#define CH_USE_MESSAGES_EVENT
|
||||
|
||||
/** Configuration option: if specified then the
|
||||
* \p chThdGetExitEventSource() function is included in the kernel.
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
typedef BYTE8 t_tmode;
|
||||
typedef BYTE8 t_tstate;
|
||||
typedef WORD16 t_prio;
|
||||
typedef LONG32 t_prio;
|
||||
typedef PTR_EQ t_msg;
|
||||
typedef LONG32 t_eventid;
|
||||
typedef ULONG32 t_eventmask;
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
typedef BYTE8 t_tmode;
|
||||
typedef BYTE8 t_tstate;
|
||||
typedef WORD16 t_prio;
|
||||
typedef LONG32 t_prio;
|
||||
typedef PTR_EQ t_msg;
|
||||
typedef LONG32 t_eventid;
|
||||
typedef ULONG32 t_eventmask;
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
typedef BYTE8 t_tmode;
|
||||
typedef BYTE8 t_tstate;
|
||||
typedef WORD16 t_prio;
|
||||
typedef LONG32 t_prio;
|
||||
typedef PTR_EQ t_msg;
|
||||
typedef LONG32 t_eventid;
|
||||
typedef ULONG32 t_eventmask;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = ChibiOS/RT
|
||||
PROJECT_NUMBER = "0.2.0 alpha"
|
||||
PROJECT_NUMBER = "0.2.1 alpha"
|
||||
OUTPUT_DIRECTORY = .
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
|
@ -26,7 +26,7 @@ ALWAYS_DETAILED_SEC = NO
|
|||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = NO
|
||||
STRIP_FROM_PATH = "C:/Documents and Settings/Administrator/"
|
||||
STRIP_FROM_INC_PATH =
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
|
@ -34,7 +34,7 @@ DETAILS_AT_TOP = YES
|
|||
INHERIT_DOCS = NO
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 2
|
||||
ALIASES =
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
BUILTIN_STL_SUPPORT = NO
|
||||
|
@ -64,11 +64,11 @@ GENERATE_TODOLIST = YES
|
|||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = NO
|
||||
SHOW_DIRECTORIES = NO
|
||||
FILE_VERSION_FILTER =
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -78,7 +78,7 @@ WARN_IF_UNDOCUMENTED = YES
|
|||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -115,15 +115,15 @@ FILE_PATTERNS = *.c \
|
|||
*.py \
|
||||
*.ddf
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH =
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
|
@ -141,20 +141,20 @@ VERBATIM_HEADERS = NO
|
|||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
|
@ -171,8 +171,8 @@ LATEX_CMD_NAME = latex
|
|||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
|
@ -184,8 +184,8 @@ GENERATE_RTF = NO
|
|||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -198,8 +198,8 @@ MAN_LINKS = NO
|
|||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
|
@ -211,16 +211,16 @@ GENERATE_AUTOGEN_DEF = NO
|
|||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = __JUST_STUBS__ \
|
||||
__DOXIGEN__ \
|
||||
CH_USE_VIRTUAL_TIMERS \
|
||||
|
@ -242,18 +242,18 @@ PREDEFINED = __JUST_STUBS__ \
|
|||
CH_USE_MESSAGES \
|
||||
CH_USE_MESSAGES_TIMEOUT \
|
||||
CH_USE_MESSAGES_EVENT
|
||||
EXPAND_AS_DEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = NO
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
|
@ -270,8 +270,8 @@ CALLER_GRAPH = NO
|
|||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MAX_DOT_GRAPH_WIDTH = 1024
|
||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||
MAX_DOT_GRAPH_DEPTH = 1000
|
||||
|
@ -280,6 +280,6 @@ DOT_MULTI_TARGETS = NO
|
|||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _LPC2000_SERIAL_H_
|
||||
#define _LPC2000_SERIAL_H_
|
||||
#ifndef _LPC214x_SERIAL_H_
|
||||
#define _LPC214x_SERIAL_H_
|
||||
|
||||
void InitSerial(void);
|
||||
void SetUARTI(UART *u, int speed, int lcr, int fcr);
|
||||
|
@ -27,4 +27,4 @@ void UART1IrqHandler(void);
|
|||
|
||||
extern FullDuplexDriver COM1, COM2;
|
||||
|
||||
#endif /* _LPC2000_SERIAL_H_*/
|
||||
#endif /* _LPC214x_SERIAL_H_*/
|
||||
|
|
17
readme.txt
17
readme.txt
|
@ -11,8 +11,10 @@
|
|||
under ./demos/.
|
||||
./ports/ - Architecture/compiler specific portable files.
|
||||
./demos/ - Demo programs for specific archtectures/boards.
|
||||
./docs/doxifile - Doxigen project file.
|
||||
./docs/index.html - ChibiOS/RT documentation (after running doxigen).
|
||||
./docs/Doxifile - Doxigen project file.
|
||||
./docs/index.html - ChibiOS/RT documentation (after running doxigen). The
|
||||
documentation is also available on the project web
|
||||
page: http://chibios.sourceforge.net/
|
||||
|
||||
Current ports under ./demos:
|
||||
|
||||
|
@ -30,6 +32,15 @@ LPC214x-GCC - ChibiOS/RT port for ARM7 LPC2148, the demo targets the
|
|||
*** Releases ***
|
||||
*****************************************************************************
|
||||
|
||||
*** 0.2.1 ***
|
||||
- Optimizations in the RT semaphores subsystem. The support for this
|
||||
subsystem should still be considered experimental and further changes may
|
||||
happen in future versions.
|
||||
- Bug fix in the virtual timers handling code, now the timers can be re-armed
|
||||
from within the callback code in order to create periodic virtual timers.
|
||||
- Modified the t_prio type in the demos to be 32bits wide instead of 16bits,
|
||||
this results in a better code in critical sections of the kernel.
|
||||
|
||||
*** 0.2.0 ***
|
||||
- Introduced support for ARM in thumb mode.
|
||||
- Optimized context switching when thumb-interworking is not required, one
|
||||
|
@ -41,4 +52,4 @@ LPC214x-GCC - ChibiOS/RT port for ARM7 LPC2148, the demo targets the
|
|||
- Renamed makefiles to Makefiles, upper case M.
|
||||
|
||||
*** 0.1.0 ***
|
||||
- First alpha release
|
||||
- First alpha release
|
||||
|
|
12
src/chschd.c
12
src/chschd.c
|
@ -188,17 +188,7 @@ void chSchTimerHandlerI(void) {
|
|||
#endif
|
||||
|
||||
#ifdef CH_USE_VIRTUAL_TIMERS
|
||||
if (&dlist != (DeltaList *)dlist.dl_next) {
|
||||
VirtualTimer *vtp;
|
||||
|
||||
--dlist.dl_next->vt_dtime;
|
||||
while (!(vtp = dlist.dl_next)->vt_dtime) {
|
||||
vtp->vt_prev->vt_next = vtp->vt_next;
|
||||
vtp->vt_next->vt_prev = vtp->vt_prev;
|
||||
vtp->vt_func(vtp->vt_par);
|
||||
vtp->vt_func = 0; // Required, flags the timer as triggered.
|
||||
}
|
||||
}
|
||||
chVTDoTickI();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
28
src/chsem.c
28
src/chsem.c
|
@ -288,7 +288,7 @@ void chSemLowerPrioSignal(Semaphore *sp) {
|
|||
chSysLock();
|
||||
|
||||
if (!--currp->p_rtcnt) {
|
||||
currp->p_prio = currp->p_bakprio;
|
||||
currp->p_prio -= MEPRIO;
|
||||
if (sp->s_cnt++ < 0)
|
||||
chSchReadyI(dequeue(sp->s_queue.p_next));
|
||||
chSchRescheduleI();
|
||||
|
@ -308,14 +308,11 @@ void chSemLowerPrioSignal(Semaphore *sp) {
|
|||
* option is enabled in \p chconf.h.
|
||||
*/
|
||||
void chSemRaisePrioSignalWait(Semaphore *sps, Semaphore *spw) {
|
||||
BOOL flag;
|
||||
|
||||
chSysLock();
|
||||
|
||||
if (sps->s_cnt++ < 0)
|
||||
chSchReadyI(dequeue(sps->s_queue.p_next)), flag = TRUE;
|
||||
else
|
||||
flag = FALSE;
|
||||
chSchReadyI(dequeue(sps->s_queue.p_next));
|
||||
|
||||
if (--spw->s_cnt < 0) {
|
||||
prioenq(currp, &spw->s_queue);
|
||||
|
@ -323,19 +320,13 @@ void chSemRaisePrioSignalWait(Semaphore *sps, Semaphore *spw) {
|
|||
|
||||
if (!currp->p_rtcnt++)
|
||||
currp->p_prio += MEPRIO;
|
||||
|
||||
chSysUnlock();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (!currp->p_rtcnt++)
|
||||
currp->p_prio += MEPRIO;
|
||||
|
||||
if (!currp->p_rtcnt++) {
|
||||
currp->p_bakprio = currp->p_prio;
|
||||
currp->p_prio += MEPRIO;
|
||||
flag = TRUE;
|
||||
}
|
||||
|
||||
if( flag)
|
||||
chSchRescheduleI();
|
||||
}
|
||||
|
||||
chSysUnlock();
|
||||
}
|
||||
|
@ -349,21 +340,20 @@ void chSemRaisePrioSignalWait(Semaphore *sps, Semaphore *spw) {
|
|||
* option is enabled in \p chconf.h.
|
||||
*/
|
||||
void chSemLowerPrioSignalWait(Semaphore *sps, Semaphore *spw) {
|
||||
BOOL flag = FALSE;
|
||||
|
||||
chSysLock();
|
||||
|
||||
if (!--currp->p_rtcnt)
|
||||
currp->p_prio = currp->p_bakprio, flag = TRUE;
|
||||
currp->p_prio -= MEPRIO;
|
||||
|
||||
if (sps->s_cnt++ < 0)
|
||||
chSchReadyI(dequeue(sps->s_queue.p_next)), flag = TRUE;
|
||||
chSchReadyI(dequeue(sps->s_queue.p_next));
|
||||
|
||||
if (--spw->s_cnt < 0) {
|
||||
enqueue(currp, &spw->s_queue); // enqueue() because the spw is a normal sem.
|
||||
chSchGoSleepI(PRWTSEM);
|
||||
}
|
||||
else if (flag)
|
||||
else
|
||||
chSchRescheduleI();
|
||||
|
||||
chSysUnlock();
|
||||
|
|
|
@ -61,7 +61,6 @@ void _InitThread(t_prio prio, t_tmode mode, Thread *tp) {
|
|||
tp->p_rdymsg = RDY_OK;
|
||||
#ifdef CH_USE_RT_SEMAPHORES
|
||||
tp->p_rtcnt = 0;
|
||||
tp->p_bakprio = prio;
|
||||
#endif
|
||||
#ifdef CH_USE_WAITEXIT
|
||||
tp->p_waiting.p_next = (Thread *)&tp->p_waiting;
|
||||
|
|
|
@ -69,6 +69,20 @@ typedef struct {
|
|||
|
||||
extern DeltaList dlist;
|
||||
|
||||
#define chVTDoTickI() \
|
||||
if (&dlist != (DeltaList *)dlist.dl_next) { \
|
||||
VirtualTimer *vtp; \
|
||||
\
|
||||
--dlist.dl_next->vt_dtime; \
|
||||
while (!(vtp = dlist.dl_next)->vt_dtime) { \
|
||||
t_vtfunc fn = vtp->vt_func; \
|
||||
vtp->vt_func = 0; \
|
||||
vtp->vt_prev->vt_next = vtp->vt_next; \
|
||||
vtp->vt_next->vt_prev = vtp->vt_prev; \
|
||||
fn(vtp->vt_par); \
|
||||
} \
|
||||
}
|
||||
|
||||
/*
|
||||
* Virtual Timers APIs.
|
||||
*/
|
||||
|
|
|
@ -80,7 +80,7 @@ struct Thread {
|
|||
#endif
|
||||
};
|
||||
/** Machine dependent processor context.*/
|
||||
Context p_ctx;
|
||||
Context p_ctx;
|
||||
/*
|
||||
* Start of the optional fields. Note, the null thread may also let its
|
||||
* stack overwrite the following fields since it never uses semaphores,
|
||||
|
@ -104,9 +104,8 @@ struct Thread {
|
|||
#endif
|
||||
#ifdef CH_USE_RT_SEMAPHORES
|
||||
/** Priority backup after acquiring a RT semaphore.*/
|
||||
t_prio p_bakprio;
|
||||
/** RT semaphores depth counter.*/
|
||||
WORD16 p_rtcnt;
|
||||
int p_rtcnt;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
typedef BYTE8 t_tmode;
|
||||
typedef BYTE8 t_tstate;
|
||||
typedef WORD16 t_prio;
|
||||
typedef LONG32 t_prio;
|
||||
typedef PTR_EQ t_msg;
|
||||
typedef LONG32 t_eventid;
|
||||
typedef ULONG32 t_eventmask;
|
||||
|
|
Loading…
Reference in New Issue