This commit is contained in:
Quantum Leaps 2016-04-01 10:02:43 -04:00
parent 0a824adc60
commit 3f4b87b13c
23 changed files with 193 additions and 195 deletions

View File

@ -28,7 +28,7 @@ INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES += next{1}="<hr><b>Next:</b> @ref \1</p>"
ALIASES += description="@par <b>Description</b>@n"
ALIASES += description="@par <b>Description</b>"
ALIASES += hint="@par <b>Hint</b>@n"
ALIASES += usage="@par <b>Usage</b>@n"
ALIASES += reqdef{2}="<div class="vmargin20"></div>@anchor \1 <TABLE><TR ALIGN="left"><TH NOWRAP>\1</TH><TH WIDTH="100%">\2</TH></TR></TABLE>"
@ -150,8 +150,7 @@ EXCLUDE = \
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS = \
QP_IMPL
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = \
snippets \
@ -314,7 +313,7 @@ EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = Q_SPY
PREDEFINED = Q_SPY QP_IMPL
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------

View File

@ -28,13 +28,13 @@ INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES += next{1}="<hr><b>Next:</b> @ref \1</p>"
ALIASES += description="@par <b>Description</b>@n"
ALIASES += description="@par <b>Description</b>"
ALIASES += hint="@par <b>Hint</b>@n"
ALIASES += usage="@par <b>Usage</b>@n"
ALIASES += reqdef{2}="<div class="vmargin20"></div>@anchor \1 <TABLE><TR ALIGN="left"><TH NOWRAP>\1</TH><TH WIDTH="100%">\2</TH></TR></TABLE>"
ALIASES += reqref{1}="@ref \1 \"\1\""
ALIASES += termdef{2}="@anchor term_\1 @par \2"
ALIASES += termref{2}="@ref term_\1 \"\2\""
ALIASES += termref{1}="@ref term_\1"
TCL_SUBST =
OPTIMIZE_OUTPUT_FOR_C = YES
@ -150,8 +150,7 @@ EXCLUDE = \
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS = \
QP_IMPL
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = \
snippets \
@ -314,7 +313,7 @@ EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = Q_SPY
PREDEFINED = Q_SPY QP_IMPL
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------

View File

@ -28,13 +28,12 @@ INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES += next{1}="<hr><b>Next:</b> @ref \1</p>"
ALIASES += description="@par <b>Description</b>@n"
ALIASES += description="@par <b>Description</b>"
ALIASES += hint="@par <b>Hint</b>@n"
ALIASES += usage="@par <b>Usage</b>@n"
ALIASES += reqdef{2}="<div class="vmargin20"></div>@anchor \1 <TABLE><TR ALIGN="left"><TH NOWRAP>\1</TH><TH WIDTH="100%">\2</TH></TR></TABLE>"
ALIASES += reqref{1}="@ref \1 \"\1\""
#ALIASES += termdef{2}="@anchor term_\1 @par \2"
ALIASES += termdef{2}="@subsection term_\1 \2"
ALIASES += termdef{2}="@anchor term_\1 @par \2"
ALIASES += termref{1}="@ref term_\1"
TCL_SUBST =
@ -149,8 +148,7 @@ EXCLUDE = \
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS = \
QP_IMPL
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = \
snippets \
@ -313,7 +311,7 @@ EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = Q_SPY
PREDEFINED = Q_SPY QP_IMPL
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------

View File

@ -44,6 +44,8 @@ Changes in detail:
15. Modified Makefiles for the EK-TM4C123GXL board with GNU-ARM toolset to define the symbol TARGET_IS_TM4C123_RB1 for compatibility with the updated 3rd-party files.
16. Implemented Feature Request #110 as well as the duplicate Request #62 by adding function QActive_flushDeferred()
------------------------------------------------------------------------------
@section qpc_5_6_1 Version 5.6.1, 2016-01-01

View File

@ -42,12 +42,6 @@
/*! This macro defines the type of the thread handle used for the
* active objects. */
/**
* The thread type in QK is the pointer to the thread-local storage (TLS).
* This thread-local storage can be set on per-thread basis in
* QActive_start(). Later, the QK scheduler uses this pointer for extended
* context switch and passes the pointer to the macro #QK_TLS.
*/
#define QF_THREAD_TYPE void *
/*! Platform-dependent macro defining how QF should block the

View File

@ -9,7 +9,7 @@
License Type: Windows Single User License
Licensed To : Quantum Leaps, LLC
License No. : WS2975 License Date: Dec 15, 2013
Build Date : Sep 2 2009 Run Date: Mar 30, 2016
Build Date : Sep 2 2009 Run Date: Mar 31, 2016
(C)1996-2009 M Squared Technologies LLC
________________________________________________________________________
@ -61,7 +61,7 @@
~~ Total File Summary ~~
LOC 77 eLOC 77 lLOC 20 Comment 118 Lines 212
LOC 78 eLOC 78 lLOC 21 Comment 118 Lines 213
________________________________________________________________________
End of File: ..\include\qk.h
@ -148,7 +148,7 @@
~~ Total File Summary ~~
LOC 85 eLOC 84 lLOC 30 Comment 115 Lines 208
LOC 86 eLOC 85 lLOC 31 Comment 115 Lines 210
________________________________________________________________________
End of File: ..\include\qxk.h
@ -725,9 +725,9 @@
Cyclomatic Complexity Vg Detail
Function Base : 1
Loops while / do : 3
Conditional if / else if: 5
Complexity Param 1 Return 1 Cyclo Vg 9 Total 11
LOC 61 eLOC 48 lLOC 34 Comment 55 Lines 106
Conditional if / else if: 4
Complexity Param 1 Return 1 Cyclo Vg 8 Total 10
LOC 54 eLOC 42 lLOC 29 Comment 52 Lines 98
Function: QActive_subscribe
Parameters: (QActive const * const me, enum_t const sig)
@ -759,27 +759,27 @@
~~ Total File Summary ~~
LOC 144 eLOC 124 lLOC 69 Comment 211 Lines 369
LOC 137 eLOC 118 lLOC 64 Comment 208 Lines 361
------------------------------------------------------------------------
~~ File Functional Summary ~~
File Function Count....: 5
Total Function LOC.....: 127 Total Function Pts LOC : 1.1
Total Function eLOC....: 107 Total Function Pts eLOC: 1.0
Total Function lLOC....: 67 Total Function Pts lLOC: 0.5
Total Function LOC.....: 120 Total Function Pts LOC : 1.1
Total Function eLOC....: 101 Total Function Pts eLOC: 0.9
Total Function lLOC....: 62 Total Function Pts lLOC: 0.5
Total Function Params .: 8 Total Function Return .: 5
Total Cyclo Complexity : 25 Total Function Complex.: 38
Total Cyclo Complexity : 24 Total Function Complex.: 37
------ ----- ----- ------ ------ -----
Max Function LOC ......: 61 Average Function LOC ..: 25.40
Max Function eLOC .....: 48 Average Function eLOC .: 21.40
Max Function lLOC .....: 34 Average Function lLOC .: 13.40
Max Function LOC ......: 54 Average Function LOC ..: 24.00
Max Function eLOC .....: 42 Average Function eLOC .: 20.20
Max Function lLOC .....: 29 Average Function lLOC .: 12.40
------ ----- ----- ------ ------ -----
Max Function Parameters: 2 Avg Function Parameters: 1.60
Max Function Returns ..: 1 Avg Function Returns ..: 1.00
Max Interface Complex. : 3 Avg Interface Complex. : 2.60
Max Cyclomatic Complex.: 9 Avg Cyclomatic Complex.: 5.00
Max Total Complexity ..: 11 Avg Total Complexity ..: 7.60
Max Cyclomatic Complex.: 8 Avg Cyclomatic Complex.: 4.80
Max Total Complexity ..: 10 Avg Total Complexity ..: 7.40
________________________________________________________________________
End of File: ..\source\qf_ps.c
@ -1108,49 +1108,51 @@
Function: QMutex_init
Parameters: (QMutex * const me, uint_fast8_t prio)
Complexity Param 2 Return 1 Cyclo Vg 1 Total 4
LOC 3 eLOC 2 lLOC 1 Comment 17 Lines 3
LOC 4 eLOC 3 lLOC 2 Comment 17 Lines 4
Function: QMutex_lock
Parameters: (QMutex * const me)
Cyclomatic Complexity Vg Detail
Function Base : 1
Conditional if / else if: 1
Complexity Param 1 Return 1 Cyclo Vg 2 Total 4
LOC 15 eLOC 13 lLOC 7 Comment 26 Lines 20
Logical and ( && ) : 1
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 16 eLOC 14 lLOC 7 Comment 28 Lines 23
Function: QMutex_unlock
Parameters: (QMutex const * const me)
Parameters: (QMutex * const me)
Cyclomatic Complexity Vg Detail
Function Base : 1
Conditional if / else if: 2
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 20 eLOC 17 lLOC 10 Comment 27 Lines 24
Logical and ( && ) : 1
Complexity Param 1 Return 1 Cyclo Vg 4 Total 6
LOC 22 eLOC 19 lLOC 11 Comment 29 Lines 29
------------------------------------------------------------------------
~~ Total File Summary ~~
LOC 51 eLOC 45 lLOC 18 Comment 119 Lines 161
LOC 58 eLOC 51 lLOC 21 Comment 123 Lines 174
------------------------------------------------------------------------
~~ File Functional Summary ~~
File Function Count....: 3
Total Function LOC.....: 38 Total Function Pts LOC : 0.4
Total Function eLOC....: 32 Total Function Pts eLOC: 0.4
Total Function lLOC....: 18 Total Function Pts lLOC: 0.1
Total Function LOC.....: 42 Total Function Pts LOC : 0.5
Total Function eLOC....: 36 Total Function Pts eLOC: 0.4
Total Function lLOC....: 20 Total Function Pts lLOC: 0.2
Total Function Params .: 4 Total Function Return .: 3
Total Cyclo Complexity : 6 Total Function Complex.: 13
Total Cyclo Complexity : 8 Total Function Complex.: 15
------ ----- ----- ------ ------ -----
Max Function LOC ......: 20 Average Function LOC ..: 12.67
Max Function eLOC .....: 17 Average Function eLOC .: 10.67
Max Function lLOC .....: 10 Average Function lLOC .: 6.00
Max Function LOC ......: 22 Average Function LOC ..: 14.00
Max Function eLOC .....: 19 Average Function eLOC .: 12.00
Max Function lLOC .....: 11 Average Function lLOC .: 6.67
------ ----- ----- ------ ------ -----
Max Function Parameters: 2 Avg Function Parameters: 1.33
Max Function Returns ..: 1 Avg Function Returns ..: 1.00
Max Interface Complex. : 3 Avg Interface Complex. : 2.33
Max Cyclomatic Complex.: 3 Avg Cyclomatic Complex.: 2.00
Max Total Complexity ..: 5 Avg Total Complexity ..: 4.33
Max Cyclomatic Complex.: 4 Avg Cyclomatic Complex.: 2.67
Max Total Complexity ..: 6 Avg Total Complexity ..: 5.00
________________________________________________________________________
End of File: ..\source\qk_mutex.c
@ -1627,7 +1629,7 @@
Function: QF_run
Parameters: (void)
Complexity Param 0 Return 1 Cyclo Vg 1 Total 2
LOC 10 eLOC 9 lLOC 8 Comment 20 Lines 19
LOC 11 eLOC 10 lLOC 9 Comment 21 Lines 20
Function: QActive_start_
Parameters: (QMActive * const me, uint_fast8_t prio, QEvt const *qSto[],
@ -1670,21 +1672,21 @@
~~ Total File Summary ~~
LOC 127 eLOC 111 lLOC 67 Comment 197 Lines 335
LOC 128 eLOC 112 lLOC 68 Comment 198 Lines 336
------------------------------------------------------------------------
~~ File Functional Summary ~~
File Function Count....: 10
Total Function LOC.....: 106 Total Function Pts LOC : 1.0
Total Function eLOC....: 90 Total Function Pts eLOC: 0.9
Total Function lLOC....: 63 Total Function Pts lLOC: 0.5
Total Function LOC.....: 107 Total Function Pts LOC : 1.0
Total Function eLOC....: 91 Total Function Pts eLOC: 0.9
Total Function lLOC....: 64 Total Function Pts lLOC: 0.5
Total Function Params .: 12 Total Function Return .: 10
Total Cyclo Complexity : 21 Total Function Complex.: 43
------ ----- ----- ------ ------ -----
Max Function LOC ......: 21 Average Function LOC ..: 10.60
Max Function eLOC .....: 18 Average Function eLOC .: 9.00
Max Function lLOC .....: 11 Average Function lLOC .: 6.30
Max Function LOC ......: 21 Average Function LOC ..: 10.70
Max Function eLOC .....: 18 Average Function eLOC .: 9.10
Max Function lLOC .....: 11 Average Function lLOC .: 6.40
------ ----- ----- ------ ------ -----
Max Function Parameters: 7 Avg Function Parameters: 1.20
Max Function Returns ..: 1 Avg Function Returns ..: 1.00
@ -1701,7 +1703,7 @@
Function: QXMutex_init
Parameters: (QXMutex * const me, uint_fast8_t prio)
Complexity Param 2 Return 1 Cyclo Vg 1 Total 4
LOC 3 eLOC 2 lLOC 1 Comment 17 Lines 3
LOC 4 eLOC 3 lLOC 2 Comment 17 Lines 4
Function: QXMutex_lock
Parameters: (QXMutex * const me)
@ -1709,42 +1711,44 @@
Function Base : 1
Conditional if / else if: 1
Inlined if-else ( ? : ) : 1
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 20 eLOC 18 lLOC 10 Comment 31 Lines 29
Logical and ( && ) : 1
Complexity Param 1 Return 1 Cyclo Vg 4 Total 6
LOC 20 eLOC 18 lLOC 9 Comment 32 Lines 28
Function: QXMutex_unlock
Parameters: (QXMutex const * const me)
Parameters: (QXMutex * const me)
Cyclomatic Complexity Vg Detail
Function Base : 1
Conditional if / else if: 2
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 20 eLOC 17 lLOC 10 Comment 28 Lines 25
Logical and ( && ) : 1
Complexity Param 1 Return 1 Cyclo Vg 4 Total 6
LOC 22 eLOC 19 lLOC 11 Comment 30 Lines 29
------------------------------------------------------------------------
~~ Total File Summary ~~
LOC 56 eLOC 50 lLOC 21 Comment 125 Lines 174
LOC 62 eLOC 55 lLOC 23 Comment 128 Lines 182
------------------------------------------------------------------------
~~ File Functional Summary ~~
File Function Count....: 3
Total Function LOC.....: 43 Total Function Pts LOC : 0.4
Total Function eLOC....: 37 Total Function Pts eLOC: 0.4
Total Function lLOC....: 21 Total Function Pts lLOC: 0.2
Total Function LOC.....: 46 Total Function Pts LOC : 0.5
Total Function eLOC....: 40 Total Function Pts eLOC: 0.4
Total Function lLOC....: 22 Total Function Pts lLOC: 0.2
Total Function Params .: 4 Total Function Return .: 3
Total Cyclo Complexity : 7 Total Function Complex.: 14
Total Cyclo Complexity : 9 Total Function Complex.: 16
------ ----- ----- ------ ------ -----
Max Function LOC ......: 20 Average Function LOC ..: 14.33
Max Function eLOC .....: 18 Average Function eLOC .: 12.33
Max Function lLOC .....: 10 Average Function lLOC .: 7.00
Max Function LOC ......: 22 Average Function LOC ..: 15.33
Max Function eLOC .....: 19 Average Function eLOC .: 13.33
Max Function lLOC .....: 11 Average Function lLOC .: 7.33
------ ----- ----- ------ ------ -----
Max Function Parameters: 2 Avg Function Parameters: 1.33
Max Function Returns ..: 1 Avg Function Returns ..: 1.00
Max Interface Complex. : 3 Avg Interface Complex. : 2.33
Max Cyclomatic Complex.: 3 Avg Cyclomatic Complex.: 2.33
Max Total Complexity ..: 5 Avg Total Complexity ..: 4.67
Max Cyclomatic Complex.: 4 Avg Cyclomatic Complex.: 3.00
Max Total Complexity ..: 6 Avg Total Complexity ..: 5.33
________________________________________________________________________
End of File: ..\source\qxk_mutex.c
@ -1949,9 +1953,9 @@
~~ Total Project Summary ~~
LOC 5120 eLOC 4591 lLOC 2183 Comment 7116 Lines 12438
LOC 5129 eLOC 4599 lLOC 2186 Comment 7121 Lines 12455
Average per File, metric/41 files
LOC 124 eLOC 111 lLOC 53 Comment 173 Lines 303
LOC 125 eLOC 112 lLOC 53 Comment 173 Lines 303
------------------------------------------------------------------------
@ -2145,8 +2149,8 @@
Function: QF_publish_
Parameters: (QEvt const * const e)
Complexity Param 1 Return 1 Cyclo Vg 9 Total 11
LOC 61 eLOC 48 lLOC 34 Comment 55 Lines 106
Complexity Param 1 Return 1 Cyclo Vg 8 Total 10
LOC 54 eLOC 42 lLOC 29 Comment 52 Lines 98
Function: QActive_subscribe
Parameters: (QActive const * const me, enum_t const sig)
@ -2277,17 +2281,17 @@
Function: QMutex_init
Parameters: (QMutex * const me, uint_fast8_t prio)
Complexity Param 2 Return 1 Cyclo Vg 1 Total 4
LOC 3 eLOC 2 lLOC 1 Comment 17 Lines 3
LOC 4 eLOC 3 lLOC 2 Comment 17 Lines 4
Function: QMutex_lock
Parameters: (QMutex * const me)
Complexity Param 1 Return 1 Cyclo Vg 2 Total 4
LOC 15 eLOC 13 lLOC 7 Comment 26 Lines 20
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 16 eLOC 14 lLOC 7 Comment 28 Lines 23
Function: QMutex_unlock
Parameters: (QMutex const * const me)
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 20 eLOC 17 lLOC 10 Comment 27 Lines 24
Parameters: (QMutex * const me)
Complexity Param 1 Return 1 Cyclo Vg 4 Total 6
LOC 22 eLOC 19 lLOC 11 Comment 29 Lines 29
Function: QS_initBuf
Parameters: (uint8_t sto[], uint_fast16_t stoSize)
@ -2498,7 +2502,7 @@
Function: QF_run
Parameters: (void)
Complexity Param 0 Return 1 Cyclo Vg 1 Total 2
LOC 10 eLOC 9 lLOC 8 Comment 20 Lines 19
LOC 11 eLOC 10 lLOC 9 Comment 21 Lines 20
Function: QActive_start_
Parameters: (QMActive * const me, uint_fast8_t prio, QEvt const *qSto[],
@ -2530,17 +2534,17 @@
Function: QXMutex_init
Parameters: (QXMutex * const me, uint_fast8_t prio)
Complexity Param 2 Return 1 Cyclo Vg 1 Total 4
LOC 3 eLOC 2 lLOC 1 Comment 17 Lines 3
LOC 4 eLOC 3 lLOC 2 Comment 17 Lines 4
Function: QXMutex_lock
Parameters: (QXMutex * const me)
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 20 eLOC 18 lLOC 10 Comment 31 Lines 29
Complexity Param 1 Return 1 Cyclo Vg 4 Total 6
LOC 20 eLOC 18 lLOC 9 Comment 32 Lines 28
Function: QXMutex_unlock
Parameters: (QXMutex const * const me)
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 20 eLOC 17 lLOC 10 Comment 28 Lines 25
Parameters: (QXMutex * const me)
Complexity Param 1 Return 1 Cyclo Vg 4 Total 6
LOC 22 eLOC 19 lLOC 11 Comment 30 Lines 29
Function: QXSemaphore_init
Parameters: (QXSemaphore * const me, uint_fast16_t count)
@ -2639,26 +2643,26 @@
LOC 54 eLOC 46 lLOC 33 Comment 25 Lines 70
Total: Functions
LOC 3009 eLOC 2512 lLOC 1663 InCmp 348 CycloCmp 473
LOC 3010 eLOC 2514 lLOC 1662 InCmp 348 CycloCmp 476
Function Points FP(LOC) 23.5 FP(eLOC) 19.6 FP(lLOC) 13.0
------------------------------------------------------------------------
~~ Project Functional Analysis ~~
Total Functions .......: 132 Total Physical Lines ..: 3949
Total LOC .............: 3009 Total Function Pts LOC : 23.5
Total eLOC ............: 2512 Total Function Pts eLOC: 19.6
Total lLOC.............: 1663 Total Function Pts lLOC: 13.0
Total Cyclomatic Comp. : 473 Total Interface Comp. .: 348
Total Functions .......: 132 Total Physical Lines ..: 3955
Total LOC .............: 3010 Total Function Pts LOC : 23.5
Total eLOC ............: 2514 Total Function Pts eLOC: 19.6
Total lLOC.............: 1662 Total Function Pts lLOC: 13.0
Total Cyclomatic Comp. : 476 Total Interface Comp. .: 348
Total Parameters ......: 216 Total Return Points ...: 132
Total Comment Lines ...: 2699 Total Blank Lines .....: 511
Total Comment Lines ...: 2704 Total Blank Lines .....: 510
------ ----- ----- ------ ------ -----
Avg Physical Lines ....: 29.92
Avg LOC ...............: 22.80 Avg eLOC ..............: 19.03
Avg lLOC ..............: 12.60 Avg Cyclomatic Comp. ..: 3.58
Avg Physical Lines ....: 29.96
Avg LOC ...............: 22.80 Avg eLOC ..............: 19.05
Avg lLOC ..............: 12.59 Avg Cyclomatic Comp. ..: 3.61
Avg Interface Comp. ...: 2.64 Avg Parameters ........: 1.64
Avg Return Points .....: 1.00 Avg Comment Lines .....: 20.45
Avg Return Points .....: 1.00 Avg Comment Lines .....: 20.48
------ ----- ----- ------ ------ -----
Max LOC ...............: 254
Max eLOC ..............: 197 Max lLOC ..............: 125

View File

@ -252,7 +252,7 @@ uint32_t BSP_random(void) { /* a very cheap pseudo-random-number generator */
}
/*..........................................................................*/
void BSP_randomSeed(uint32_t seed) {
QXMutex_init(&l_rndMutex, (N_PHILO + 1));
QXMutex_init(&l_rndMutex, N_PHILO); /* ceiling <== max Philo priority */
l_rnd = seed;
}
/*..........................................................................*/
@ -438,7 +438,7 @@ void QS_onFlush(void) {
while ((UART0->FR & UART_FR_TXFE) == 0) {
}
while (fifo-- != 0) { /* any bytes in the block? */
while (fifo-- != 0U) { /* any bytes in the block? */
UART0->DR = *block++; /* put into the TX FIFO */
}
fifo = UART_TXFIFO_DEPTH; /* re-load the Tx FIFO depth */

View File

@ -6,7 +6,7 @@
* @cond
******************************************************************************
* Last updated for version 5.6.2
* Last updated on 2016-03-29
* Last updated on 2016-03-31
*
* Q u a n t u m L e a P s
* ---------------------------
@ -129,7 +129,7 @@ void QMutex_init(QMutex * const me, uint_fast8_t prio);
void QMutex_lock(QMutex * const me);
/*! QMutex unlock */
void QMutex_unlock(QMutex const * const me);
void QMutex_unlock(QMutex * const me);
extern uint_fast8_t volatile QK_lockPrio_; /*!< lock prio (0 == no-lock) */
@ -158,10 +158,11 @@ extern uint_fast8_t volatile QK_lockPrio_; /*!< lock prio (0 == no-lock) */
#define QF_SCHED_STAT_TYPE_ QMutex
/*! Internal port-specific macro for selective scheduler locking. */
#define QF_SCHED_LOCK_(pLockStat_) do { \
#define QF_SCHED_LOCK_(pLockStat_, prio_) do { \
if (QK_ISR_CONTEXT_()) { \
(pLockStat_)->lockPrio = (uint_fast8_t)(QF_MAX_ACTIVE + 1); \
} else { \
QMutex_init((pLockStat_), (prio_)); \
QMutex_lock((pLockStat_)); \
} \
} while (0)

View File

@ -6,7 +6,7 @@
* @cond
******************************************************************************
* Last updated for version 5.6.2
* Last updated on 2016-03-29
* Last updated on 2016-03-31
*
* Q u a n t u m L e a P s
* ---------------------------
@ -86,7 +86,7 @@ void QV_onIdle(void);
/* QF-specific scheduler locking (not needed in QV) */
#define QF_SCHED_STAT_TYPE_ struct { uint_fast8_t lockPrio; }
#define QF_SCHED_LOCK_(pLockStat_) \
#define QF_SCHED_LOCK_(pLockStat_, dummy) \
((pLockStat_)->lockPrio = (uint_fast8_t)(QF_MAX_ACTIVE + 1))
#define QF_SCHED_UNLOCK_(dummy) ((void)0)

View File

@ -6,7 +6,7 @@
* @cond
******************************************************************************
* Last updated for version 5.6.2
* Last updated on 2016-03-30
* Last updated on 2016-03-31
*
* Q u a n t u m L e a P s
* ---------------------------
@ -138,7 +138,7 @@ void QXMutex_init(QXMutex * const me, uint_fast8_t prio);
void QXMutex_lock(QXMutex * const me);
/*! QXMutex unlock */
void QXMutex_unlock(QXMutex const * const me);
void QXMutex_unlock(QXMutex * const me);
/****************************************************************************/
/* interface used only inside QP implementation, but not in applications */
@ -156,13 +156,15 @@ void QXMutex_unlock(QXMutex const * const me);
/* QF-specific scheduler locking */
#define QF_SCHED_STAT_TYPE_ QXMutex
#define QF_SCHED_LOCK_(pLockStat_) do { \
#define QF_SCHED_LOCK_(pLockStat_, prio_) do { \
if (QXK_ISR_CONTEXT_()) { \
(pLockStat_)->lockPrio = (uint_fast8_t)(QF_MAX_ACTIVE + 1); \
} else { \
QXMutex_init((pLockStat_), (prio_)); \
QXMutex_lock((pLockStat_)); \
} \
} while (0)
#define QF_SCHED_UNLOCK_(pLockStat_) QXMutex_unlock((pLockStat_))
#if (QF_MAX_ACTIVE <= 8)

View File

@ -5,7 +5,7 @@
* @cond
******************************************************************************
* Last Updated for Version: 5.6.2
* Date of the Last Update: 2016-03-29
* Date of the Last Update: 2016-03-31
*
* Q u a n t u m L e a P s
* ---------------------------
@ -76,10 +76,11 @@ void QF_setEmbOsTaskAttr(QActive *act, uint32_t attr);
/* QF-specific scheduler locking, see NOTE3 */
#define QF_SCHED_STAT_TYPE_ struct { uint_fast8_t lockPrio; }
#define QF_SCHED_LOCK_(pLockStat_) do { \
#define QF_SCHED_LOCK_(pLockStat_, prio_) do { \
if (OS_InInt != (OS_U8)0) { \
(pLockStat_)->lockPrio = (uint_fast8_t)(QF_MAX_ACTIVE + 1); \
} else { \
(pLockStat_)->lockPrio = (prio_); \
OS_EnterRegion(); \
} \
} while (0)

View File

@ -84,24 +84,6 @@
QF_INT_ENABLE(); \
} while (0)
/* QF-specific scheduler locking */
/*! Internal port-specific macro to represent the scheduler lock status
* that needs to be preserved to allow nesting of locks.
*/
#define QF_SCHED_STAT_TYPE_ QMutex
/*! Internal port-specific macro for selective scheduler locking. */
#define QF_SCHED_LOCK_(pLockStat_) do { \
if (QK_ISR_CONTEXT_()) { \
(pLockStat_)->lockPrio = (uint_fast8_t)(QF_MAX_ACTIVE + 1); \
} else { \
QMutex_lock((pLockStat_)); \
} \
} while (0)
/*! Internal port-specific macro for selective scheduler unlocking. */
#define QF_SCHED_UNLOCK_(pLockStat_) QMutex_unlock((pLockStat_))
#include "qk.h" /* QK platform-independent public interface */

View File

@ -3,14 +3,14 @@
* @brief QF/C port to POSIX threads (pthreads)
* @cond
******************************************************************************
* Last Updated for Version: 5.4.0
* Date of the Last Update: 2015-04-08
* Last Updated for Version: 5.6.2
* Date of the Last Update: 2016-03-31
*
* Q u a n t u m L e a P s
* ---------------------------
* innovating embedded systems
*
* Copyright (C) Quantum Leaps, LLC. state-machine.com.
* Copyright (C) Quantum Leaps, LLC. All rights reserved.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@ -31,8 +31,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Contact information:
* Web: www.state-machine.com
* Email: info@state-machine.com
* http://www.state-machine.com
* mailto:info@state-machine.com
******************************************************************************
* @endcond
*/
@ -83,7 +83,7 @@ extern pthread_mutex_t QF_pThreadMutex_; /* mutex for QF critical section */
/* QF-specific scheduler locking (not used at this point) */
#define QF_SCHED_STAT_TYPE_ struct { uint_fast8_t lockPrio; }
#define QF_SCHED_LOCK_(pLockStat_) \
#define QF_SCHED_LOCK_(pLockStat_, dummy) \
((pLockStat_)->lockPrio = (uint_fast8_t)(QF_MAX_ACTIVE + 1))
#define QF_SCHED_UNLOCK_(dummy) ((void)0)

View File

@ -231,7 +231,7 @@ QEvt const *QActive_get_(QActive * const me) {
}
/*..........................................................................*/
void QFSchedLock_(QFSchedLock * const lockStat) {
void QFSchedLock_(QFSchedLock * const lockStat, uint_fast8_t prio) {
QS_CRIT_STAT_
lockStat->lockHolder = tx_thread_identify();
@ -240,9 +240,10 @@ void QFSchedLock_(QFSchedLock * const lockStat) {
/* change the preemption threshold of the current thread */
Q_ALLEGE_ID(710, tx_thread_preemption_change(lockStat->lockHolder,
(QF_TX_PRIO_OFFSET + QF_MAX_ACTIVE - lockStat->lockPrio),
(QF_TX_PRIO_OFFSET + QF_MAX_ACTIVE - prio),
&lockStat->prevThre) == TX_SUCCESS);
lockStat->lockPrio = prio;
QS_BEGIN_(QS_SCHED_LOCK, (void *)0, (void *)0)
QS_TIME_(); /* timestamp */
QS_2U8_((uint8_t)(QF_TX_PRIO_OFFSET + QF_MAX_ACTIVE

View File

@ -4,7 +4,7 @@
* @cond
******************************************************************************
* Last Updated for Version: 5.6.2
* Date of the Last Update: 2016-03-29
* Date of the Last Update: 2016-03-31
*
* Q u a n t u m L e a P s
* ---------------------------
@ -75,17 +75,17 @@
} QFSchedLock;
#define QF_SCHED_STAT_TYPE_ QFSchedLock
#define QF_SCHED_LOCK_(pLockStat_) do { \
#define QF_SCHED_LOCK_(pLockStat_, prio_) do { \
if (_tx_thread_system_state != (UINT)0) { \
(pLockStat_)->lockPrio = (uint_fast8_t)(QF_MAX_ACTIVE + 1); \
} else { \
QFSchedLock_((pLockStat_)); \
QFSchedLock_((pLockStat_), (prio_)); \
} \
} while (0)
#define QF_SCHED_UNLOCK_(pLockStat_) QFSchedUnlock_((pLockStat_))
/* internal implementation of scheduler locking/unlocking */
void QFSchedLock_(QFSchedLock * const lockStat);
void QFSchedLock_(QFSchedLock * const lockStat, uint_fast8_t prio);
void QFSchedUnlock_(QFSchedLock const * const lockStat);
extern UINT _tx_thread_system_state; /* internal TX interrupt counter */

View File

@ -4,7 +4,7 @@
* @cond
******************************************************************************
* Last Updated for Version: 5.6.2
* Date of the Last Update: 2016-03-29
* Date of the Last Update: 2016-03-31
*
* Q u a n t u m L e a P s
* ---------------------------
@ -69,10 +69,11 @@ void QF_setUCosTaskAttr(QActive *act, uint32_t attr);
/* QF-specific scheduler locking, see NOTE2 */
#define QF_SCHED_STAT_TYPE_ struct { uint_fast8_t lockPrio; }
#define QF_SCHED_LOCK_(pLockStat_) do { \
#define QF_SCHED_LOCK_(pLockStat_, prio_) do { \
if (OSIntNesting != (INT8U)0) { \
(pLockStat_)->lockPrio = (uint_fast8_t)(QF_MAX_ACTIVE + 1); \
} else { \
(pLockStat_)->lockPrio = (prio_); \
OSSchedLock(); \
} \
} while (0)

View File

@ -4,7 +4,7 @@
* @cond
******************************************************************************
* Last Updated for Version: 5.6.2
* Date of the Last Update: 2016-03-30
* Date of the Last Update: 2016-03-31
*
* Q u a n t u m L e a P s
* ---------------------------
@ -129,7 +129,7 @@ void QF_onClockTick(void);
/* Win32-QV specific scheduler locking, see NOTE2 */
#define QF_SCHED_STAT_TYPE_ struct { uint_fast8_t lockPrio; }
#define QF_SCHED_LOCK_(pLockStat_) \
#define QF_SCHED_LOCK_(pLockStat_, dummy) \
((pLockStat_)->lockPrio = (uint_fast8_t)(QF_MAX_ACTIVE + 1))
#define QF_SCHED_UNLOCK_(dummy) ((void)0)

View File

@ -4,7 +4,7 @@
* @cond
******************************************************************************
* Last Updated for Version: 5.6.2
* Date of the Last Update: 2016-03-30
* Date of the Last Update: 2016-03-31
*
* Q u a n t u m L e a P s
* ---------------------------
@ -135,7 +135,7 @@ void QF_onClockTick(void);
/* Win32-specific scheduler locking, see NOTE2 */
#define QF_SCHED_STAT_TYPE_ struct { uint_fast8_t lockPrio; }
#define QF_SCHED_LOCK_(pLockStat_) do { \
#define QF_SCHED_LOCK_(pLockStat_, dummy) do { \
QF_enterCriticalSection_(); \
((pLockStat_)->lockPrio = (uint_fast8_t)QF_MAX_ACTIVE); \
} while (0)

View File

@ -5,7 +5,7 @@
* @cond
******************************************************************************
* Last updated for version 5.6.2
* Last updated on 2016-03-29
* Last updated on 2016-03-31
*
* Q u a n t u m L e a P s
* ---------------------------
@ -121,6 +121,7 @@ void QF_publish_(QEvt const * const e)
void QF_publish_(QEvt const * const e, void const * const sender)
#endif
{
QF_SCHED_STAT_TYPE_ lockStat;
QF_CRIT_STAT_
/** @pre the published signal must be within the configured range */
@ -141,11 +142,11 @@ void QF_publish_(QEvt const * const e, void const * const sender)
}
QF_CRIT_EXIT_();
lockStat.lockPrio = (uint_fast8_t)0xFF; /* set as uninitialized */
#if (QF_MAX_ACTIVE <= 8)
{
uint_fast8_t tmp = QF_subscrList_[e->sig].bits[0];
QF_SCHED_STAT_TYPE_ lockStat;
lockStat.lockPrio = (uint_fast8_t)0xFF; /* set as uninitialized */
while (tmp != (uint_fast8_t)0) {
/* find the most-significant bit number */
@ -156,8 +157,7 @@ void QF_publish_(QEvt const * const e, void const * const sender)
/* has the scheduler been locked yet? */
if (lockStat.lockPrio == (uint_fast8_t)0xFF) {
lockStat.lockPrio = p;
QF_SCHED_LOCK_(&lockStat);
QF_SCHED_LOCK_(&lockStat, p);
}
/* the prio of the AO must be registered with the framework */
@ -166,17 +166,10 @@ void QF_publish_(QEvt const * const e, void const * const sender)
/* QACTIVE_POST() asserts internally if the queue overflows */
QACTIVE_POST(QF_active_[p], e, sender);
}
/* was the scheduler locked? */
if (lockStat.lockPrio <= (uint_fast8_t)QF_MAX_ACTIVE) {
QF_SCHED_UNLOCK_(&lockStat); /* unlock the scheduler */
}
}
#else /* (QF_MAX_ACTIVE > 8) */
{
uint_fast8_t i = (uint_fast8_t)Q_DIM(QF_subscrList_[0].bits);
QF_SCHED_STAT_TYPE_ lockStat;
lockStat.lockPrio = (uint_fast8_t)0xFF; /* set as uninitialized */
/* go through all bytes in the subscription list */
do {
@ -196,8 +189,7 @@ void QF_publish_(QEvt const * const e, void const * const sender)
/* has the scheduler been locked yet? */
if (lockStat.lockPrio == (uint_fast8_t)0xFF) {
lockStat.lockPrio = p;
QF_SCHED_LOCK_(&lockStat);
QF_SCHED_LOCK_(&lockStat, p);
}
/* the prio of the AO must be registered with the framework */
@ -207,13 +199,13 @@ void QF_publish_(QEvt const * const e, void const * const sender)
QACTIVE_POST(QF_active_[p], e, sender);
}
} while (i != (uint_fast8_t)0);
}
#endif /* (QF_MAX_ACTIVE > 8) */
/* was the scheduler locked? */
if (lockStat.lockPrio <= (uint_fast8_t)QF_MAX_ACTIVE) {
QF_SCHED_UNLOCK_(&lockStat); /* unlock the scheduler */
}
}
#endif /* (QF_MAX_ACTIVE > 8) */
/* run the garbage collector */
QF_gc(e);

View File

@ -5,7 +5,7 @@
* @cond
******************************************************************************
* Last updated for version 5.6.2
* Last updated on 2016-03-29
* Last updated on 2016-03-31
*
* Q u a n t u m L e a P s
* ---------------------------
@ -54,6 +54,10 @@
Q_DEFINE_THIS_MODULE("qk_mutex")
enum {
MUTEX_UNUSED = 0xFF
};
/****************************************************************************/
/**
* @description
@ -68,11 +72,12 @@ Q_DEFINE_THIS_MODULE("qk_mutex")
* @sa QMutex_lock(), QMutex_unlock()
*
* @usage
* The following example shows how ti initialize, lock and unlock QK mutex:
* The following example shows how to initialize, lock and unlock QK mutex:
* @include qk_mux.c
*/
void QMutex_init(QMutex * const me, uint_fast8_t prio) {
me->lockPrio = prio;
me->prevPrio = (uint_fast8_t)MUTEX_UNUSED;
}
/****************************************************************************/
@ -92,15 +97,18 @@ void QMutex_init(QMutex * const me, uint_fast8_t prio) {
* @sa QMutex_init(), QMutex_unlock()
*
* @usage
* The following example shows how ti initialize, lock and unlock QXK mutex:
* The following example shows how to initialize, lock and unlock QK mutex:
* @include qk_mux.c
*/
void QMutex_lock(QMutex * const me) {
QF_CRIT_STAT_
QF_CRIT_ENTRY_();
/** @pre scheduler cannot be locked from the ISR context */
Q_REQUIRE_ID(700, !QK_ISR_CONTEXT_());
/** @pre scheduler cannot be locked from the ISR context
* and the mutex must be unused
*/
Q_REQUIRE_ID(700, (!QK_ISR_CONTEXT_())
&& (me->prevPrio == (uint_fast8_t)MUTEX_UNUSED));
me->prevPrio = QK_lockPrio_; /* save the previous prio */
if (QK_lockPrio_ < me->lockPrio) { /* raising the lock prio? */
@ -132,16 +140,19 @@ void QMutex_lock(QMutex * const me) {
* @sa QMutex_init(), QMutex_lock()
*
* @usage
* The following example shows how ti initialize, lock and unlock QXK mutex:
* The following example shows how to initialize, lock and unlock QK mutex:
* @include qk_mux.c
*/
void QMutex_unlock(QMutex const * const me) {
void QMutex_unlock(QMutex * const me) {
uint_fast8_t p;
QF_CRIT_STAT_
QF_CRIT_ENTRY_();
/** @pre scheduler cannot be unlocked from the ISR context */
Q_REQUIRE_ID(800, !QK_ISR_CONTEXT_());
/** @pre scheduler cannot be unlocked from the ISR context
* and the mutex must NOT be unused
*/
Q_REQUIRE_ID(800, (!QK_ISR_CONTEXT_())
&& (me->prevPrio != (uint_fast8_t)MUTEX_UNUSED));
QS_BEGIN_NOCRIT_(QS_SCHED_UNLOCK, (void *)0, (void *)0)
QS_TIME_(); /* timestamp */
@ -150,6 +161,8 @@ void QMutex_unlock(QMutex const * const me) {
QS_END_NOCRIT_()
p = me->prevPrio;
me->prevPrio = (uint_fast8_t)MUTEX_UNUSED;
if (QK_lockPrio_ > p) {
QK_lockPrio_ = p; /* restore the previous lock prio */
p = QK_schedPrio_(); /* find the highest-prio AO ready to run */

View File

@ -152,6 +152,7 @@ int_t QF_run(void) {
/* switch to the highest-priority task */
QF_INT_DISABLE();
QXK_attr_.curr = &l_idleThread; /* mark QXK as running */
QXK_prioFindMax(&QXK_attr_.readySet, p);
QXK_attr_.next = QF_active_[p];
QXK_start_(); /* start QXK multitasking (NOTE: enables interrupts) */

View File

@ -5,7 +5,7 @@
* @cond
******************************************************************************
* Last updated for version 5.6.2
* Last updated on 2016-03-30
* Last updated on 2016-03-31
*
* Q u a n t u m L e a P s
* ---------------------------
@ -54,6 +54,10 @@
Q_DEFINE_THIS_MODULE("qxk_mutex")
enum {
MUTEX_UNUSED = 0xFF
};
/****************************************************************************/
/**
* @description
@ -68,11 +72,12 @@ Q_DEFINE_THIS_MODULE("qxk_mutex")
* @sa QXMutex_lock(), QXMutex_unlock()
*
* @usage
* The following example shows how ti initialize, lock and unlock QXK mutex:
* The following example shows how to initialize, lock and unlock QXK mutex:
* @include qxk_mux.c
*/
void QXMutex_init(QXMutex * const me, uint_fast8_t prio) {
me->lockPrio = prio;
me->prevPrio = (uint_fast8_t)MUTEX_UNUSED;
}
/****************************************************************************/
@ -95,23 +100,22 @@ void QXMutex_init(QXMutex * const me, uint_fast8_t prio) {
* @sa QXMutex_init(), QXMutex_unlock()
*
* @usage
* The following example shows how ti initialize, lock and unlock QXK mutex:
* The following example shows how to initialize, lock and unlock QXK mutex:
* @include qxk_mux.c
*/
void QXMutex_lock(QXMutex * const me) {
QF_CRIT_STAT_
QF_CRIT_ENTRY_();
/** @pre scheduler cannot be locked from the ISR context */
Q_REQUIRE_ID(700, !QXK_ISR_CONTEXT_());
/** @pre scheduler cannot be locked from the ISR context */
Q_REQUIRE_ID(700, !QXK_ISR_CONTEXT_());
/** @pre scheduler cannot be locked from the ISR context
* and the mutex must be unused
*/
Q_REQUIRE_ID(700, (!QXK_ISR_CONTEXT_())
&& (me->prevPrio == (uint_fast8_t)MUTEX_UNUSED));
me->prevPrio = QXK_attr_.lockPrio; /* save previous lock prio */
me->prevHolder = QXK_attr_.lockHolder; /* save previous lock holder */
if (QXK_attr_.lockPrio < me->lockPrio) { /* raising the lock prio? */
QXK_attr_.lockPrio = me->lockPrio;
}
@ -144,18 +148,22 @@ void QXMutex_lock(QXMutex * const me) {
* @sa QXMutex_init(), QXMutex_lock()
*
* @usage
* The following example shows how ti initialize, lock and unlock QXK mutex:
* The following example shows how to initialize, lock and unlock QXK mutex:
* @include qxk_mux.c
*/
void QXMutex_unlock(QXMutex const * const me) {
void QXMutex_unlock(QXMutex * const me) {
uint_fast8_t p;
QF_CRIT_STAT_
QF_CRIT_ENTRY_();
/** @pre scheduler cannot be unlocked from the ISR context */
Q_REQUIRE_ID(800, !QXK_ISR_CONTEXT_());
/** @pre scheduler cannot be unlocked from the ISR context
* and the mutex must NOT be unused
*/
Q_REQUIRE_ID(800, (!QXK_ISR_CONTEXT_())
&& (me->prevPrio != (uint_fast8_t)MUTEX_UNUSED));
p = me->prevPrio; /* the previouis lock prio */
me->prevPrio = (uint_fast8_t)MUTEX_UNUSED;
QS_BEGIN_NOCRIT_(QS_SCHED_UNLOCK, (void *)0, (void *)0)
QS_TIME_(); /* timestamp */

View File

@ -209,7 +209,7 @@ void QXThread_ctor(QXThread * const me,
/****************************************************************************/
/* must be called from within a critical section */
void QXThread_block_(QXThread * const me) {
/* the thread holding the lock cannot block! */
/*! @pre the thread holding the lock cannot block! */
Q_REQUIRE_ID(100, me->super.prio != QXK_attr_.lockPrio);
QXK_prioRemove(&QXK_attr_.readySet, me->super.prio);
QXK_sched_();