mirror of
https://github.com/QuantumLeaps/qpcpp.git
synced 2025-01-28 06:02:56 +08:00
5.7.3
This commit is contained in:
parent
655608b020
commit
4508bc7580
3
.gitignore
vendored
3
.gitignore
vendored
@ -32,6 +32,7 @@
|
||||
lint*.txt
|
||||
*.Miro
|
||||
*.bak
|
||||
JLink*.*
|
||||
|
||||
eclipse/
|
||||
test/
|
||||
@ -41,6 +42,7 @@ rel/
|
||||
spy/
|
||||
settings/
|
||||
.settings/
|
||||
targetConfigs/
|
||||
|
||||
Debug/
|
||||
Release/
|
||||
@ -50,6 +52,7 @@ lib/
|
||||
obj/
|
||||
output/
|
||||
|
||||
|
||||
doxygen/html/
|
||||
lint/*.txt
|
||||
lint/MISRA_Exemplar_Suite_test/*.txt
|
@ -5,7 +5,7 @@
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = "QP/C++"
|
||||
PROJECT_NUMBER = "5.7.2"
|
||||
PROJECT_NUMBER = "5.7.3"
|
||||
PROJECT_BRIEF =
|
||||
PROJECT_LOGO = images/header_logo_ql.png
|
||||
OUTPUT_DIRECTORY =
|
||||
|
@ -5,7 +5,7 @@
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = "QP/C++"
|
||||
PROJECT_NUMBER = "5.7.2"
|
||||
PROJECT_NUMBER = "5.7.3"
|
||||
PROJECT_BRIEF =
|
||||
PROJECT_LOGO = images/header_logo_ql.png
|
||||
OUTPUT_DIRECTORY =
|
||||
|
@ -7,6 +7,7 @@ The main purpose of integrating QP/C++ with conventional RTOSes is to enable you
|
||||
|
||||
- @subpage exa_embos
|
||||
- @subpage exa_threadx
|
||||
- @subpage exa_ti-rtos
|
||||
- @subpage exa_ucos-ii
|
||||
|
||||
@note
|
||||
@ -91,6 +92,30 @@ Due to the limitations of the ThreadX library for Windows, the DPP example can o
|
||||
@next{exa_ucos-ii}
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_ti-rtos TI-RTOS
|
||||
@htmlonly
|
||||
<script src="preview.js" type="text/javascript"></script>
|
||||
@endhtmlonly
|
||||
|
||||
The QP/C++ examples for TI-RTOS are as follows:
|
||||
|
||||
- ARM Cortex-M
|
||||
- @subpage ti-rtos_dpp_ek-tm4c123gxl (Cortex-M4F) <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page ti-rtos_dpp_ek-tm4c123gxl DPP on EK-TM4C123GXL
|
||||
|
||||
@image html bd_EK-TM4C123GXL.jpg EK-TM4C123GXL board
|
||||
|
||||
DPP example for Texas Instruments TivaC123GXL MCU (Cortex-M4F) with CCS and IAR EWARM toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_ucos-ii uC/OS-II
|
||||
@htmlonly
|
||||
|
@ -2,7 +2,22 @@ namespace QP {
|
||||
|
||||
/** @page history Revision History
|
||||
|
||||
@section qpcpp_5_7_2 Version 5.7.2, 2016-10-07
|
||||
@section qpcpp_5_7_3 Version 5.7.3, 2016-10-07
|
||||
This release adds QP ports to the TI-RTOS kernel (SYS/BIOS) with TI-CCS
|
||||
and IAR EWARM toolsets. Examples are provided for the EK-TM4C123GXL
|
||||
(TivaC LaunchPad) in the directory:
|
||||
|
||||
qpcpp/examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl
|
||||
|
||||
NOTE: The examples require a separate installation of the TI-RTOS
|
||||
(file tirtos_tivac_setupwin32_2_16_01_14.exe)
|
||||
|
||||
Also, this release fixes the following bugs:
|
||||
- bug#140 (PendSV_Handler() exception stacked PC not halfword aligned).
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section qpcpp_5_7_2 Version 5.7.2, 2016-09-30
|
||||
This is the first production release of the "dual-mode" QXK kernel.
|
||||
"Dual-mode" QXK means that QXK supports both basic-threads (BC1 class
|
||||
from the OSEK/VDX RTOS specification) as well as extended-threads
|
||||
|
@ -1,8 +1,8 @@
|
||||
@echo off
|
||||
:: ==========================================================================
|
||||
:: Product: QP/C++ script for generating Doxygen documentation
|
||||
:: Last Updated for Version: 5.7.2
|
||||
:: Date of the Last Update: 2016-09-29
|
||||
:: Last Updated for Version: 5.7.3
|
||||
:: Date of the Last Update: 2016-10-06
|
||||
::
|
||||
:: Q u a n t u m L e a P s
|
||||
:: ---------------------------
|
||||
@ -38,7 +38,7 @@ echo usage:
|
||||
echo make
|
||||
echo make -CHM
|
||||
|
||||
set VERSION=5.7.2
|
||||
set VERSION=5.7.3
|
||||
|
||||
:: Generate Resource Standard Metrics for QP/C++ .............................
|
||||
set DOXHOME="C:\tools\doxygen\bin"
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @page metrics Code Metrics
|
||||
|
||||
@code
|
||||
Standard Code Metrics for QP/C++ 5.7.2
|
||||
Standard Code Metrics for QP/C++ 5.7.3
|
||||
|
||||
Resource Standard Metrics (TM) for C, C++, C# and Java
|
||||
Version 7.75 - mSquaredTechnologies.com
|
||||
@ -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: Sep 29, 2016
|
||||
Build Date : Sep 2 2009 Run Date: Oct 08, 2016
|
||||
(C)1996-2009 M Squared Technologies LLC
|
||||
________________________________________________________________________
|
||||
|
||||
@ -324,7 +324,7 @@
|
||||
|
||||
~~ Total File Summary ~~
|
||||
|
||||
LOC 82 eLOC 76 lLOC 28 Comment 106 Lines 204
|
||||
LOC 82 eLOC 76 lLOC 28 Comment 106 Lines 205
|
||||
------------------------------------------------------------------------
|
||||
|
||||
~~ File Functional Summary ~~
|
||||
@ -608,7 +608,7 @@
|
||||
|
||||
~~ Total File Summary ~~
|
||||
|
||||
LOC 38 eLOC 34 lLOC 4 Comment 80 Lines 129
|
||||
LOC 38 eLOC 34 lLOC 4 Comment 80 Lines 128
|
||||
------------------------------------------------------------------------
|
||||
|
||||
~~ File Functional Summary ~~
|
||||
@ -2452,9 +2452,9 @@
|
||||
Parameters: (QEvt const * const e, uint_fast16_t const margin)
|
||||
Cyclomatic Complexity Vg Detail
|
||||
Function Base : 1
|
||||
Conditional if / else if: 10
|
||||
Complexity Param 2 Return 1 Cyclo Vg 11 Total 14
|
||||
LOC 81 eLOC 65 lLOC 44 Comment 64 Lines 115
|
||||
Conditional if / else if: 9
|
||||
Complexity Param 2 Return 1 Cyclo Vg 10 Total 13
|
||||
LOC 79 eLOC 64 lLOC 44 Comment 63 Lines 111
|
||||
|
||||
Function: QP::QXThread::postLIFO
|
||||
Parameters: (QEvt const * const)
|
||||
@ -2518,27 +2518,27 @@
|
||||
|
||||
~~ Total File Summary ~~
|
||||
|
||||
LOC 294 eLOC 241 lLOC 136 Comment 294 Lines 595
|
||||
LOC 292 eLOC 240 lLOC 136 Comment 293 Lines 591
|
||||
------------------------------------------------------------------------
|
||||
|
||||
~~ File Functional Summary ~~
|
||||
|
||||
File Function Count....: 13
|
||||
Total Function LOC.....: 246 Total Function Pts LOC : 5.5
|
||||
Total Function eLOC....: 196 Total Function Pts eLOC: 4.5
|
||||
Total Function LOC.....: 244 Total Function Pts LOC : 5.5
|
||||
Total Function eLOC....: 195 Total Function Pts eLOC: 4.5
|
||||
Total Function lLOC....: 129 Total Function Pts lLOC: 2.6
|
||||
Total Function Params .: 20 Total Function Return .: 13
|
||||
Total Cyclo Complexity : 41 Total Function Complex.: 74
|
||||
Total Cyclo Complexity : 40 Total Function Complex.: 73
|
||||
------ ----- ----- ------ ------ -----
|
||||
Max Function LOC ......: 81 Average Function LOC ..: 18.92
|
||||
Max Function eLOC .....: 65 Average Function eLOC .: 15.08
|
||||
Max Function LOC ......: 79 Average Function LOC ..: 18.77
|
||||
Max Function eLOC .....: 64 Average Function eLOC .: 15.00
|
||||
Max Function lLOC .....: 44 Average Function lLOC .: 9.92
|
||||
------ ----- ----- ------ ------ -----
|
||||
Max Function Parameters: 6 Avg Function Parameters: 1.54
|
||||
Max Function Returns ..: 1 Avg Function Returns ..: 1.00
|
||||
Max Interface Complex. : 7 Avg Interface Complex. : 2.54
|
||||
Max Cyclomatic Complex.: 11 Avg Cyclomatic Complex.: 3.15
|
||||
Max Total Complexity ..: 14 Avg Total Complexity ..: 5.69
|
||||
Max Cyclomatic Complex.: 10 Avg Cyclomatic Complex.: 3.08
|
||||
Max Total Complexity ..: 14 Avg Total Complexity ..: 5.62
|
||||
________________________________________________________________________
|
||||
End of File: ..\source\qxk_xthr.cpp
|
||||
|
||||
@ -2551,7 +2551,7 @@
|
||||
|
||||
~~ Total Project Summary ~~
|
||||
|
||||
LOC 5668 eLOC 4955 lLOC 2331 Comment 6653 Lines 12609
|
||||
LOC 5666 eLOC 4954 lLOC 2331 Comment 6652 Lines 12605
|
||||
Average per File, metric/41 files
|
||||
LOC 138 eLOC 120 lLOC 56 Comment 162 Lines 307
|
||||
|
||||
@ -3536,8 +3536,8 @@
|
||||
|
||||
Function: QP::QXThread::post_
|
||||
Parameters: (QEvt const * const e, uint_fast16_t const margin)
|
||||
Complexity Param 2 Return 1 Cyclo Vg 11 Total 14
|
||||
LOC 81 eLOC 65 lLOC 44 Comment 64 Lines 115
|
||||
Complexity Param 2 Return 1 Cyclo Vg 10 Total 13
|
||||
LOC 79 eLOC 64 lLOC 44 Comment 63 Lines 111
|
||||
|
||||
Function: QP::QXThread::postLIFO
|
||||
Parameters: (QEvt const * const)
|
||||
@ -3581,26 +3581,26 @@
|
||||
LOC 14 eLOC 11 lLOC 7 Comment 2 Lines 16
|
||||
|
||||
Total: Functions
|
||||
LOC 3503 eLOC 2901 lLOC 1770 InCmp 404 CycloCmp 577
|
||||
Function Points FP(LOC) 61.3 FP(eLOC) 51.3 FP(lLOC) 31.6
|
||||
LOC 3501 eLOC 2900 lLOC 1770 InCmp 404 CycloCmp 576
|
||||
Function Points FP(LOC) 61.2 FP(eLOC) 51.3 FP(lLOC) 31.6
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
~~ Project Functional Analysis ~~
|
||||
|
||||
Total Functions .......: 200 Total Physical Lines ..: 4527
|
||||
Total LOC .............: 3503 Total Function Pts LOC : 61.3
|
||||
Total eLOC ............: 2901 Total Function Pts eLOC: 51.3
|
||||
Total Functions .......: 200 Total Physical Lines ..: 4523
|
||||
Total LOC .............: 3501 Total Function Pts LOC : 61.2
|
||||
Total eLOC ............: 2900 Total Function Pts eLOC: 51.3
|
||||
Total lLOC.............: 1770 Total Function Pts lLOC: 31.6
|
||||
Total Cyclomatic Comp. : 577 Total Interface Comp. .: 404
|
||||
Total Cyclomatic Comp. : 576 Total Interface Comp. .: 404
|
||||
Total Parameters ......: 204 Total Return Points ...: 200
|
||||
Total Comment Lines ...: 2811 Total Blank Lines .....: 534
|
||||
Total Comment Lines ...: 2810 Total Blank Lines .....: 533
|
||||
------ ----- ----- ------ ------ -----
|
||||
Avg Physical Lines ....: 22.64
|
||||
Avg LOC ...............: 17.52 Avg eLOC ..............: 14.51
|
||||
Avg Physical Lines ....: 22.61
|
||||
Avg LOC ...............: 17.50 Avg eLOC ..............: 14.50
|
||||
Avg lLOC ..............: 8.85 Avg Cyclomatic Comp. ..: 2.88
|
||||
Avg Interface Comp. ...: 2.02 Avg Parameters ........: 1.02
|
||||
Avg Return Points .....: 1.00 Avg Comment Lines .....: 14.06
|
||||
Avg Return Points .....: 1.00 Avg Comment Lines .....: 14.05
|
||||
------ ----- ----- ------ ------ -----
|
||||
Max LOC ...............: 260
|
||||
Max eLOC ..............: 202 Max lLOC ..............: 125
|
||||
|
@ -4,33 +4,24 @@ namespace QP {
|
||||
|
||||
The main purpose of integrating QP/C with conventional RTOSes is to enable you to incorporate various communication stacks (TCP/IP, USB, CAN, etc.) as well as other middleware, which requires the ability to **block** the task code.
|
||||
|
||||
- @subpage cmsis-rtx
|
||||
- @subpage embos
|
||||
- @subpage freertos
|
||||
- @subpage threadx
|
||||
- @subpage ti-rtos
|
||||
- @subpage ucos-ii
|
||||
|
||||
@attention
|
||||
Starting from version 5.6.0, QP/C++ includes the conventional, preemptive @ref qxk " blocking QXK kernel", which is recommended as the preferred RTOS kernel for applications that need to mix active objects with traditional blocking code. Due to the tight and optimal integration between QXK and the rest of QP, QXK offers better performance and smaller memory footprint than any @ref ports_rtos "QP port to a 3rd-party RTOS". Additionally, QXK is already included in QP, so you avoid additional licensing costs of 3rd-party kernels.
|
||||
|
||||
\n
|
||||
@note
|
||||
You do **not** need to use a traditional RTOS just to achieve preemptive multitasking with QP. The @ref comp_qk "preemptive QK kernel", available as part of the QP package, supports preemptive priority-based multitasking and is fully compatible with Rate Monotonic Scheduling to achieve guaranteed, hard real-time performance. The preemptive, run-to-completion QK kernel perfectly matches the run-to-completion execution semantics of active objects, yet it is simpler, faster, and more efficient than any traditional blocking kernel.
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page cmsis-rtx CMSIS-RTOS RTX
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page embos embOS
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page freertos FreeRTOS
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page threadx ThreadX
|
||||
@ -38,6 +29,24 @@ You do **not** need to use a traditional RTOS just to achieve preemptive multita
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page ti-rtos TI-RTOS Kernel (SYS/BIOS)
|
||||
|
||||
@section ti-rtos_about About the QP Port to TI-RTOS
|
||||
This directory contains a generic platform-independent QP/C++ port to TI-RTOS.
|
||||
|
||||
Typically, you should not need to change the files in this directory to adapt the QP-TI-RTOS port on any CPU/Compiler to which TI-RTOS has been ported, because all the CPU and compiler specifics are handled by the TI-RTOS.
|
||||
|
||||
@note
|
||||
The TI-RTOS is too big to fit into the 3rd_party directory in the QP/C distribution. Also, TI-RTOS requires its own tooling
|
||||
and build process (XDCTOOLS). Please refer to the TI Application Note "TI-RTOS 2.16 for TivaC Getting Started Guide" (Literature
|
||||
Number: SPRUHU5D) for more information.
|
||||
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page ucos-ii uC/OS-II
|
||||
|
||||
|
@ -210,13 +210,28 @@
|
||||
</folderInfo>
|
||||
<fileInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1276051254.QP/qxk_pkg.h" name="qxk_pkg.h" rcbsApplicability="disable" resourcePath="QP/qxk_pkg.h" toolsToInvoke=""/>
|
||||
<fileInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1276051254.QP/qxk_mutex.cpp" name="qxk_mutex.cpp" rcbsApplicability="disable" resourcePath="QP/qxk_mutex.cpp" toolsToInvoke="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477.1751506244">
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477.1751506244" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477"/>
|
||||
</fileInfo>
|
||||
<fileInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1276051254.QP/qxk_xthr.cpp" name="qxk_xthr.cpp" rcbsApplicability="disable" resourcePath="QP/qxk_xthr.cpp" toolsToInvoke="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477.1593791454">
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477.1593791454" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477.1751506244" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477">
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__C_SRCS.324954188" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__CPP_SRCS.53137168" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM_SRCS.706147212" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM2_SRCS.1888603182" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
</fileInfo>
|
||||
<fileInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1276051254.QP/qxk_sema.cpp" name="qxk_sema.cpp" rcbsApplicability="disable" resourcePath="QP/qxk_sema.cpp" toolsToInvoke="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477.337447945">
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477.337447945" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477.337447945" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477">
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__C_SRCS.1889834601" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__CPP_SRCS.931464350" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM_SRCS.835688389" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM2_SRCS.558769702" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
</fileInfo>
|
||||
<fileInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1276051254.QP/qxk_xthr.cpp" name="qxk_xthr.cpp" rcbsApplicability="disable" resourcePath="QP/qxk_xthr.cpp" toolsToInvoke="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477.1593791454">
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477.1593791454" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.2142755477">
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__C_SRCS.222220109" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__CPP_SRCS.1125032488" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM_SRCS.825444526" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM2_SRCS.1550541884" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
</fileInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="QP/qxk_mutex.cpp|QP/qxk_pkg.h|QP/qxk_sema.cpp|QP/qxk_xthr.cpp|QP/qxk.cpp|gnu_cpp/mini_cpp.cpp|QP/qv.cpp|QP/qs.cpp|QP/qs_rx.cpp|QP/qs_fp.cpp|QP/qs_64bit.cpp|ek-tm4c123gxl/iar/startup_TM4C123GH6PM.s|ek-tm4c123gxl/gnu/startup_TM4C123GH6PM.c|ek-tm4c123gxl/arm/startup_TM4C123GH6PM.s|QP/qv.c|QP/qs.c|QP/qs_rx.c|QP/qs_fp.c|QP/qs_64bit.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
|
94
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/Board.h
Normal file
94
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/Board.h
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Texas Instruments Incorporated
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_H
|
||||
#define __BOARD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "EK_TM4C123GXL.h"
|
||||
|
||||
#define Board_initDMA EK_TM4C123GXL_initDMA
|
||||
#define Board_initGeneral EK_TM4C123GXL_initGeneral
|
||||
#define Board_initGPIO EK_TM4C123GXL_initGPIO
|
||||
#define Board_initI2C EK_TM4C123GXL_initI2C
|
||||
#define Board_initPWM EK_TM4C123GXL_initPWM
|
||||
#define Board_initSDSPI EK_TM4C123GXL_initSDSPI
|
||||
#define Board_initSPI EK_TM4C123GXL_initSPI
|
||||
#define Board_initUART EK_TM4C123GXL_initUART
|
||||
#define Board_initUSB EK_TM4C123GXL_initUSB
|
||||
#define Board_initWatchdog EK_TM4C123GXL_initWatchdog
|
||||
#define Board_initWiFi EK_TM4C123GXL_initWiFi
|
||||
|
||||
#define Board_LED_ON EK_TM4C123GXL_LED_ON
|
||||
#define Board_LED_OFF EK_TM4C123GXL_LED_OFF
|
||||
#define Board_LED0 EK_TM4C123GXL_LED_BLUE
|
||||
#define Board_LED1 EK_TM4C123GXL_LED_GREEN
|
||||
#define Board_LED2 EK_TM4C123GXL_LED_RED
|
||||
#define Board_BUTTON0 EK_TM4C123GXL_SW1
|
||||
#define Board_BUTTON1 EK_TM4C123GXL_SW2
|
||||
|
||||
#define Board_I2C0 EK_TM4C123GXL_I2C0
|
||||
#define Board_I2C1 EK_TM4C123GXL_I2C3
|
||||
#define Board_I2C_TMP EK_TM4C123GXL_I2C3
|
||||
#define Board_I2C_NFC EK_TM4C123GXL_I2C3
|
||||
#define Board_I2C_TPL0401 EK_TM4C123GXL_I2C3
|
||||
|
||||
#define Board_PWM0 EK_TM4C123GXL_PWM6
|
||||
#define Board_PWM1 EK_TM4C123GXL_PWM7
|
||||
|
||||
#define Board_SDSPI0 EK_TM4C123GXL_SDSPI0
|
||||
|
||||
#define Board_SPI0 EK_TM4C123GXL_SPI0
|
||||
#define Board_SPI1 EK_TM4C123GXL_SPI3
|
||||
|
||||
#define Board_USBDEVICE EK_TM4C123GXL_USBDEVICE
|
||||
|
||||
#define Board_UART0 EK_TM4C123GXL_UART0
|
||||
|
||||
#define Board_WATCHDOG0 EK_TM4C123GXL_WATCHDOG0
|
||||
|
||||
#define Board_WIFI EK_TM4C123GXL_WIFI
|
||||
#define Board_WIFI_SPI EK_TM4C123GXL_SPI2
|
||||
|
||||
/* Board specific I2C addresses */
|
||||
#define Board_TMP006_ADDR (0x40)
|
||||
#define Board_RF430CL330_ADDR (0x28)
|
||||
#define Board_TPL0401_ADDR (0x40)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __BOARD_H */
|
767
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/EK_TM4C123GXL.c
Normal file
767
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/EK_TM4C123GXL.c
Normal file
@ -0,0 +1,767 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Texas Instruments Incorporated
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ======== EK_TM4C123GXL.c ========
|
||||
* This file is responsible for setting up the board specific items for the
|
||||
* EK_TM4C123GXL board.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <xdc/std.h>
|
||||
#include <xdc/runtime/Error.h>
|
||||
#include <xdc/runtime/System.h>
|
||||
#include <ti/sysbios/family/arm/m3/Hwi.h>
|
||||
|
||||
#include <inc/hw_ints.h>
|
||||
#include <inc/hw_memmap.h>
|
||||
#include <inc/hw_types.h>
|
||||
#include <inc/hw_gpio.h>
|
||||
|
||||
#include <driverlib/gpio.h>
|
||||
#include <driverlib/i2c.h>
|
||||
#include <driverlib/pin_map.h>
|
||||
#include <driverlib/pwm.h>
|
||||
#include <driverlib/ssi.h>
|
||||
#include <driverlib/sysctl.h>
|
||||
#include <driverlib/uart.h>
|
||||
#include <driverlib/udma.h>
|
||||
|
||||
#include "EK_TM4C123GXL.h"
|
||||
|
||||
#ifndef TI_DRIVERS_UART_DMA
|
||||
#define TI_DRIVERS_UART_DMA 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* =============================== DMA ===============================
|
||||
*/
|
||||
#if defined(__TI_COMPILER_VERSION__)
|
||||
#pragma DATA_ALIGN(dmaControlTable, 1024)
|
||||
#elif defined(__IAR_SYSTEMS_ICC__)
|
||||
#pragma data_alignment=1024
|
||||
#elif defined(__GNUC__)
|
||||
__attribute__ ((aligned (1024)))
|
||||
#endif
|
||||
static tDMAControlTable dmaControlTable[32];
|
||||
static bool dmaInitialized = false;
|
||||
|
||||
/* Hwi_Struct used in the initDMA Hwi_construct call */
|
||||
static Hwi_Struct dmaHwiStruct;
|
||||
|
||||
/*
|
||||
* ======== dmaErrorHwi ========
|
||||
*/
|
||||
static Void dmaErrorHwi(UArg arg)
|
||||
{
|
||||
System_printf("DMA error code: %d\n", uDMAErrorStatusGet());
|
||||
uDMAErrorStatusClear();
|
||||
System_abort("DMA error!!");
|
||||
}
|
||||
|
||||
/*
|
||||
* ======== EK_TM4C123GXL_initDMA ========
|
||||
*/
|
||||
void EK_TM4C123GXL_initDMA(void)
|
||||
{
|
||||
Error_Block eb;
|
||||
Hwi_Params hwiParams;
|
||||
|
||||
if (!dmaInitialized) {
|
||||
Error_init(&eb);
|
||||
Hwi_Params_init(&hwiParams);
|
||||
Hwi_construct(&(dmaHwiStruct), INT_UDMAERR, dmaErrorHwi,
|
||||
&hwiParams, &eb);
|
||||
if (Error_check(&eb)) {
|
||||
System_abort("Couldn't construct DMA error hwi");
|
||||
}
|
||||
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_UDMA);
|
||||
uDMAEnable();
|
||||
uDMAControlBaseSet(dmaControlTable);
|
||||
|
||||
dmaInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* =============================== General ===============================
|
||||
*/
|
||||
/*
|
||||
* ======== EK_TM4C123GXL_initGeneral ========
|
||||
*/
|
||||
void EK_TM4C123GXL_initGeneral(void)
|
||||
{
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
|
||||
}
|
||||
|
||||
/*
|
||||
* =============================== GPIO ===============================
|
||||
*/
|
||||
/* Place into subsections to allow the TI linker to remove items properly */
|
||||
#if defined(__TI_COMPILER_VERSION__)
|
||||
#pragma DATA_SECTION(GPIOTiva_config, ".const:GPIOTiva_config")
|
||||
#endif
|
||||
|
||||
#include <ti/drivers/GPIO.h>
|
||||
#include <ti/drivers/gpio/GPIOTiva.h>
|
||||
|
||||
/*
|
||||
* Array of Pin configurations
|
||||
* NOTE: The order of the pin configurations must coincide with what was
|
||||
* defined in EK_TM4C123GXL.h
|
||||
* NOTE: Pins not used for interrupts should be placed at the end of the
|
||||
* array. Callback entries can be omitted from callbacks array to
|
||||
* reduce memory usage.
|
||||
*/
|
||||
GPIO_PinConfig gpioPinConfigs[] = {
|
||||
/* Input pins */
|
||||
/* EK_TM4C123GXL_GPIO_SW1 */
|
||||
GPIOTiva_PF_4 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
|
||||
/* EK_TM4C123GXL_GPIO_SW2 */
|
||||
GPIOTiva_PF_0 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
|
||||
|
||||
/* Output pins */
|
||||
/* EK_TM4C123GXL_LED_RED */
|
||||
GPIOTiva_PF_1 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
|
||||
/* EK_TM4C123GXL_LED_BLUE */
|
||||
GPIOTiva_PF_2 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
|
||||
/* EK_TM4C123GXL_LED_GREEN */
|
||||
GPIOTiva_PF_3 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW
|
||||
};
|
||||
|
||||
/*
|
||||
* Array of callback function pointers
|
||||
* NOTE: The order of the pin configurations must coincide with what was
|
||||
* defined in EK_TM4C123GXL.h
|
||||
* NOTE: Pins not used for interrupts can be omitted from callbacks array to
|
||||
* reduce memory usage (if placed at end of gpioPinConfigs array).
|
||||
*/
|
||||
GPIO_CallbackFxn gpioCallbackFunctions[] = {
|
||||
NULL, /* EK_TM4C123GXL_GPIO_SW1 */
|
||||
NULL /* EK_TM4C123GXL_GPIO_SW2 */
|
||||
};
|
||||
|
||||
/* The device-specific GPIO_config structure */
|
||||
const GPIOTiva_Config GPIOTiva_config = {
|
||||
.pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
|
||||
.callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
|
||||
.numberOfPinConfigs = sizeof(gpioPinConfigs)/sizeof(GPIO_PinConfig),
|
||||
.numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
|
||||
.intPriority = (~0)
|
||||
};
|
||||
|
||||
/*
|
||||
* ======== EK_TM4C123GXL_initGPIO ========
|
||||
*/
|
||||
void EK_TM4C123GXL_initGPIO(void)
|
||||
{
|
||||
/* EK_TM4C123GXL_GPIO_SW2 - PF0 requires unlocking before configuration */
|
||||
HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
|
||||
HWREG(GPIO_PORTF_BASE + GPIO_O_CR) |= GPIO_PIN_0;
|
||||
GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_0);
|
||||
|
||||
/* Initialize peripheral and pins */
|
||||
GPIO_init();
|
||||
}
|
||||
|
||||
/*
|
||||
* =============================== I2C ===============================
|
||||
*/
|
||||
/* Place into subsections to allow the TI linker to remove items properly */
|
||||
#if defined(__TI_COMPILER_VERSION__)
|
||||
#pragma DATA_SECTION(I2C_config, ".const:I2C_config")
|
||||
#pragma DATA_SECTION(i2cTivaHWAttrs, ".const:i2cTivaHWAttrs")
|
||||
#endif
|
||||
|
||||
#include <ti/drivers/I2C.h>
|
||||
#include <ti/drivers/i2c/I2CTiva.h>
|
||||
|
||||
I2CTiva_Object i2cTivaObjects[EK_TM4C123GXL_I2CCOUNT];
|
||||
|
||||
const I2CTiva_HWAttrs i2cTivaHWAttrs[EK_TM4C123GXL_I2CCOUNT] = {
|
||||
{
|
||||
.baseAddr = I2C1_BASE,
|
||||
.intNum = INT_I2C1,
|
||||
.intPriority = (~0)
|
||||
},
|
||||
{
|
||||
.baseAddr = I2C3_BASE,
|
||||
.intNum = INT_I2C3,
|
||||
.intPriority = (~0)
|
||||
},
|
||||
};
|
||||
|
||||
const I2C_Config I2C_config[] = {
|
||||
{
|
||||
.fxnTablePtr = &I2CTiva_fxnTable,
|
||||
.object = &i2cTivaObjects[0],
|
||||
.hwAttrs = &i2cTivaHWAttrs[0]
|
||||
},
|
||||
{
|
||||
.fxnTablePtr = &I2CTiva_fxnTable,
|
||||
.object = &i2cTivaObjects[1],
|
||||
.hwAttrs = &i2cTivaHWAttrs[1]
|
||||
},
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/*
|
||||
* ======== EK_TM4C123GXL_initI2C ========
|
||||
*/
|
||||
void EK_TM4C123GXL_initI2C(void)
|
||||
{
|
||||
/* I2C1 Init */
|
||||
/* Enable the peripheral */
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C1);
|
||||
|
||||
/* Configure the appropriate pins to be I2C instead of GPIO. */
|
||||
GPIOPinConfigure(GPIO_PA6_I2C1SCL);
|
||||
GPIOPinConfigure(GPIO_PA7_I2C1SDA);
|
||||
GPIOPinTypeI2CSCL(GPIO_PORTA_BASE, GPIO_PIN_6);
|
||||
GPIOPinTypeI2C(GPIO_PORTA_BASE, GPIO_PIN_7);
|
||||
|
||||
/* I2C3 Init */
|
||||
/*
|
||||
* NOTE: TI-RTOS examples configure pins PD0 & PD1 for SSI3 or I2C3. Thus,
|
||||
* a conflict occurs when the I2C & SPI drivers are used simultaneously in
|
||||
* an application. Modify the pin mux settings in this file and resolve the
|
||||
* conflict before running your the application.
|
||||
*/
|
||||
/* Enable the peripheral */
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C3);
|
||||
|
||||
/* Configure the appropriate pins to be I2C instead of GPIO. */
|
||||
GPIOPinConfigure(GPIO_PD0_I2C3SCL);
|
||||
GPIOPinConfigure(GPIO_PD1_I2C3SDA);
|
||||
GPIOPinTypeI2CSCL(GPIO_PORTD_BASE, GPIO_PIN_0);
|
||||
GPIOPinTypeI2C(GPIO_PORTD_BASE, GPIO_PIN_1);
|
||||
|
||||
/*
|
||||
* These GPIOs are connected to PD0 and PD1 and need to be brought into a
|
||||
* GPIO input state so they don't interfere with I2C communications.
|
||||
*/
|
||||
GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_6);
|
||||
GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_7);
|
||||
|
||||
I2C_init();
|
||||
}
|
||||
|
||||
/*
|
||||
* =============================== PWM ===============================
|
||||
*/
|
||||
/* Place into subsections to allow the TI linker to remove items properly */
|
||||
#if defined(__TI_COMPILER_VERSION__)
|
||||
#pragma DATA_SECTION(PWM_config, ".const:PWM_config")
|
||||
#pragma DATA_SECTION(pwmTivaHWAttrs, ".const:pwmTivaHWAttrs")
|
||||
#endif
|
||||
|
||||
#include <ti/drivers/PWM.h>
|
||||
#include <ti/drivers/pwm/PWMTiva.h>
|
||||
|
||||
PWMTiva_Object pwmTivaObjects[EK_TM4C123GXL_PWMCOUNT];
|
||||
|
||||
const PWMTiva_HWAttrs pwmTivaHWAttrs[EK_TM4C123GXL_PWMCOUNT] = {
|
||||
{
|
||||
.baseAddr = PWM1_BASE,
|
||||
.pwmOutput = PWM_OUT_6,
|
||||
.pwmGenOpts = PWM_GEN_MODE_DOWN | PWM_GEN_MODE_DBG_RUN
|
||||
},
|
||||
{
|
||||
.baseAddr = PWM1_BASE,
|
||||
.pwmOutput = PWM_OUT_7,
|
||||
.pwmGenOpts = PWM_GEN_MODE_DOWN | PWM_GEN_MODE_DBG_RUN
|
||||
}
|
||||
};
|
||||
|
||||
const PWM_Config PWM_config[] = {
|
||||
{
|
||||
.fxnTablePtr = &PWMTiva_fxnTable,
|
||||
.object = &pwmTivaObjects[0],
|
||||
.hwAttrs = &pwmTivaHWAttrs[0]
|
||||
},
|
||||
{
|
||||
.fxnTablePtr = &PWMTiva_fxnTable,
|
||||
.object = &pwmTivaObjects[1],
|
||||
.hwAttrs = &pwmTivaHWAttrs[1]
|
||||
},
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/*
|
||||
* ======== EK_TM4C123GXL_initPWM ========
|
||||
*/
|
||||
void EK_TM4C123GXL_initPWM(void)
|
||||
{
|
||||
/* Enable PWM peripherals */
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM1);
|
||||
|
||||
/*
|
||||
* Enable PWM output on GPIO pins. Board_LED1 and Board_LED2 are now
|
||||
* controlled by PWM peripheral - Do not use GPIO APIs.
|
||||
*/
|
||||
GPIOPinConfigure(GPIO_PF2_M1PWM6);
|
||||
GPIOPinConfigure(GPIO_PF3_M1PWM7);
|
||||
GPIOPinTypePWM(GPIO_PORTF_BASE, GPIO_PIN_2 |GPIO_PIN_3);
|
||||
|
||||
PWM_init();
|
||||
}
|
||||
|
||||
/*
|
||||
* =============================== SDSPI ===============================
|
||||
*/
|
||||
/* Place into subsections to allow the TI linker to remove items properly */
|
||||
#if defined(__TI_COMPILER_VERSION__)
|
||||
#pragma DATA_SECTION(SDSPI_config, ".const:SDSPI_config")
|
||||
#pragma DATA_SECTION(sdspiTivaHWattrs, ".const:sdspiTivaHWattrs")
|
||||
#endif
|
||||
|
||||
#include <ti/drivers/SDSPI.h>
|
||||
#include <ti/drivers/sdspi/SDSPITiva.h>
|
||||
|
||||
SDSPITiva_Object sdspiTivaObjects[EK_TM4C123GXL_SDSPICOUNT];
|
||||
|
||||
const SDSPITiva_HWAttrs sdspiTivaHWattrs[EK_TM4C123GXL_SDSPICOUNT] = {
|
||||
{
|
||||
.baseAddr = SSI2_BASE,
|
||||
|
||||
.portSCK = GPIO_PORTB_BASE,
|
||||
.pinSCK = GPIO_PIN_4,
|
||||
.portMISO = GPIO_PORTB_BASE,
|
||||
.pinMISO = GPIO_PIN_6,
|
||||
.portMOSI = GPIO_PORTB_BASE,
|
||||
.pinMOSI = GPIO_PIN_7,
|
||||
.portCS = GPIO_PORTA_BASE,
|
||||
.pinCS = GPIO_PIN_5,
|
||||
}
|
||||
};
|
||||
|
||||
const SDSPI_Config SDSPI_config[] = {
|
||||
{
|
||||
.fxnTablePtr = &SDSPITiva_fxnTable,
|
||||
.object = &sdspiTivaObjects[0],
|
||||
.hwAttrs = &sdspiTivaHWattrs[0]
|
||||
},
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/*
|
||||
* ======== EK_TM4C123GXL_initSDSPI ========
|
||||
*/
|
||||
void EK_TM4C123GXL_initSDSPI(void)
|
||||
{
|
||||
/* Enable the peripherals used by the SD Card */
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);
|
||||
|
||||
/* Configure pad settings */
|
||||
GPIOPadConfigSet(GPIO_PORTB_BASE,
|
||||
GPIO_PIN_4 | GPIO_PIN_7,
|
||||
GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);
|
||||
|
||||
GPIOPadConfigSet(GPIO_PORTB_BASE,
|
||||
GPIO_PIN_6,
|
||||
GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPU);
|
||||
|
||||
GPIOPadConfigSet(GPIO_PORTA_BASE,
|
||||
GPIO_PIN_5,
|
||||
GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);
|
||||
|
||||
GPIOPinConfigure(GPIO_PB4_SSI2CLK);
|
||||
GPIOPinConfigure(GPIO_PB6_SSI2RX);
|
||||
GPIOPinConfigure(GPIO_PB7_SSI2TX);
|
||||
|
||||
/*
|
||||
* These GPIOs are connected to PB6 and PB7 and need to be brought into a
|
||||
* GPIO input state so they don't interfere with SPI communications.
|
||||
*/
|
||||
GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_0);
|
||||
GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_1);
|
||||
|
||||
SDSPI_init();
|
||||
}
|
||||
|
||||
/*
|
||||
* =============================== SPI ===============================
|
||||
*/
|
||||
/* Place into subsections to allow the TI linker to remove items properly */
|
||||
#if defined(__TI_COMPILER_VERSION__)
|
||||
#pragma DATA_SECTION(SPI_config, ".const:SPI_config")
|
||||
#pragma DATA_SECTION(spiTivaDMAHWAttrs, ".const:spiTivaDMAHWAttrs")
|
||||
#endif
|
||||
|
||||
#include <ti/drivers/SPI.h>
|
||||
#include <ti/drivers/spi/SPITivaDMA.h>
|
||||
|
||||
SPITivaDMA_Object spiTivaDMAObjects[EK_TM4C123GXL_SPICOUNT];
|
||||
|
||||
#if defined(__TI_COMPILER_VERSION__)
|
||||
#pragma DATA_ALIGN(spiTivaDMAscratchBuf, 32)
|
||||
#elif defined(__IAR_SYSTEMS_ICC__)
|
||||
#pragma data_alignment=32
|
||||
#elif defined(__GNUC__)
|
||||
__attribute__ ((aligned (32)))
|
||||
#endif
|
||||
uint32_t spiTivaDMAscratchBuf[EK_TM4C123GXL_SPICOUNT];
|
||||
|
||||
const SPITivaDMA_HWAttrs spiTivaDMAHWAttrs[EK_TM4C123GXL_SPICOUNT] = {
|
||||
{
|
||||
.baseAddr = SSI0_BASE,
|
||||
.intNum = INT_SSI0,
|
||||
.intPriority = (~0),
|
||||
.scratchBufPtr = &spiTivaDMAscratchBuf[0],
|
||||
.defaultTxBufValue = 0,
|
||||
.rxChannelIndex = UDMA_CHANNEL_SSI0RX,
|
||||
.txChannelIndex = UDMA_CHANNEL_SSI0TX,
|
||||
.channelMappingFxn = uDMAChannelAssign,
|
||||
.rxChannelMappingFxnArg = UDMA_CH10_SSI0RX,
|
||||
.txChannelMappingFxnArg = UDMA_CH11_SSI0TX
|
||||
},
|
||||
{
|
||||
.baseAddr = SSI2_BASE,
|
||||
.intNum = INT_SSI2,
|
||||
.intPriority = (~0),
|
||||
.scratchBufPtr = &spiTivaDMAscratchBuf[1],
|
||||
.defaultTxBufValue = 0,
|
||||
.rxChannelIndex = UDMA_SEC_CHANNEL_UART2RX_12,
|
||||
.txChannelIndex = UDMA_SEC_CHANNEL_UART2TX_13,
|
||||
.channelMappingFxn = uDMAChannelAssign,
|
||||
.rxChannelMappingFxnArg = UDMA_CH12_SSI2RX,
|
||||
.txChannelMappingFxnArg = UDMA_CH13_SSI2TX
|
||||
},
|
||||
{
|
||||
.baseAddr = SSI3_BASE,
|
||||
.intNum = INT_SSI3,
|
||||
.intPriority = (~0),
|
||||
.scratchBufPtr = &spiTivaDMAscratchBuf[2],
|
||||
.defaultTxBufValue = 0,
|
||||
.rxChannelIndex = UDMA_SEC_CHANNEL_TMR2A_14,
|
||||
.txChannelIndex = UDMA_SEC_CHANNEL_TMR2B_15,
|
||||
.channelMappingFxn = uDMAChannelAssign,
|
||||
.rxChannelMappingFxnArg = UDMA_CH14_SSI3RX,
|
||||
.txChannelMappingFxnArg = UDMA_CH15_SSI3TX
|
||||
}
|
||||
};
|
||||
|
||||
const SPI_Config SPI_config[] = {
|
||||
{
|
||||
.fxnTablePtr = &SPITivaDMA_fxnTable,
|
||||
.object = &spiTivaDMAObjects[0],
|
||||
.hwAttrs = &spiTivaDMAHWAttrs[0]
|
||||
},
|
||||
{
|
||||
.fxnTablePtr = &SPITivaDMA_fxnTable,
|
||||
.object = &spiTivaDMAObjects[1],
|
||||
.hwAttrs = &spiTivaDMAHWAttrs[1]
|
||||
},
|
||||
{
|
||||
.fxnTablePtr = &SPITivaDMA_fxnTable,
|
||||
.object = &spiTivaDMAObjects[2],
|
||||
.hwAttrs = &spiTivaDMAHWAttrs[2]
|
||||
},
|
||||
{NULL, NULL, NULL},
|
||||
};
|
||||
|
||||
/*
|
||||
* ======== EK_TM4C123GXL_initSPI ========
|
||||
*/
|
||||
void EK_TM4C123GXL_initSPI(void)
|
||||
{
|
||||
/* SPI0 */
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
|
||||
|
||||
/* Need to unlock PF0 */
|
||||
GPIOPinConfigure(GPIO_PA2_SSI0CLK);
|
||||
GPIOPinConfigure(GPIO_PA3_SSI0FSS);
|
||||
GPIOPinConfigure(GPIO_PA4_SSI0RX);
|
||||
GPIOPinConfigure(GPIO_PA5_SSI0TX);
|
||||
|
||||
GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_3 |
|
||||
GPIO_PIN_4 | GPIO_PIN_5);
|
||||
|
||||
/* SSI2 */
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);
|
||||
|
||||
GPIOPinConfigure(GPIO_PB4_SSI2CLK);
|
||||
GPIOPinConfigure(GPIO_PB5_SSI2FSS);
|
||||
GPIOPinConfigure(GPIO_PB6_SSI2RX);
|
||||
GPIOPinConfigure(GPIO_PB7_SSI2TX);
|
||||
|
||||
GPIOPinTypeSSI(GPIO_PORTB_BASE, GPIO_PIN_4 | GPIO_PIN_5 |
|
||||
GPIO_PIN_6 | GPIO_PIN_7);
|
||||
|
||||
/* SSI3 */
|
||||
/*
|
||||
* NOTE: TI-RTOS examples configure pins PD0 & PD1 for SSI3 or I2C3. Thus,
|
||||
* a conflict occurs when the I2C & SPI drivers are used simultaneously in
|
||||
* an application. Modify the pin mux settings in this file and resolve the
|
||||
* conflict before running your the application.
|
||||
*/
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI3);
|
||||
|
||||
GPIOPinConfigure(GPIO_PD0_SSI3CLK);
|
||||
GPIOPinConfigure(GPIO_PD1_SSI3FSS);
|
||||
GPIOPinConfigure(GPIO_PD2_SSI3RX);
|
||||
GPIOPinConfigure(GPIO_PD3_SSI3TX);
|
||||
|
||||
GPIOPinTypeSSI(GPIO_PORTD_BASE, GPIO_PIN_0 | GPIO_PIN_1 |
|
||||
GPIO_PIN_2 | GPIO_PIN_3);
|
||||
|
||||
EK_TM4C123GXL_initDMA();
|
||||
SPI_init();
|
||||
}
|
||||
|
||||
/*
|
||||
* =============================== UART ===============================
|
||||
*/
|
||||
/* Place into subsections to allow the TI linker to remove items properly */
|
||||
#if defined(__TI_COMPILER_VERSION__)
|
||||
#pragma DATA_SECTION(UART_config, ".const:UART_config")
|
||||
#pragma DATA_SECTION(uartTivaHWAttrs, ".const:uartTivaHWAttrs")
|
||||
#endif
|
||||
|
||||
#include <ti/drivers/UART.h>
|
||||
#if TI_DRIVERS_UART_DMA
|
||||
#include <ti/drivers/uart/UARTTivaDMA.h>
|
||||
|
||||
UARTTivaDMA_Object uartTivaObjects[EK_TM4C123GXL_UARTCOUNT];
|
||||
|
||||
const UARTTivaDMA_HWAttrs uartTivaHWAttrs[EK_TM4C123GXL_UARTCOUNT] = {
|
||||
{
|
||||
.baseAddr = UART0_BASE,
|
||||
.intNum = INT_UART0,
|
||||
.intPriority = (~0),
|
||||
.rxChannelIndex = UDMA_CH8_UART0RX,
|
||||
.txChannelIndex = UDMA_CH9_UART0TX,
|
||||
}
|
||||
};
|
||||
|
||||
const UART_Config UART_config[] = {
|
||||
{
|
||||
.fxnTablePtr = &UARTTivaDMA_fxnTable,
|
||||
.object = &uartTivaObjects[0],
|
||||
.hwAttrs = &uartTivaHWAttrs[0]
|
||||
},
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
#else
|
||||
#include <ti/drivers/uart/UARTTiva.h>
|
||||
|
||||
UARTTiva_Object uartTivaObjects[EK_TM4C123GXL_UARTCOUNT];
|
||||
unsigned char uartTivaRingBuffer[EK_TM4C123GXL_UARTCOUNT][32];
|
||||
|
||||
/* UART configuration structure */
|
||||
const UARTTiva_HWAttrs uartTivaHWAttrs[EK_TM4C123GXL_UARTCOUNT] = {
|
||||
{
|
||||
.baseAddr = UART0_BASE,
|
||||
.intNum = INT_UART0,
|
||||
.intPriority = (~0),
|
||||
.flowControl = UART_FLOWCONTROL_NONE,
|
||||
.ringBufPtr = uartTivaRingBuffer[0],
|
||||
.ringBufSize = sizeof(uartTivaRingBuffer[0])
|
||||
}
|
||||
};
|
||||
|
||||
const UART_Config UART_config[] = {
|
||||
{
|
||||
.fxnTablePtr = &UARTTiva_fxnTable,
|
||||
.object = &uartTivaObjects[0],
|
||||
.hwAttrs = &uartTivaHWAttrs[0]
|
||||
},
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
#endif /* TI_DRIVERS_UART_DMA */
|
||||
|
||||
/*
|
||||
* ======== EK_TM4C123GXL_initUART ========
|
||||
*/
|
||||
void EK_TM4C123GXL_initUART(void)
|
||||
{
|
||||
/* Enable and configure the peripherals used by the uart. */
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
|
||||
GPIOPinConfigure(GPIO_PA0_U0RX);
|
||||
GPIOPinConfigure(GPIO_PA1_U0TX);
|
||||
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
|
||||
|
||||
/* Initialize the UART driver */
|
||||
#if TI_DRIVERS_UART_DMA
|
||||
EK_TM4C123GXL_initDMA();
|
||||
#endif
|
||||
UART_init();
|
||||
}
|
||||
|
||||
/*
|
||||
* =============================== USB ===============================
|
||||
*/
|
||||
/*
|
||||
* ======== EK_TM4C123GXL_initUSB ========
|
||||
* This function just turns on the USB
|
||||
*/
|
||||
void EK_TM4C123GXL_initUSB(EK_TM4C123GXL_USBMode usbMode)
|
||||
{
|
||||
/* Enable the USB peripheral and PLL */
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0);
|
||||
SysCtlUSBPLLEnable();
|
||||
|
||||
/* Setup pins for USB operation */
|
||||
GPIOPinTypeUSBAnalog(GPIO_PORTD_BASE, GPIO_PIN_4 | GPIO_PIN_5);
|
||||
|
||||
if (usbMode == EK_TM4C123GXL_USBHOST) {
|
||||
System_abort("USB host not supported\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* =============================== Watchdog ===============================
|
||||
*/
|
||||
/* Place into subsections to allow the TI linker to remove items properly */
|
||||
#if defined(__TI_COMPILER_VERSION__)
|
||||
#pragma DATA_SECTION(Watchdog_config, ".const:Watchdog_config")
|
||||
#pragma DATA_SECTION(watchdogTivaHWAttrs, ".const:watchdogTivaHWAttrs")
|
||||
#endif
|
||||
|
||||
#include <ti/drivers/Watchdog.h>
|
||||
#include <ti/drivers/watchdog/WatchdogTiva.h>
|
||||
|
||||
WatchdogTiva_Object watchdogTivaObjects[EK_TM4C123GXL_WATCHDOGCOUNT];
|
||||
|
||||
const WatchdogTiva_HWAttrs watchdogTivaHWAttrs[EK_TM4C123GXL_WATCHDOGCOUNT] = {
|
||||
{
|
||||
.baseAddr = WATCHDOG0_BASE,
|
||||
.intNum = INT_WATCHDOG,
|
||||
.intPriority = (~0),
|
||||
.reloadValue = 80000000 // 1 second period at default CPU clock freq
|
||||
},
|
||||
};
|
||||
|
||||
const Watchdog_Config Watchdog_config[] = {
|
||||
{
|
||||
.fxnTablePtr = &WatchdogTiva_fxnTable,
|
||||
.object = &watchdogTivaObjects[0],
|
||||
.hwAttrs = &watchdogTivaHWAttrs[0]
|
||||
},
|
||||
{NULL, NULL, NULL},
|
||||
};
|
||||
|
||||
/*
|
||||
* ======== EK_TM4C123GXL_initWatchdog ========
|
||||
*
|
||||
* NOTE: To use the other watchdog timer with base address WATCHDOG1_BASE,
|
||||
* an additional function call may need be made to enable PIOSC. Enabling
|
||||
* WDOG1 does not do this. Enabling another peripheral that uses PIOSC
|
||||
* such as ADC0 or SSI0, however, will do so. Example:
|
||||
*
|
||||
* SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
|
||||
* SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG1);
|
||||
*
|
||||
* See the following forum post for more information:
|
||||
* http://e2e.ti.com/support/microcontrollers/stellaris_arm_cortex-m3_microcontroller/f/471/p/176487/654390.aspx#654390
|
||||
*/
|
||||
void EK_TM4C123GXL_initWatchdog(void)
|
||||
{
|
||||
/* Enable peripherals used by Watchdog */
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG0);
|
||||
|
||||
Watchdog_init();
|
||||
}
|
||||
|
||||
/*
|
||||
* =============================== WiFi ===============================
|
||||
*/
|
||||
/* Place into subsections to allow the TI linker to remove items properly */
|
||||
#if defined(__TI_COMPILER_VERSION__)
|
||||
#pragma DATA_SECTION(WiFi_config, ".const:WiFi_config")
|
||||
#pragma DATA_SECTION(wiFiCC3100HWAttrs, ".const:wiFiCC3100HWAttrs")
|
||||
#endif
|
||||
|
||||
#include <ti/drivers/WiFi.h>
|
||||
#include <ti/drivers/wifi/WiFiCC3100.h>
|
||||
|
||||
WiFiCC3100_Object wiFiCC3100Objects[EK_TM4C123GXL_WIFICOUNT];
|
||||
|
||||
const WiFiCC3100_HWAttrs wiFiCC3100HWAttrs[EK_TM4C123GXL_WIFICOUNT] = {
|
||||
{
|
||||
.irqPort = GPIO_PORTB_BASE,
|
||||
.irqPin = GPIO_PIN_2,
|
||||
.irqIntNum = INT_GPIOB,
|
||||
|
||||
.csPort = GPIO_PORTE_BASE,
|
||||
.csPin = GPIO_PIN_0,
|
||||
|
||||
.enPort = GPIO_PORTE_BASE,
|
||||
.enPin = GPIO_PIN_4
|
||||
}
|
||||
};
|
||||
|
||||
const WiFi_Config WiFi_config[] = {
|
||||
{
|
||||
.fxnTablePtr = &WiFiCC3100_fxnTable,
|
||||
.object = &wiFiCC3100Objects[0],
|
||||
.hwAttrs = &wiFiCC3100HWAttrs[0]
|
||||
},
|
||||
{NULL,NULL, NULL},
|
||||
};
|
||||
|
||||
/*
|
||||
* ======== EK_TM4C123GXL_initWiFi ========
|
||||
*/
|
||||
void EK_TM4C123GXL_initWiFi(void)
|
||||
{
|
||||
/* Configure EN & CS pins to disable CC3100 */
|
||||
GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_4);
|
||||
GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_0, GPIO_PIN_0);
|
||||
GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_4, 0);
|
||||
|
||||
/* Configure SSI2 for CC3100 */
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);
|
||||
GPIOPinConfigure(GPIO_PB4_SSI2CLK);
|
||||
GPIOPinConfigure(GPIO_PB6_SSI2RX);
|
||||
GPIOPinConfigure(GPIO_PB7_SSI2TX);
|
||||
GPIOPinTypeSSI(GPIO_PORTB_BASE, GPIO_PIN_4 | GPIO_PIN_6 | GPIO_PIN_7);
|
||||
|
||||
/* Configure IRQ pin */
|
||||
GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_2);
|
||||
GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_2, GPIO_STRENGTH_2MA,
|
||||
GPIO_PIN_TYPE_STD_WPD);
|
||||
GPIOIntTypeSet(GPIO_PORTB_BASE, GPIO_PIN_2, GPIO_RISING_EDGE);
|
||||
|
||||
SPI_init();
|
||||
EK_TM4C123GXL_initDMA();
|
||||
|
||||
WiFi_init();
|
||||
}
|
277
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/EK_TM4C123GXL.h
Normal file
277
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/EK_TM4C123GXL.h
Normal file
@ -0,0 +1,277 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Texas Instruments Incorporated
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/** ============================================================================
|
||||
* @file EK_TM4C123GXL.h
|
||||
*
|
||||
* @brief EK_TM4C123GXL Board Specific APIs
|
||||
*
|
||||
* The EK_TM4C123GXL header file should be included in an application as
|
||||
* follows:
|
||||
* @code
|
||||
* #include <EK_TM4C123GXL.h>
|
||||
* @endcode
|
||||
*
|
||||
* ============================================================================
|
||||
*/
|
||||
#ifndef __EK_TM4C123GXL_H
|
||||
#define __EK_TM4C123GXL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* LEDs on EK_TM4C123GXL are active high. */
|
||||
#define EK_TM4C123GXL_LED_OFF (0)
|
||||
#define EK_TM4C123GXL_LED_ON (1)
|
||||
|
||||
/*!
|
||||
* @def EK_TM4C123GXL_GPIOName
|
||||
* @brief Enum of GPIO names on the EK_TM4C123GXL dev board
|
||||
*/
|
||||
typedef enum EK_TM4C123GXL_GPIOName {
|
||||
EK_TM4C123GXL_SW1 = 0,
|
||||
EK_TM4C123GXL_SW2,
|
||||
EK_TM4C123GXL_LED_RED,
|
||||
EK_TM4C123GXL_LED_BLUE,
|
||||
EK_TM4C123GXL_LED_GREEN,
|
||||
|
||||
EK_TM4C123GXL_GPIOCOUNT
|
||||
} EK_TM4C123GXL_GPIOName;
|
||||
|
||||
/*!
|
||||
* @def EK_TM4C123GXL_I2CName
|
||||
* @brief Enum of I2C names on the EK_TM4C123GXL dev board
|
||||
*/
|
||||
typedef enum EK_TM4C123GXL_I2CName {
|
||||
EK_TM4C123GXL_I2C0 = 0,
|
||||
EK_TM4C123GXL_I2C3,
|
||||
|
||||
EK_TM4C123GXL_I2CCOUNT
|
||||
} EK_TM4C123GXL_I2CName;
|
||||
|
||||
/*!
|
||||
* @def EK_TM4C123GXL_PWMName
|
||||
* @brief Enum of PWM names on the EK_TM4C123GXL dev board
|
||||
*/
|
||||
typedef enum EK_TM4C123GXL_PWMName {
|
||||
EK_TM4C123GXL_PWM6 = 0,
|
||||
EK_TM4C123GXL_PWM7,
|
||||
|
||||
EK_TM4C123GXL_PWMCOUNT
|
||||
} EK_TM4C123GXL_PWMName;
|
||||
|
||||
/*!
|
||||
* @def EK_TM4C123GXL_SDSPIName
|
||||
* @brief Enum of SDSPI names on the EK_TM4C123GXL dev board
|
||||
*/
|
||||
typedef enum EK_TM4C123GXL_SDSPIName {
|
||||
EK_TM4C123GXL_SDSPI0 = 0,
|
||||
|
||||
EK_TM4C123GXL_SDSPICOUNT
|
||||
} EK_TM4C123GXL_SDSPIName;
|
||||
|
||||
/*!
|
||||
* @def EK_TM4C123GXL_SPIName
|
||||
* @brief Enum of SPI names on the EK_TM4C123GXL dev board
|
||||
*/
|
||||
typedef enum EK_TM4C123GXL_SPIName {
|
||||
EK_TM4C123GXL_SPI0 = 0,
|
||||
EK_TM4C123GXL_SPI2,
|
||||
EK_TM4C123GXL_SPI3,
|
||||
|
||||
EK_TM4C123GXL_SPICOUNT
|
||||
} EK_TM4C123GXL_SPIName;
|
||||
|
||||
/*!
|
||||
* @def EK_TM4C123GXL_UARTName
|
||||
* @brief Enum of UARTs on the EK_TM4C123GXL dev board
|
||||
*/
|
||||
typedef enum EK_TM4C123GXL_UARTName {
|
||||
EK_TM4C123GXL_UART0 = 0,
|
||||
|
||||
EK_TM4C123GXL_UARTCOUNT
|
||||
} EK_TM4C123GXL_UARTName;
|
||||
|
||||
/*!
|
||||
* @def EK_TM4C123GXL_USBMode
|
||||
* @brief Enum of USB setup function on the EK_TM4C123GXL dev board
|
||||
*/
|
||||
typedef enum EK_TM4C123GXL_USBMode {
|
||||
EK_TM4C123GXL_USBDEVICE,
|
||||
EK_TM4C123GXL_USBHOST
|
||||
} EK_TM4C123GXL_USBMode;
|
||||
|
||||
/*!
|
||||
* @def EK_TM4C123GXL_WatchdogName
|
||||
* @brief Enum of Watchdogs on the EK_TM4C123GXL dev board
|
||||
*/
|
||||
typedef enum EK_TM4C123GXL_WatchdogName {
|
||||
EK_TM4C123GXL_WATCHDOG0 = 0,
|
||||
|
||||
EK_TM4C123GXL_WATCHDOGCOUNT
|
||||
} EK_TM4C123GXL_WatchdogName;
|
||||
|
||||
/*!
|
||||
* @def EK_TM4C123GXL_WiFiName
|
||||
* @brief Enum of WiFi names on the EK_TM4C123GXL dev board
|
||||
*/
|
||||
typedef enum EK_TM4C123GXL_WiFiName {
|
||||
EK_TM4C123GXL_WIFI = 0,
|
||||
|
||||
EK_TM4C123GXL_WIFICOUNT
|
||||
} EK_TM4C123GXL_WiFiName;
|
||||
|
||||
/*!
|
||||
* @brief Initialize board specific DMA settings
|
||||
*
|
||||
* This function creates a hwi in case the DMA controller creates an error
|
||||
* interrrupt, enables the DMA and supplies it with a uDMA control table.
|
||||
*/
|
||||
extern void EK_TM4C123GXL_initDMA(void);
|
||||
|
||||
/*!
|
||||
* @brief Initialize the general board specific settings
|
||||
*
|
||||
* This function initializes the general board specific settings.
|
||||
* This includes:
|
||||
* - Flash wait states based on the process
|
||||
* - Disable clock source to watchdog module
|
||||
* - Enable clock sources for peripherals
|
||||
*/
|
||||
extern void EK_TM4C123GXL_initGeneral(void);
|
||||
|
||||
/*!
|
||||
* @brief Initialize board specific GPIO settings
|
||||
*
|
||||
* This function initializes the board specific GPIO settings and
|
||||
* then calls the GPIO_init API to initialize the GPIO module.
|
||||
*
|
||||
* The GPIOs controlled by the GPIO module are determined by the GPIO_PinConfig
|
||||
* variable.
|
||||
*/
|
||||
extern void EK_TM4C123GXL_initGPIO(void);
|
||||
|
||||
/*!
|
||||
* @brief Initialize board specific I2C settings
|
||||
*
|
||||
* This function initializes the board specific I2C settings and then calls
|
||||
* the I2C_init API to initialize the I2C module.
|
||||
*
|
||||
* The I2C peripherals controlled by the I2C module are determined by the
|
||||
* I2C_config variable.
|
||||
*/
|
||||
extern void EK_TM4C123GXL_initI2C(void);
|
||||
|
||||
/*!
|
||||
* @brief Initialize board specific PWM settings
|
||||
*
|
||||
* This function initializes the board specific PWM settings and then calls
|
||||
* the PWM_init API to initialize the PWM module.
|
||||
*
|
||||
* The PWM peripherals controlled by the PWM module are determined by the
|
||||
* PWM_config variable.
|
||||
*/
|
||||
extern void EK_TM4C123GXL_initPWM(void);
|
||||
|
||||
/*!
|
||||
* @brief Initialize board specific SDSPI settings
|
||||
*
|
||||
* This function initializes the board specific SDSPI settings and then calls
|
||||
* the SDSPI_init API to initialize the SDSPI module.
|
||||
*
|
||||
* The SDSPI peripherals controlled by the SDSPI module are determined by the
|
||||
* SDSPI_config variable.
|
||||
*/
|
||||
extern void EK_TM4C123GXL_initSDSPI(void);
|
||||
|
||||
/*!
|
||||
* @brief Initialize board specific SPI settings
|
||||
*
|
||||
* This function initializes the board specific SPI settings and then calls
|
||||
* the SPI_init API to initialize the SPI module.
|
||||
*
|
||||
* The SPI peripherals controlled by the SPI module are determined by the
|
||||
* SPI_config variable.
|
||||
*/
|
||||
extern void EK_TM4C123GXL_initSPI(void);
|
||||
|
||||
/*!
|
||||
* @brief Initialize board specific UART settings
|
||||
*
|
||||
* This function initializes the board specific UART settings and then calls
|
||||
* the UART_init API to initialize the UART module.
|
||||
*
|
||||
* The UART peripherals controlled by the UART module are determined by the
|
||||
* UART_config variable.
|
||||
*/
|
||||
extern void EK_TM4C123GXL_initUART(void);
|
||||
|
||||
/*!
|
||||
* @brief Initialize board specific USB settings
|
||||
*
|
||||
* This function initializes the board specific USB settings and pins based on
|
||||
* the USB mode of operation.
|
||||
*
|
||||
* @param usbMode USB mode of operation
|
||||
*/
|
||||
extern void EK_TM4C123GXL_initUSB(EK_TM4C123GXL_USBMode usbMode);
|
||||
|
||||
/*!
|
||||
* @brief Initialize board specific Watchdog settings
|
||||
*
|
||||
* This function initializes the board specific Watchdog settings and then
|
||||
* calls the Watchdog_init API to initialize the Watchdog module.
|
||||
*
|
||||
* The Watchdog peripherals controlled by the Watchdog module are determined
|
||||
* by the Watchdog_config variable.
|
||||
*/
|
||||
extern void EK_TM4C123GXL_initWatchdog(void);
|
||||
|
||||
/*!
|
||||
* @brief Initialize board specific WiFi settings
|
||||
*
|
||||
* This function initializes the board specific WiFi settings and then calls
|
||||
* the WiFi_init API to initialize the WiFi module.
|
||||
*
|
||||
* The hardware resources controlled by the WiFi module are determined by the
|
||||
* WiFi_config variable.
|
||||
*
|
||||
* A SimpleLink CC3100 device or module is required and must be connected to
|
||||
* use the WiFi driver.
|
||||
*/
|
||||
extern void EK_TM4C123GXL_initWiFi(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __EK_TM4C123GXL_H */
|
197
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp
Normal file
197
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp
Normal file
@ -0,0 +1,197 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, EK-TM4C123GXL board, TI-RTOS kernel (SYS/BIOS)
|
||||
// Last updated for version 5.7.3
|
||||
// Last updated on 2016-10-06
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
//
|
||||
// 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
|
||||
// by the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Alternatively, this program may be distributed and modified under the
|
||||
// terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
// the GNU General Public License and are specifically designed for
|
||||
// licensees interested in retaining the proprietary status of their code.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// Contact information:
|
||||
// http://www.state-machine.com
|
||||
// mailto:info@state-machine.com
|
||||
//****************************************************************************
|
||||
#include "qpcpp.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
#include "Board.h" // the board specific header (TI)
|
||||
#include "ti/sysbios/knl/Clock.h" // the Clock driver (TI)
|
||||
#include "ti/drivers/GPIO.h" // GPIO driver (TI)
|
||||
// add other drivers if necessary...
|
||||
|
||||
// TI-RTOS callback functions ================================================
|
||||
extern "C" {
|
||||
|
||||
// Clock function to service the QP clock tick ...............................
|
||||
static void clk0Fxn(UArg arg0) {
|
||||
// state of the button debouncing, see below
|
||||
static struct ButtonsDebouncing {
|
||||
uint32_t depressed;
|
||||
uint32_t previous;
|
||||
} buttons = { ~0U, ~0U };
|
||||
uint32_t current;
|
||||
uint32_t tmp;
|
||||
|
||||
QP::QF::TICK_X(0U, &l_SysTick_Handler); // process time events for rate 0
|
||||
|
||||
// Perform the debouncing of buttons. The algorithm for debouncing
|
||||
// adapted from the book "Embedded Systems Dictionary" by Jack Ganssle
|
||||
// and Michael Barr, page 71.
|
||||
//
|
||||
current = GPIO_read(EK_TM4C123GXL_SW1); // read SW1
|
||||
tmp = buttons.depressed; // save the debounced depressed buttons
|
||||
buttons.depressed |= (buttons.previous & current); // set depressed
|
||||
buttons.depressed &= (buttons.previous | current); // clear released
|
||||
buttons.previous = current; // update the history
|
||||
tmp ^= buttons.depressed; // changed debounced depressed
|
||||
if (tmp != 0U) { // debounced SW1 state changed?
|
||||
if (buttons.depressed == 0U) { // is SW1 depressed?
|
||||
static QP::QEvt const pauseEvt = { DPP::PAUSE_SIG, 0U, 0U};
|
||||
QP::QF::PUBLISH(&pauseEvt, &l_SysTick_Handler);
|
||||
}
|
||||
else { // the button is released
|
||||
static QP::QEvt const serveEvt = { DPP::SERVE_SIG, 0U, 0U};
|
||||
QP::QF::PUBLISH(&serveEvt, &l_SysTick_Handler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Idle callback (see dpp.cfg) ...............................................
|
||||
void myIdleFunc() {
|
||||
QF_CRIT_STAT_TYPE key;
|
||||
|
||||
QF_CRIT_ENTRY(key);
|
||||
GPIO_write(EK_TM4C123GXL_LED_RED, 1); // turn the LED on
|
||||
GPIO_write(EK_TM4C123GXL_LED_RED, 0); // turn the LED off
|
||||
QF_CRIT_EXIT(key);
|
||||
|
||||
#ifdef NDEBUG
|
||||
// Put the CPU and peripherals to the low-power mode.
|
||||
// you might need to customize the clock management for your application,
|
||||
// see the datasheet for your particular Cortex-M3 MCU.
|
||||
//
|
||||
__asm (" WFI"); // Wait-For-Interrupt
|
||||
#endif
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
static uint32_t l_rnd; // random seed
|
||||
|
||||
// BSP functions =============================================================
|
||||
void BSP::init(void) {
|
||||
/* Call board init functions */
|
||||
Board_initGeneral();
|
||||
Board_initGPIO();
|
||||
|
||||
BSP::randomSeed(1234U);
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
// exercise the FPU with some floating point computations */
|
||||
//
|
||||
float volatile x;
|
||||
x = 3.1415926F;
|
||||
x = x + 2.7182818F;
|
||||
|
||||
GPIO_write(EK_TM4C123GXL_LED_BLUE,
|
||||
((stat[0] == 'e') // Is Philo[n] eating?
|
||||
? 1 // turn the LED1 on
|
||||
: 0)); // turn the LED1 off
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPaused(uint8_t paused) {
|
||||
GPIO_write(EK_TM4C123GXL_LED_GREEN,
|
||||
((paused != 0U) // is Eating paused?
|
||||
? 1 // turn the LED1 on
|
||||
: 0)); // turn the LED1 off
|
||||
}
|
||||
//............................................................................
|
||||
uint32_t BSP::random(void) { // a very cheap pseudo-random-number generator
|
||||
// "Super-Duper" Linear Congruential Generator (LCG)
|
||||
// LCG(2^32, 3*7*11*13*23, 0, seed)
|
||||
//
|
||||
uint32_t rnd = l_rnd * (3U*7U*11U*13U*23U);
|
||||
l_rnd = rnd; // set for the next time
|
||||
|
||||
return (rnd >> 8);
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::randomSeed(uint32_t seed) {
|
||||
l_rnd = seed;
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::terminate(int16_t result) {
|
||||
(void)result;
|
||||
}
|
||||
|
||||
} // namespace DPP
|
||||
|
||||
|
||||
// namespace QP **************************************************************
|
||||
namespace QP {
|
||||
|
||||
// QF callbacks ==============================================================
|
||||
void QF::onStartup(void) {
|
||||
static Clock_Struct clk0Struct;
|
||||
Clock_Params clkParams;
|
||||
|
||||
Clock_Params_init(&clkParams);
|
||||
clkParams.startFlag = TRUE;
|
||||
clkParams.period = 1000U/DPP::BSP::TICKS_PER_SEC;
|
||||
|
||||
// Construct a periodic Clock Instance
|
||||
Clock_construct(&clk0Struct, &clk0Fxn, clkParams.period, &clkParams);
|
||||
}
|
||||
//............................................................................
|
||||
void QF::onCleanup(void) {
|
||||
}
|
||||
|
||||
//............................................................................
|
||||
extern "C" void Q_onAssert(char const *module, int loc) {
|
||||
//
|
||||
// NOTE: add here your application-specific error handling
|
||||
//
|
||||
(void)module;
|
||||
(void)loc;
|
||||
//NVIC_SystemReset();
|
||||
for (;;) { // for-ever loop (NOT a good idea for production code!)
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace QP
|
||||
|
||||
//****************************************************************************
|
||||
// NOTE01:
|
||||
// The User LED is used to visualize the idle loop activity. The brightness
|
||||
// of the LED is proportional to the frequency of invcations of the idle loop.
|
||||
// Please note that the LED is toggled with interrupts locked, so no interrupt
|
||||
// execution time contributes to the brightness of the User LED.
|
||||
//
|
59
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/bsp.h
Normal file
59
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/bsp.h
Normal file
@ -0,0 +1,59 @@
|
||||
//****************************************************************************
|
||||
// Product: DPP example
|
||||
// Last Updated for Version: 5.6.0
|
||||
// Date of the Last Update: 2015-12-28
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
//
|
||||
// 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
|
||||
// by the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Alternatively, this program may be distributed and modified under the
|
||||
// terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
// the GNU General Public License and are specifically designed for
|
||||
// licensees interested in retaining the proprietary status of their code.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// Contact information:
|
||||
// http://www.state-machine.com
|
||||
// mailto:info@state-machine.com
|
||||
//****************************************************************************
|
||||
#ifndef bsp_h
|
||||
#define bsp_h
|
||||
|
||||
namespace DPP {
|
||||
|
||||
class BSP {
|
||||
public:
|
||||
enum { TICKS_PER_SEC = 100 };
|
||||
|
||||
static void init(void);
|
||||
static void displayPaused(uint8_t const paused);
|
||||
static void displayPhilStat(uint8_t const n, char_t const *stat);
|
||||
static void terminate(int16_t const result);
|
||||
|
||||
static void randomSeed(uint32_t const seed); // random seed
|
||||
static uint32_t random(void); // pseudo-random generator
|
||||
|
||||
// for testing...
|
||||
static void wait4SW1(void);
|
||||
static void ledOn(void);
|
||||
static void ledOff(void);
|
||||
};
|
||||
|
||||
} // namespace DPP
|
||||
|
||||
#endif // bsp_h
|
16
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/ccs/.ccsproject
Normal file
16
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/ccs/.ccsproject
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?ccsproject version="1.0"?>
|
||||
<projectOptions>
|
||||
<deviceVariant value="Cortex M.TM4C123GH6PM"/>
|
||||
<deviceFamily value="TMS470"/>
|
||||
<deviceEndianness value="little"/>
|
||||
<codegenToolVersion value="15.12.3.LTS"/>
|
||||
<isElfFormat value="true"/>
|
||||
<rts value="libc.a"/>
|
||||
<createSlaveProjects value=""/>
|
||||
<templateProperties value="id=com_ti_rtsc_tirtostivac_example_107.projectspec.dpp,type=rtsc,products=com.ti.rtsc.TIRTOStivac,xdcToolsVersion=3_32_00_06_core,target=ti.targets.arm.elf.M4F,platform=ti.platforms.tiva:TM4C123GH6PM,buildProfile=release,isHybrid=true,configuroOptions= --compileOptions "${COMPILER_FLAGS} ","/>
|
||||
<origin value="C:\ti\tirtos_tivac_2_16_01_14\resources\ek_tm4C123GXLEvaluationKit\kernelExamples\tiKernelExamples\com_ti_rtsc_tirtostivac_example_107.projectspec"/>
|
||||
<filesToOpen value=""/>
|
||||
<isTargetManual value="false"/>
|
||||
<connection value="common/targetdb/connections/Stellaris_ICDI_Connection.xml"/>
|
||||
</projectOptions>
|
242
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/ccs/.cproject
Normal file
242
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/ccs/.cproject
Normal file
@ -0,0 +1,242 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.871993371">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.871993371" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.rtsc.xdctools.parsers.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;org.eclipse.cdt.core.GmakeErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.871993371" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.871993371." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.DebugToolchain.1001958127" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.linkerDebug.663372193">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.511441121" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C123GH6PM"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="RTSC_MBS_VERSION=2.2.0"/>
|
||||
<listOptionValue builtIn="false" value="XDC_VERSION=3.32.0.06_core"/>
|
||||
<listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.rtsc.TIRTOStivac:2.16.1.14;"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.535851318" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="15.12.3.LTS" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.targetPlatformDebug.98948720" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.builderDebug.1103761835" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerDebug.837177647" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.SILICON_VERSION.1109418226" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.CODE_STATE.375167256" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.ABI.969815557" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.FLOAT_SUPPORT.428283449" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.GCC.1762136936" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.GCC" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DEFINE.385366787" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="ccs="ccs""/>
|
||||
<listOptionValue builtIn="false" value="PART_TM4C123GH6PM"/>
|
||||
<listOptionValue builtIn="false" value="ccs"/>
|
||||
<listOptionValue builtIn="false" value="TIVAWARE"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DEBUGGING_MODEL.732631112" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DIAG_WARNING.59729611" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
<listOptionValue builtIn="false" value="255"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DISPLAY_ERROR_NUMBER.1569490128" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DIAG_WRAP.940073438" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.INCLUDE_PATH.1879591926" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}}""/>
|
||||
<listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.1.71b""/>
|
||||
<listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/bios_6_45_02_31/packages/ti/sysbios/posix""/>
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}\.""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}\..\..""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}\..\..\..\..\..\include""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}\..\..\..\..\..\source""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}\..\..\..\..\..\ports\ti-rtos""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.LITTLE_ENDIAN.75813419" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.GEN_FUNC_SUBSECTIONS.1718718847" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__C_SRCS.351068845" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__CPP_SRCS.648072296" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM_SRCS.1911042138" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM2_SRCS.677036502" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.linkerDebug.663372193" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.MAP_FILE.251265151" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.STACK_SIZE.140203524" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.STACK_SIZE" value="512" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.HEAP_SIZE.1409656282" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.HEAP_SIZE" value="0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.OUTPUT_FILE.414817041" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.XML_LINK_INFO.1338671197" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.DISPLAY_ERROR_NUMBER.1920873600" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.DIAG_WRAP.855932756" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.SEARCH_PATH.2079224679" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.LIBRARY.1029817845" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.1.71b/grlib/ccs/Debug/grlib.lib""/>
|
||||
<listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.1.71b/usblib/ccs/Debug/usblib.lib""/>
|
||||
<listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.1.71b/driverlib/ccs/Debug/driverlib.lib""/>
|
||||
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exeLinker.inputType__CMD_SRCS.200111779" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exeLinker.inputType__CMD2_SRCS.1621676927" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exeLinker.inputType__GEN_CMDS.32688058" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.hex.859973450" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.hex"/>
|
||||
<tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.128897374" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.1631314858" name="Compiler tools directory (-c)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value=""${CG_TOOL_ROOT}"" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.1880731420" name="Target (-t)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.arm.elf.M4F" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.565592108" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="ti.platforms.tiva:TM4C123GH6PM" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.1476420155" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="ti.platforms.tiva:TM4C123GH6PM" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.1646957501" name="Build-profile (-r)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="release" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.420829187" name="Package repositories (--xdcpath)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_REPOS}"/>
|
||||
<listOptionValue builtIn="false" value="${TARGET_CONTENT_BASE}"/>
|
||||
</option>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS.1144441077" name="Additional compiler options (--compileOptions)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value=""${COMPILER_FLAGS} "" valueType="string"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="src|QP/qxk.cpp|QP/qxk_xthr.cpp|QP/qxk_sema.cpp|QP/qxk_mutex.cpp|QP/qv.cpp|QP/qs.cpp|QP/qs_rx.cpp|QP/qs_fp.cpp|QP/qs_64bit.cpp|QP/qk.cpp|QP/qk_mutex.cpp" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Release.745384168">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.745384168" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.rtsc.xdctools.parsers.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;org.eclipse.cdt.core.GmakeErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.745384168" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.745384168." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.ReleaseToolchain.1688154101" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.linkerRelease.1919005369">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1980700705" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C123GH6PM"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="RTSC_MBS_VERSION=2.2.0"/>
|
||||
<listOptionValue builtIn="false" value="XDC_VERSION=3.32.0.06_core"/>
|
||||
<listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.rtsc.TIRTOStivac:2.16.1.14;"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.862518891" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="15.12.3.LTS" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.targetPlatformRelease.572996761" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.targetPlatformRelease"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.builderRelease.1550049120" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.builderRelease"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease.582919424" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.compilerRelease">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.SILICON_VERSION.822560019" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.CODE_STATE.1333226742" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.ABI.1451611218" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.FLOAT_SUPPORT.1797588263" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.GCC.564243209" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.GCC" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DEFINE.1491134882" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="NDEBUG"/>
|
||||
<listOptionValue builtIn="false" value="ccs="ccs""/>
|
||||
<listOptionValue builtIn="false" value="PART_TM4C123GH6PM"/>
|
||||
<listOptionValue builtIn="false" value="ccs"/>
|
||||
<listOptionValue builtIn="false" value="TIVAWARE"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DIAG_WARNING.1186673758" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
<listOptionValue builtIn="false" value="255"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DISPLAY_ERROR_NUMBER.560181315" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DIAG_WRAP.1007825029" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.INCLUDE_PATH.1447772008" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}}""/>
|
||||
<listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.1.71b""/>
|
||||
<listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/bios_6_45_02_31/packages/ti/sysbios/posix""/>
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}\.""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}\..\..""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}\..\..\..\..\..\include""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}\..\..\..\..\..\source""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}\..\..\..\..\..\ports\ti-rtos""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.LITTLE_ENDIAN.1969878995" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DEBUGGING_MODEL.704293309" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.GEN_FUNC_SUBSECTIONS.1599260803" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__C_SRCS.1141847593" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__CPP_SRCS.441319464" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM_SRCS.824777849" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM2_SRCS.1857495374" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.linkerRelease.1919005369" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exe.linkerRelease">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.MAP_FILE.1605909103" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.STACK_SIZE.599307878" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.STACK_SIZE" value="512" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.HEAP_SIZE.1873452014" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.HEAP_SIZE" value="0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.OUTPUT_FILE.816384794" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.XML_LINK_INFO.1543097554" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.DISPLAY_ERROR_NUMBER.223314034" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.DIAG_WRAP.723870869" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.SEARCH_PATH.910591376" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.LIBRARY.858143207" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.1.71b/grlib/ccs/Debug/grlib.lib""/>
|
||||
<listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.1.71b/usblib/ccs/Debug/usblib.lib""/>
|
||||
<listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.1.71b/driverlib/ccs/Debug/driverlib.lib""/>
|
||||
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exeLinker.inputType__CMD_SRCS.1692117445" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exeLinker.inputType__CMD2_SRCS.1653619967" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exeLinker.inputType__GEN_CMDS.248859890" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_15.12.hex.1642039144" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_15.12.hex"/>
|
||||
<tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.95240510" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.482091962" name="Compiler tools directory (-c)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value=""${CG_TOOL_ROOT}"" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.1831938026" name="Target (-t)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.arm.elf.M4F" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.976525046" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="ti.platforms.tiva:TM4C123GH6PM" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.1889118050" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="ti.platforms.tiva:TM4C123GH6PM" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.1335498654" name="Build-profile (-r)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="release" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.942564659" name="Package repositories (--xdcpath)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_REPOS}"/>
|
||||
<listOptionValue builtIn="false" value="${TARGET_CONTENT_BASE}"/>
|
||||
</option>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS.1767098004" name="Additional compiler options (--compileOptions)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value=""${COMPILER_FLAGS} "" valueType="string"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="QP/qxk.cpp|QP/qxk_xthr.cpp|QP/qxk_sema.cpp|QP/qxk_mutex.cpp|QP/qv.cpp|QP/qs.cpp|QP/qs_rx.cpp|QP/qs_fp.cpp|QP/qs_64bit.cpp|QP/qk.cpp|QP/qk_mutex.cpp|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="dpp.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.1121297620" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.language.mapping">
|
||||
<project-mappings>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||
</project-mappings>
|
||||
</storageModule>
|
||||
</cproject>
|
80
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/ccs/.project
Normal file
80
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/ccs/.project
Normal file
@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>dpp</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.rtsc.xdctools.buildDefinitions.XDC.xdcNature</nature>
|
||||
<nature>com.ti.ccstudio.core.ccsNature</nature>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>QP</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-5-PROJECT_LOC/source</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>QP_include</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-5-PROJECT_LOC/include</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>QP_port</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-5-PROJECT_LOC/ports/ti-rtos</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>bsp.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/bsp.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>bsp.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/bsp.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>dpp.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/dpp.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>main.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/main.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>philo.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/philo.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>table.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/table.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>EK_TM4C123GXL.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/EK_TM4C123GXL.c</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
94
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/ccs/Board.h
Normal file
94
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/ccs/Board.h
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Texas Instruments Incorporated
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_H
|
||||
#define __BOARD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "EK_TM4C123GXL.h"
|
||||
|
||||
#define Board_initDMA EK_TM4C123GXL_initDMA
|
||||
#define Board_initGeneral EK_TM4C123GXL_initGeneral
|
||||
#define Board_initGPIO EK_TM4C123GXL_initGPIO
|
||||
#define Board_initI2C EK_TM4C123GXL_initI2C
|
||||
#define Board_initPWM EK_TM4C123GXL_initPWM
|
||||
#define Board_initSDSPI EK_TM4C123GXL_initSDSPI
|
||||
#define Board_initSPI EK_TM4C123GXL_initSPI
|
||||
#define Board_initUART EK_TM4C123GXL_initUART
|
||||
#define Board_initUSB EK_TM4C123GXL_initUSB
|
||||
#define Board_initWatchdog EK_TM4C123GXL_initWatchdog
|
||||
#define Board_initWiFi EK_TM4C123GXL_initWiFi
|
||||
|
||||
#define Board_LED_ON EK_TM4C123GXL_LED_ON
|
||||
#define Board_LED_OFF EK_TM4C123GXL_LED_OFF
|
||||
#define Board_LED0 EK_TM4C123GXL_LED_BLUE
|
||||
#define Board_LED1 EK_TM4C123GXL_LED_GREEN
|
||||
#define Board_LED2 EK_TM4C123GXL_LED_RED
|
||||
#define Board_BUTTON0 EK_TM4C123GXL_SW1
|
||||
#define Board_BUTTON1 EK_TM4C123GXL_SW2
|
||||
|
||||
#define Board_I2C0 EK_TM4C123GXL_I2C0
|
||||
#define Board_I2C1 EK_TM4C123GXL_I2C3
|
||||
#define Board_I2C_TMP EK_TM4C123GXL_I2C3
|
||||
#define Board_I2C_NFC EK_TM4C123GXL_I2C3
|
||||
#define Board_I2C_TPL0401 EK_TM4C123GXL_I2C3
|
||||
|
||||
#define Board_PWM0 EK_TM4C123GXL_PWM6
|
||||
#define Board_PWM1 EK_TM4C123GXL_PWM7
|
||||
|
||||
#define Board_SDSPI0 EK_TM4C123GXL_SDSPI0
|
||||
|
||||
#define Board_SPI0 EK_TM4C123GXL_SPI0
|
||||
#define Board_SPI1 EK_TM4C123GXL_SPI3
|
||||
|
||||
#define Board_USBDEVICE EK_TM4C123GXL_USBDEVICE
|
||||
|
||||
#define Board_UART0 EK_TM4C123GXL_UART0
|
||||
|
||||
#define Board_WATCHDOG0 EK_TM4C123GXL_WATCHDOG0
|
||||
|
||||
#define Board_WIFI EK_TM4C123GXL_WIFI
|
||||
#define Board_WIFI_SPI EK_TM4C123GXL_SPI2
|
||||
|
||||
/* Board specific I2C addresses */
|
||||
#define Board_TMP006_ADDR (0x40)
|
||||
#define Board_RF430CL330_ADDR (0x28)
|
||||
#define Board_TPL0401_ADDR (0x40)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __BOARD_H */
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2016, Texas Instruments Incorporated
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/*
|
||||
* ======== EK_TM4C123GXL.cmd ========
|
||||
* Define the memory block start/length for the EK_TM4C123GXL M4
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (RX) : origin = 0x00000000, length = 0x00040000
|
||||
SRAM (RWX) : origin = 0x20000000, length = 0x00008000
|
||||
}
|
||||
|
||||
/* Section allocation in memory */
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text : > FLASH
|
||||
.const : > FLASH
|
||||
.cinit : > FLASH
|
||||
.pinit : > FLASH
|
||||
.init_array : > FLASH
|
||||
|
||||
.data : > SRAM
|
||||
.bss : > SRAM
|
||||
.sysmem : > SRAM
|
||||
.stack : > SRAM
|
||||
}
|
539
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/ccs/dpp.cfg
Normal file
539
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/ccs/dpp.cfg
Normal file
@ -0,0 +1,539 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2016, Texas Instruments Incorporated
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ================ Clock configuration ================ */
|
||||
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
|
||||
/*
|
||||
* Default value is family dependent. For example, Linux systems often only
|
||||
* support a minimum period of 10000 us and multiples of 10000 us.
|
||||
* TI platforms have a default of 1000 us.
|
||||
*/
|
||||
Clock.tickPeriod = 1000;
|
||||
|
||||
|
||||
|
||||
/* ================ Defaults (module) configuration ================ */
|
||||
var Defaults = xdc.useModule('xdc.runtime.Defaults');
|
||||
/*
|
||||
* A flag to allow module names to be loaded on the target. Module name
|
||||
* strings are placed in the .const section for debugging purposes.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Setting this parameter to true will include name strings in the .const
|
||||
* section so that Errors and Asserts are easier to debug.
|
||||
* - false
|
||||
* Setting this parameter to false will reduce footprint in the .const
|
||||
* section. As a result, Error and Assert messages will contain an
|
||||
* "unknown module" prefix instead of the actual module name.
|
||||
*/
|
||||
Defaults.common$.namedModule = true;
|
||||
//Defaults.common$.namedModule = false;
|
||||
|
||||
|
||||
|
||||
/* ================ Error configuration ================ */
|
||||
var Error = xdc.useModule('xdc.runtime.Error');
|
||||
/*
|
||||
* This function is called to handle all raised errors, but unlike
|
||||
* Error.raiseHook, this function is responsible for completely handling the
|
||||
* error with an appropriately initialized Error_Block.
|
||||
*
|
||||
* Pick one:
|
||||
* - Error.policyDefault (default)
|
||||
* Calls Error.raiseHook with an initialized Error_Block structure and logs
|
||||
* the error using the module's logger.
|
||||
* - Error.policySpin
|
||||
* Simple alternative that traps on a while(1) loop for minimized target
|
||||
* footprint.
|
||||
* Using Error.policySpin, the Error.raiseHook will NOT called.
|
||||
*/
|
||||
Error.policyFxn = Error.policyDefault;
|
||||
//Error.policyFxn = Error.policySpin;
|
||||
|
||||
/*
|
||||
* If Error.policyFxn is set to Error.policyDefault, this function is called
|
||||
* whenever an error is raised by the Error module.
|
||||
*
|
||||
* Pick one:
|
||||
* - Error.print (default)
|
||||
* Errors are formatted and output via System_printf() for easier
|
||||
* debugging.
|
||||
* - null
|
||||
* Errors are not formatted or logged. This option reduces code footprint.
|
||||
* - non-null function
|
||||
* Errors invoke custom user function. See the Error module documentation
|
||||
* for more details.
|
||||
*/
|
||||
Error.raiseHook = Error.print;
|
||||
//Error.raiseHook = null;
|
||||
//Error.raiseHook = "&myErrorFxn";
|
||||
|
||||
/*
|
||||
* If Error.policyFxn is set to Error.policyDefault, this option applies to the
|
||||
* maximum number of times the Error.raiseHook function can be recursively
|
||||
* invoked. This option limits the possibility of an infinite recursion that
|
||||
* could lead to a stack overflow.
|
||||
* The default value is 16.
|
||||
*/
|
||||
Error.maxDepth = 2;
|
||||
|
||||
|
||||
|
||||
/* ================ Hwi configuration ================ */
|
||||
var halHwi = xdc.useModule('ti.sysbios.hal.Hwi');
|
||||
var m3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
|
||||
/*
|
||||
* Checks for Hwi (system) stack overruns while in the Idle loop.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Checks the top word for system stack overflows during the idle loop and
|
||||
* raises an Error if one is detected.
|
||||
* - false
|
||||
* Disabling the runtime check improves runtime performance and yields a
|
||||
* reduced flash footprint.
|
||||
*/
|
||||
halHwi.checkStackFlag = true;
|
||||
//halHwi.checkStackFlag = false;
|
||||
|
||||
/*
|
||||
* The following options alter the system's behavior when a hardware exception
|
||||
* is detected.
|
||||
*
|
||||
* Pick one:
|
||||
* - Hwi.enableException = true
|
||||
* This option causes the default m3Hwi.excHandlerFunc function to fully
|
||||
* decode an exception and dump the registers to the system console.
|
||||
* This option raises errors in the Error module and displays the
|
||||
* exception in ROV.
|
||||
* - Hwi.enableException = false
|
||||
* This option reduces code footprint by not decoding or printing the
|
||||
* exception to the system console.
|
||||
* It however still raises errors in the Error module and displays the
|
||||
* exception in ROV.
|
||||
* - Hwi.excHandlerFunc = null
|
||||
* This is the most aggressive option for code footprint savings; but it
|
||||
* can difficult to debug exceptions. It reduces flash footprint by
|
||||
* plugging in a default while(1) trap when exception occur. This option
|
||||
* does not raise an error with the Error module.
|
||||
*/
|
||||
m3Hwi.enableException = true;
|
||||
//m3Hwi.enableException = false;
|
||||
//m3Hwi.excHandlerFunc = null;
|
||||
|
||||
/*
|
||||
* Enable hardware exception generation when dividing by zero.
|
||||
*
|
||||
* Pick one:
|
||||
* - 0 (default)
|
||||
* Disables hardware exceptions when dividing by zero
|
||||
* - 1
|
||||
* Enables hardware exceptions when dividing by zero
|
||||
*/
|
||||
m3Hwi.nvicCCR.DIV_0_TRP = 0;
|
||||
//m3Hwi.nvicCCR.DIV_0_TRP = 1;
|
||||
|
||||
/*
|
||||
* Enable hardware exception generation for invalid data alignment.
|
||||
*
|
||||
* Pick one:
|
||||
* - 0 (default)
|
||||
* Disables hardware exceptions for data alignment
|
||||
* - 1
|
||||
* Enables hardware exceptions for data alignment
|
||||
*/
|
||||
m3Hwi.nvicCCR.UNALIGN_TRP = 0;
|
||||
//m3Hwi.nvicCCR.UNALIGN_TRP = 1;
|
||||
|
||||
|
||||
|
||||
/* ================ Idle configuration ================ */
|
||||
var Idle = xdc.useModule('ti.sysbios.knl.Idle');
|
||||
/*
|
||||
* The Idle module is used to specify a list of functions to be called when no
|
||||
* other tasks are running in the system.
|
||||
*
|
||||
* Functions added here will be run continuously within the idle task.
|
||||
*
|
||||
* Function signature:
|
||||
* Void func(Void);
|
||||
*/
|
||||
Idle.addFunc("&myIdleFunc");
|
||||
|
||||
|
||||
|
||||
/* ================ Kernel (SYS/BIOS) configuration ================ */
|
||||
var BIOS = xdc.useModule('ti.sysbios.BIOS');
|
||||
/*
|
||||
* Enable asserts in the BIOS library.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Enables asserts for debugging purposes.
|
||||
* - false
|
||||
* Disables asserts for a reduced code footprint and better performance.
|
||||
*/
|
||||
//BIOS.assertsEnabled = true;
|
||||
BIOS.assertsEnabled = false;
|
||||
|
||||
/*
|
||||
* Specify default heap size for BIOS.
|
||||
*/
|
||||
BIOS.heapSize = 1024;
|
||||
|
||||
/*
|
||||
* A flag to determine if xdc.runtime sources are to be included in a custom
|
||||
* built BIOS library.
|
||||
*
|
||||
* Pick one:
|
||||
* - false (default)
|
||||
* The pre-built xdc.runtime library is provided by the respective target
|
||||
* used to build the application.
|
||||
* - true
|
||||
* xdc.runtime library sources are to be included in the custom BIOS
|
||||
* library. This option yields the most efficient library in both code
|
||||
* footprint and runtime performance.
|
||||
*/
|
||||
BIOS.includeXdcRuntime = false;
|
||||
//BIOS.includeXdcRuntime = true;
|
||||
|
||||
/*
|
||||
* The SYS/BIOS runtime is provided in the form of a library that is linked
|
||||
* with the application. Several forms of this library are provided with the
|
||||
* SYS/BIOS product.
|
||||
*
|
||||
* Pick one:
|
||||
* - BIOS.LibType_Custom
|
||||
* Custom built library that is highly optimized for code footprint and
|
||||
* runtime performance.
|
||||
* - BIOS.LibType_Debug
|
||||
* Custom built library that is non-optimized that can be used to
|
||||
* single-step through APIs with a debugger.
|
||||
*
|
||||
*/
|
||||
BIOS.libType = BIOS.LibType_Custom;
|
||||
//BIOS.libType = BIOS.LibType_Debug;
|
||||
|
||||
/*
|
||||
* Runtime instance creation enable flag.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Allows Mod_create() and Mod_delete() to be called at runtime which
|
||||
* requires a default heap for dynamic memory allocation.
|
||||
* - false
|
||||
* Reduces code footprint by disallowing Mod_create() and Mod_delete() to
|
||||
* be called at runtime. Object instances are constructed via
|
||||
* Mod_construct() and destructed via Mod_destruct().
|
||||
*/
|
||||
BIOS.runtimeCreatesEnabled = true;
|
||||
//BIOS.runtimeCreatesEnabled = false;
|
||||
|
||||
/*
|
||||
* Enable logs in the BIOS library.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Enables logs for debugging purposes.
|
||||
* - false
|
||||
* Disables logging for reduced code footprint and improved runtime
|
||||
* performance.
|
||||
*/
|
||||
//BIOS.logsEnabled = true;
|
||||
BIOS.logsEnabled = false;
|
||||
|
||||
|
||||
|
||||
/* ================ Memory configuration ================ */
|
||||
var Memory = xdc.useModule('xdc.runtime.Memory');
|
||||
/*
|
||||
* The Memory module itself simply provides a common interface for any
|
||||
* variety of system and application specific memory management policies
|
||||
* implemented by the IHeap modules(Ex. HeapMem, HeapBuf).
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ================ Program configuration ================ */
|
||||
/*
|
||||
* Program.stack is ignored with IAR. Use the project options in
|
||||
* IAR Embedded Workbench to alter the system stack size.
|
||||
*/
|
||||
if (!Program.build.target.$name.match(/iar/)) {
|
||||
/*
|
||||
* Reducing the system stack size (used by ISRs and Swis) to reduce
|
||||
* RAM usage.
|
||||
*/
|
||||
Program.stack = 768;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Enable Semihosting for GNU targets to print to CCS console
|
||||
*/
|
||||
if (Program.build.target.$name.match(/gnu/)) {
|
||||
var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
|
||||
}
|
||||
/* ================ Semaphore configuration ================ */
|
||||
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
|
||||
/*
|
||||
* Enables global support for Task priority pend queuing.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* This allows pending tasks to be serviced based on their task priority.
|
||||
* - false
|
||||
* Pending tasks are services based on first in, first out basis.
|
||||
*
|
||||
* When using BIOS in ROM:
|
||||
* This option must be set to false.
|
||||
*/
|
||||
//Semaphore.supportsPriority = true;
|
||||
Semaphore.supportsPriority = false;
|
||||
|
||||
/*
|
||||
* Allows for the implicit posting of events through the semaphore,
|
||||
* disable for additional code saving.
|
||||
*
|
||||
* Pick one:
|
||||
* - true
|
||||
* This allows the Semaphore module to post semaphores and events
|
||||
* simultaneously.
|
||||
* - false (default)
|
||||
* Events must be explicitly posted to unblock tasks.
|
||||
*
|
||||
*/
|
||||
//Semaphore.supportsEvents = true;
|
||||
Semaphore.supportsEvents = false;
|
||||
|
||||
|
||||
|
||||
/* ================ Swi configuration ================ */
|
||||
var Swi = xdc.useModule('ti.sysbios.knl.Swi');
|
||||
/*
|
||||
* A software interrupt is an object that encapsulates a function to be
|
||||
* executed and a priority. Software interrupts are prioritized, preempt tasks
|
||||
* and are preempted by hardware interrupt service routines.
|
||||
*
|
||||
* This module is included to allow Swi's in a users' application.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ================ System configuration ================ */
|
||||
var System = xdc.useModule('xdc.runtime.System');
|
||||
/*
|
||||
* The Abort handler is called when the system exits abnormally.
|
||||
*
|
||||
* Pick one:
|
||||
* - System.abortStd (default)
|
||||
* Call the ANSI C Standard 'abort()' to terminate the application.
|
||||
* - System.abortSpin
|
||||
* A lightweight abort function that loops indefinitely in a while(1) trap
|
||||
* function.
|
||||
* - A custom abort handler
|
||||
* A user-defined function. See the System module documentation for
|
||||
* details.
|
||||
*/
|
||||
System.abortFxn = System.abortStd;
|
||||
//System.abortFxn = System.abortSpin;
|
||||
//System.abortFxn = "&myAbortSystem";
|
||||
|
||||
/*
|
||||
* The Exit handler is called when the system exits normally.
|
||||
*
|
||||
* Pick one:
|
||||
* - System.exitStd (default)
|
||||
* Call the ANSI C Standard 'exit()' to terminate the application.
|
||||
* - System.exitSpin
|
||||
* A lightweight exit function that loops indefinitely in a while(1) trap
|
||||
* function.
|
||||
* - A custom exit function
|
||||
* A user-defined function. See the System module documentation for
|
||||
* details.
|
||||
*/
|
||||
System.exitFxn = System.exitStd;
|
||||
//System.exitFxn = System.exitSpin;
|
||||
//System.exitFxn = "&myExitSystem";
|
||||
|
||||
/*
|
||||
* Minimize exit handler array in the System module. The System module includes
|
||||
* an array of functions that are registered with System_atexit() which is
|
||||
* called by System_exit(). The default value is 8.
|
||||
*/
|
||||
System.maxAtexitHandlers = 2;
|
||||
|
||||
/*
|
||||
* The System.SupportProxy defines a low-level implementation of System
|
||||
* functions such as System_printf(), System_flush(), etc.
|
||||
*
|
||||
* Pick one pair:
|
||||
* - SysMin
|
||||
* This module maintains an internal configurable circular buffer that
|
||||
* stores the output until System_flush() is called.
|
||||
* The size of the circular buffer is set via SysMin.bufSize.
|
||||
* - SysCallback
|
||||
* SysCallback allows for user-defined implementations for System APIs.
|
||||
* The SysCallback support proxy has a smaller code footprint and can be
|
||||
* used to supply custom System_printf services.
|
||||
* The default SysCallback functions point to stub functions. See the
|
||||
* SysCallback module's documentation.
|
||||
*/
|
||||
var SysMin = xdc.useModule('xdc.runtime.SysMin');
|
||||
SysMin.bufSize = 512;
|
||||
System.SupportProxy = SysMin;
|
||||
//var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
|
||||
//System.SupportProxy = SysCallback;
|
||||
//SysCallback.abortFxn = "&myUserAbort";
|
||||
//SysCallback.exitFxn = "&myUserExit";
|
||||
//SysCallback.flushFxn = "&myUserFlush";
|
||||
//SysCallback.putchFxn = "&myUserPutch";
|
||||
//SysCallback.readyFxn = "&myUserReady";
|
||||
|
||||
|
||||
|
||||
|
||||
/* ================ Task configuration ================ */
|
||||
var Task = xdc.useModule('ti.sysbios.knl.Task');
|
||||
/*
|
||||
* Check task stacks for overflow conditions.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Enables runtime checks for task stack overflow conditions during
|
||||
* context switching ("from" and "to")
|
||||
* - false
|
||||
* Disables runtime checks for task stack overflow conditions.
|
||||
*/
|
||||
Task.checkStackFlag = true;
|
||||
//Task.checkStackFlag = false;
|
||||
|
||||
/*
|
||||
* Set the default task stack size when creating tasks.
|
||||
*
|
||||
* The default is dependent on the device being used. Reducing the default stack
|
||||
* size yields greater memory savings.
|
||||
*/
|
||||
Task.defaultStackSize = 512;
|
||||
|
||||
/*
|
||||
* Enables the idle task.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Creates a task with priority of 0 which calls idle hook functions. This
|
||||
* option must be set to true to gain power savings provided by the Power
|
||||
* module.
|
||||
* - false
|
||||
* No idle task is created. This option consumes less memory as no
|
||||
* additional default task stack is needed.
|
||||
* To gain power savings by the Power module without having the idle task,
|
||||
* add Idle.run as the Task.allBlockedFunc.
|
||||
*/
|
||||
//Task.enableIdleTask = true;
|
||||
//Task.enableIdleTask = false;
|
||||
Task.allBlockedFunc = Idle.run;
|
||||
|
||||
/*
|
||||
* If Task.enableIdleTask is set to true, this option sets the idle task's
|
||||
* stack size.
|
||||
*
|
||||
* Reducing the idle stack size yields greater memory savings.
|
||||
*/
|
||||
Task.idleTaskStackSize = 512;
|
||||
|
||||
/*
|
||||
* Reduce the number of task priorities.
|
||||
* The default is 16.
|
||||
* Decreasing the number of task priorities yield memory savings.
|
||||
*/
|
||||
Task.numPriorities = 16;
|
||||
|
||||
|
||||
|
||||
/* ================ Text configuration ================ */
|
||||
var Text = xdc.useModule('xdc.runtime.Text');
|
||||
/*
|
||||
* These strings are placed in the .const section. Setting this parameter to
|
||||
* false will save space in the .const section. Error, Assert and Log messages
|
||||
* will print raw ids and args instead of a formatted message.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* This option loads test string into the .const for easier debugging.
|
||||
* - false
|
||||
* This option reduces the .const footprint.
|
||||
*/
|
||||
Text.isLoaded = true;
|
||||
//Text.isLoaded = false;
|
||||
|
||||
|
||||
|
||||
/* ================ Types configuration ================ */
|
||||
var Types = xdc.useModule('xdc.runtime.Types');
|
||||
/*
|
||||
* This module defines basic constants and types used throughout the
|
||||
* xdc.runtime package.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ================ TI-RTOS middleware configuration ================ */
|
||||
var mwConfig = xdc.useModule('ti.mw.Config');
|
||||
/*
|
||||
* Include TI-RTOS middleware libraries
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ================ TI-RTOS drivers' configuration ================ */
|
||||
var driversConfig = xdc.useModule('ti.drivers.Config');
|
||||
/*
|
||||
* Include TI-RTOS drivers
|
||||
*
|
||||
* Pick one:
|
||||
* - driversConfig.LibType_NonInstrumented (default)
|
||||
* Use TI-RTOS drivers library optimized for footprint and performance
|
||||
* without asserts or logs.
|
||||
* - driversConfig.LibType_Instrumented
|
||||
* Use TI-RTOS drivers library for debugging with asserts and logs enabled.
|
||||
*/
|
||||
driversConfig.libType = driversConfig.LibType_NonInstrumented;
|
||||
//driversConfig.libType = driversConfig.LibType_Instrumented;
|
||||
|
||||
|
||||
|
||||
/* ================ Application Specific Instances ================ */
|
24
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/ccs/makefile.defs
Normal file
24
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/ccs/makefile.defs
Normal file
@ -0,0 +1,24 @@
|
||||
#File used to help "Clean Project" in CCS completely clean the kernel files
|
||||
CFG_SRCDIR = ../src
|
||||
|
||||
ifneq (,$(findstring :,$(WINDIR)$(windir)$(COMSPEC)$(comspec)))
|
||||
# if Windows, use copy to touch file dates
|
||||
TOUCH = copy /b $(subst /,\,$@)+,, $(subst /,\,$@)
|
||||
else
|
||||
TOUCH = touch $@
|
||||
endif
|
||||
|
||||
# include Config generated top-level makefile
|
||||
-include $(CFG_SRCDIR)/makefile.libs
|
||||
|
||||
ifneq (clean,$(MAKECMDGOALS))
|
||||
# ensure this file is reloaded when .cfg files change but after config runs
|
||||
$(CFG_SRCDIR)/makefile.libs: $(GEN_OPTS) $(CFG_SRCS)
|
||||
-@$(if $(wildcard $@),$(TOUCH),:)
|
||||
endif
|
||||
|
||||
#add generated makefile to list of files to delete during a clean
|
||||
GEN_MISC_FILES__QUOTED += "$(CFG_SRCDIR)/makefile.libs"
|
||||
|
||||
#add generated source dir to list of directories to delete during a clean
|
||||
#GEN_MISC_DIRS__QTD += "$(CFG_SRCDIR)"
|
75
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/dpp.h
Normal file
75
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/dpp.h
Normal file
@ -0,0 +1,75 @@
|
||||
//****************************************************************************
|
||||
// Model: dpp.qm
|
||||
// File: ./dpp.h
|
||||
//
|
||||
// This code has been generated by QM tool (see state-machine.com/qm).
|
||||
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
||||
//
|
||||
// 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
|
||||
// by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
// for more details.
|
||||
//****************************************************************************
|
||||
//${.::dpp.h} ................................................................
|
||||
#ifndef dpp_h
|
||||
#define dpp_h
|
||||
|
||||
namespace DPP {
|
||||
|
||||
enum DPPSignals {
|
||||
EAT_SIG = QP::Q_USER_SIG, // published by Table to let a philosopher eat
|
||||
DONE_SIG, // published by Philosopher when done eating
|
||||
PAUSE_SIG, // published by BSP to pause the application
|
||||
SERVE_SIG, // published by BSP to serve re-start serving forks
|
||||
TEST_SIG, // published by BSP to test the application
|
||||
MAX_PUB_SIG, // the last published signal
|
||||
|
||||
HUNGRY_SIG, // posted direclty to Table from hungry Philo
|
||||
MAX_SIG // the last signal
|
||||
};
|
||||
|
||||
} // namespace DPP
|
||||
|
||||
namespace DPP {
|
||||
|
||||
//${Events::TableEvt} ........................................................
|
||||
class TableEvt : public QP::QEvt {
|
||||
public:
|
||||
uint8_t philoNum;
|
||||
};
|
||||
|
||||
} // namespace DPP
|
||||
|
||||
// number of philosophers
|
||||
#define N_PHILO ((uint8_t)5)
|
||||
|
||||
namespace DPP {
|
||||
|
||||
extern QP::QMActive * const AO_Philo[N_PHILO];
|
||||
|
||||
} // namespace DPP
|
||||
|
||||
namespace DPP {
|
||||
|
||||
extern QP::QMActive * const AO_Table;
|
||||
|
||||
} // namespace DPP
|
||||
|
||||
#ifdef qxk_h
|
||||
namespace DPP {
|
||||
|
||||
extern QP::QXThread * const XT_Test1;
|
||||
|
||||
} // namespace DPP
|
||||
namespace DPP {
|
||||
|
||||
extern QP::QXThread * const XT_Test2;
|
||||
|
||||
} // namespace DPP
|
||||
#endif // qxk_h
|
||||
|
||||
#endif // dpp_h
|
457
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/dpp.qm
Normal file
457
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/dpp.qm
Normal file
@ -0,0 +1,457 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<model version="3.3.0">
|
||||
<documentation>Dining Philosopher Problem example with MSM state machines</documentation>
|
||||
<framework name="qpcpp"/>
|
||||
<package name="Events" stereotype="0x01" namespace="DPP::">
|
||||
<class name="TableEvt" superclass="qpcpp::QEvt">
|
||||
<attribute name="philoNum" type="uint8_t" visibility="0x00" properties="0x00"/>
|
||||
</class>
|
||||
</package>
|
||||
<package name="AOs" stereotype="0x02" namespace="DPP::">
|
||||
<class name="Philo" superclass="qpcpp::QMActive">
|
||||
<attribute name="m_timeEvt" type="QP::QTimeEvt" visibility="0x02" properties="0x00"/>
|
||||
<operation name="Philo" type="" visibility="0x00" properties="0x00">
|
||||
<code> : QMActive(Q_STATE_CAST(&Philo::initial)),
|
||||
m_timeEvt(this, TIMEOUT_SIG, 0U)</code>
|
||||
</operation>
|
||||
<statechart>
|
||||
<initial target="../1">
|
||||
<action>static bool registered = false; // starts off with 0, per C-standard
|
||||
(void)e; // suppress the compiler warning about unused parameter
|
||||
if (!registered) {
|
||||
registered = true;
|
||||
|
||||
QS_OBJ_DICTIONARY(&l_philo[0]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[0].m_timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[1]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[1].m_timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[2]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[2].m_timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[3]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[3].m_timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[4]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[4].m_timeEvt);
|
||||
|
||||
QS_FUN_DICTIONARY(&Philo::initial);
|
||||
QS_FUN_DICTIONARY(&Philo::thinking);
|
||||
QS_FUN_DICTIONARY(&Philo::hungry);
|
||||
QS_FUN_DICTIONARY(&Philo::eating);
|
||||
}
|
||||
QS_SIG_DICTIONARY(HUNGRY_SIG, me); // signal for each Philos
|
||||
QS_SIG_DICTIONARY(TIMEOUT_SIG, me); // signal for each Philos
|
||||
|
||||
me->subscribe(EAT_SIG);
|
||||
me->subscribe(TEST_SIG);</action>
|
||||
<initial_glyph conn="2,3,5,1,20,5,-3">
|
||||
<action box="0,-2,6,2"/>
|
||||
</initial_glyph>
|
||||
</initial>
|
||||
<state name="thinking">
|
||||
<entry>me->m_timeEvt.armX(think_time(), 0U);</entry>
|
||||
<exit>(void)me->m_timeEvt.disarm();</exit>
|
||||
<tran trig="TIMEOUT" target="../../2">
|
||||
<tran_glyph conn="2,13,3,1,20,12,-3">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="EAT, DONE">
|
||||
<action>/* EAT or DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));</action>
|
||||
<tran_glyph conn="2,16,3,-1,13">
|
||||
<action box="0,-2,14,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="TEST">
|
||||
<tran_glyph conn="2,19,3,-1,13">
|
||||
<action box="0,-2,11,4"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="2,5,17,16">
|
||||
<entry box="1,2,5,2"/>
|
||||
<exit box="1,4,5,2"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state name="hungry">
|
||||
<entry>TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
|
||||
pe->philoNum = PHILO_ID(me);
|
||||
AO_Table->POST(pe, me);</entry>
|
||||
<tran trig="EAT">
|
||||
<choice target="../../../3">
|
||||
<guard>Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)</guard>
|
||||
<choice_glyph conn="15,30,5,1,7,13,-3">
|
||||
<action box="1,0,19,4"/>
|
||||
</choice_glyph>
|
||||
</choice>
|
||||
<tran_glyph conn="2,30,3,-1,13">
|
||||
<action box="0,-2,14,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="DONE">
|
||||
<action>/* DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));</action>
|
||||
<tran_glyph conn="2,36,3,-1,14">
|
||||
<action box="0,-2,14,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="2,23,17,16">
|
||||
<entry box="1,2,5,2"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state name="eating">
|
||||
<entry>me->m_timeEvt.armX(eat_time(), 0U);</entry>
|
||||
<exit>TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
|
||||
pe->philoNum = PHILO_ID(me);
|
||||
QP::QF::PUBLISH(pe, me);
|
||||
(void)me->m_timeEvt.disarm();</exit>
|
||||
<tran trig="TIMEOUT" target="../../1">
|
||||
<tran_glyph conn="2,51,3,1,22,-41,-5">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="EAT, DONE">
|
||||
<action>/* EAT or DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));</action>
|
||||
<tran_glyph conn="2,55,3,-1,13">
|
||||
<action box="0,-2,14,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="2,41,17,18">
|
||||
<entry box="1,2,5,2"/>
|
||||
<exit box="1,4,5,2"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state_diagram size="37,61"/>
|
||||
</statechart>
|
||||
</class>
|
||||
<class name="Table" superclass="qpcpp::QMActive">
|
||||
<attribute name="m_fork[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
|
||||
<attribute name="m_isHungry[N_PHILO]" type="bool" visibility="0x02" properties="0x00"/>
|
||||
<operation name="Table" type="" visibility="0x00" properties="0x00">
|
||||
<code> : QMActive(Q_STATE_CAST(&Table::initial))
|
||||
|
||||
for (uint8_t n = 0U; n < N_PHILO; ++n) {
|
||||
m_fork[n] = FREE;
|
||||
m_isHungry[n] = false;
|
||||
}</code>
|
||||
</operation>
|
||||
<statechart>
|
||||
<initial target="../1/2">
|
||||
<action>(void)e; // suppress the compiler warning about unused parameter
|
||||
|
||||
QS_OBJ_DICTIONARY(&l_table);
|
||||
QS_FUN_DICTIONARY(&QP::QHsm::top);
|
||||
QS_FUN_DICTIONARY(&Table::initial);
|
||||
QS_FUN_DICTIONARY(&Table::active);
|
||||
QS_FUN_DICTIONARY(&Table::serving);
|
||||
QS_FUN_DICTIONARY(&Table::paused);
|
||||
|
||||
QS_SIG_DICTIONARY(DONE_SIG, (void *)0); // global signals
|
||||
QS_SIG_DICTIONARY(EAT_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(PAUSE_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(SERVE_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(TEST_SIG, (void *)0);
|
||||
|
||||
QS_SIG_DICTIONARY(HUNGRY_SIG, me); // signal just for Table
|
||||
|
||||
me->subscribe(DONE_SIG);
|
||||
me->subscribe(PAUSE_SIG);
|
||||
me->subscribe(SERVE_SIG);
|
||||
me->subscribe(TEST_SIG);
|
||||
|
||||
for (uint8_t n = 0U; n < N_PHILO; ++n) {
|
||||
me->m_fork[n] = FREE;
|
||||
me->m_isHungry[n] = false;
|
||||
BSP::displayPhilStat(n, THINKING);
|
||||
}</action>
|
||||
<initial_glyph conn="3,3,5,1,44,18,-9">
|
||||
<action box="0,-2,6,2"/>
|
||||
</initial_glyph>
|
||||
</initial>
|
||||
<state name="active">
|
||||
<tran trig="TEST">
|
||||
<tran_glyph conn="2,11,3,-1,14">
|
||||
<action box="0,-2,11,4"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="EAT">
|
||||
<action>Q_ERROR();</action>
|
||||
<tran_glyph conn="2,15,3,-1,14">
|
||||
<action box="0,-2,10,4"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state name="serving">
|
||||
<entry brief="give pending permitions to eat">for (uint8_t n = 0U; n < N_PHILO; ++n) { // give permissions to eat...
|
||||
if (me->m_isHungry[n]
|
||||
&& (me->m_fork[LEFT(n)] == FREE)
|
||||
&& (me->m_fork[n] == FREE))
|
||||
{
|
||||
me->m_fork[LEFT(n)] = USED;
|
||||
me->m_fork[n] = USED;
|
||||
TableEvt *te = Q_NEW(TableEvt, EAT_SIG);
|
||||
te->philoNum = n;
|
||||
QP::QF::PUBLISH(te, me);
|
||||
me->m_isHungry[n] = false;
|
||||
BSP::displayPhilStat(n, EATING);
|
||||
}
|
||||
}</entry>
|
||||
<tran trig="HUNGRY">
|
||||
<action>uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
// phil ID must be in range and he must be not hungry
|
||||
Q_ASSERT((n < N_PHILO) && (!me->m_isHungry[n]));
|
||||
|
||||
BSP::displayPhilStat(n, HUNGRY);
|
||||
uint8_t m = LEFT(n);</action>
|
||||
<choice>
|
||||
<guard brief="both free">(me->m_fork[m] == FREE) && (me->m_fork[n] == FREE)</guard>
|
||||
<action>me->m_fork[m] = USED;
|
||||
me->m_fork[n] = USED;
|
||||
TableEvt *pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = n;
|
||||
QP::QF::PUBLISH(pe, me);
|
||||
BSP::displayPhilStat(n, EATING);</action>
|
||||
<choice_glyph conn="19,26,5,-1,10">
|
||||
<action box="1,0,10,2"/>
|
||||
</choice_glyph>
|
||||
</choice>
|
||||
<choice>
|
||||
<guard>else</guard>
|
||||
<action>me->m_isHungry[n] = true;</action>
|
||||
<choice_glyph conn="19,26,4,-1,5,10">
|
||||
<action box="1,5,6,2"/>
|
||||
</choice_glyph>
|
||||
</choice>
|
||||
<tran_glyph conn="4,26,3,-1,15">
|
||||
<action box="0,-2,8,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="DONE">
|
||||
<action>uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
// phil ID must be in range and he must be not hungry
|
||||
Q_ASSERT((n < N_PHILO) && (!me->m_isHungry[n]));
|
||||
|
||||
BSP::displayPhilStat(n, THINKING);
|
||||
uint8_t m = LEFT(n);
|
||||
// both forks of Phil[n] must be used
|
||||
Q_ASSERT((me->m_fork[n] == USED) && (me->m_fork[m] == USED));
|
||||
|
||||
me->m_fork[m] = FREE;
|
||||
me->m_fork[n] = FREE;
|
||||
m = RIGHT(n); // check the right neighbor
|
||||
|
||||
if (me->m_isHungry[m] && (me->m_fork[m] == FREE)) {
|
||||
me->m_fork[n] = USED;
|
||||
me->m_fork[m] = USED;
|
||||
me->m_isHungry[m] = false;
|
||||
TableEvt *pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = m;
|
||||
QP::QF::PUBLISH(pe, me);
|
||||
BSP::displayPhilStat(m, EATING);
|
||||
}
|
||||
m = LEFT(n); // check the left neighbor
|
||||
n = LEFT(m); // left fork of the left neighbor
|
||||
if (me->m_isHungry[m] && (me->m_fork[n] == FREE)) {
|
||||
me->m_fork[m] = USED;
|
||||
me->m_fork[n] = USED;
|
||||
me->m_isHungry[m] = false;
|
||||
TableEvt *pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = m;
|
||||
QP::QF::PUBLISH(pe, me);
|
||||
BSP::displayPhilStat(m, EATING);
|
||||
}</action>
|
||||
<tran_glyph conn="4,34,3,-1,15">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="EAT">
|
||||
<action>Q_ERROR();</action>
|
||||
<tran_glyph conn="4,37,3,-1,15">
|
||||
<action box="0,-2,12,4"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="PAUSE" target="../../3">
|
||||
<tran_glyph conn="4,41,3,1,37,6,-3">
|
||||
<action box="0,-2,7,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="4,19,34,24">
|
||||
<entry box="1,2,27,2"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state name="paused">
|
||||
<entry>BSP::displayPaused(1U);</entry>
|
||||
<exit>BSP::displayPaused(0U);</exit>
|
||||
<tran trig="SERVE" target="../../2">
|
||||
<tran_glyph conn="4,57,3,1,39,-29,-5">
|
||||
<action box="0,-2,7,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="HUNGRY">
|
||||
<action>uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
// philo ID must be in range and he must be not hungry
|
||||
Q_ASSERT((n < N_PHILO) && (!me->m_isHungry[n]));
|
||||
me->m_isHungry[n] = true;
|
||||
BSP::displayPhilStat(n, HUNGRY);</action>
|
||||
<tran_glyph conn="4,60,3,-1,15">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="DONE">
|
||||
<action>uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
// phil ID must be in range and he must be not hungry
|
||||
Q_ASSERT((n < N_PHILO) && (!me->m_isHungry[n]));
|
||||
|
||||
BSP::displayPhilStat(n, THINKING);
|
||||
uint8_t m = LEFT(n);
|
||||
/* both forks of Phil[n] must be used */
|
||||
Q_ASSERT((me->m_fork[n] == USED) && (me->m_fork[m] == USED));
|
||||
|
||||
me->m_fork[m] = FREE;
|
||||
me->m_fork[n] = FREE;</action>
|
||||
<tran_glyph conn="4,63,3,-1,15">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="4,45,34,20">
|
||||
<entry box="1,2,18,4"/>
|
||||
<exit box="1,6,18,4"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state_glyph node="2,5,43,62"/>
|
||||
</state>
|
||||
<state_diagram size="49,69"/>
|
||||
</statechart>
|
||||
</class>
|
||||
<attribute name="AO_Philo[N_PHILO]" type="QP::QMActive * const" visibility="0x00" properties="0x00"/>
|
||||
<attribute name="AO_Table" type="QP::QMActive * const" visibility="0x00" properties="0x00"/>
|
||||
<attribute name="XT_Test1" type="QP::QXThread * const" visibility="0x00" properties="0x00"/>
|
||||
<attribute name="XT_Test2" type="QP::QXThread * const" visibility="0x00" properties="0x00"/>
|
||||
</package>
|
||||
<directory name=".">
|
||||
<file name="dpp.h">
|
||||
<text>#ifndef dpp_h
|
||||
#define dpp_h
|
||||
|
||||
namespace DPP {
|
||||
|
||||
enum DPPSignals {
|
||||
EAT_SIG = QP::Q_USER_SIG, // published by Table to let a philosopher eat
|
||||
DONE_SIG, // published by Philosopher when done eating
|
||||
PAUSE_SIG, // published by BSP to pause the application
|
||||
SERVE_SIG, // published by BSP to serve re-start serving forks
|
||||
TEST_SIG, // published by BSP to test the application
|
||||
MAX_PUB_SIG, // the last published signal
|
||||
|
||||
HUNGRY_SIG, // posted direclty to Table from hungry Philo
|
||||
MAX_SIG // the last signal
|
||||
};
|
||||
|
||||
} // namespace DPP
|
||||
|
||||
$declare(Events::TableEvt)
|
||||
|
||||
// number of philosophers
|
||||
#define N_PHILO ((uint8_t)5)
|
||||
|
||||
$declare(AOs::AO_Philo[N_PHILO])
|
||||
|
||||
$declare(AOs::AO_Table)
|
||||
|
||||
#ifdef qxk_h
|
||||
$declare(AOs::XT_Test1)
|
||||
$declare(AOs::XT_Test2)
|
||||
#endif // qxk_h
|
||||
|
||||
#endif // dpp_h</text>
|
||||
</file>
|
||||
<file name="philo.cpp">
|
||||
<text>#include "qpcpp.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
// Active object class -------------------------------------------------------
|
||||
$declare(AOs::Philo)
|
||||
|
||||
namespace DPP {
|
||||
|
||||
// Local objects -------------------------------------------------------------
|
||||
static Philo l_philo[N_PHILO]; // storage for all Philos
|
||||
|
||||
// helper function to provide a randomized think time for Philos
|
||||
inline QP::QTimeEvtCtr think_time() {
|
||||
return static_cast<QP::QTimeEvtCtr>((BSP::random() % BSP::TICKS_PER_SEC)
|
||||
+ (BSP::TICKS_PER_SEC/2U));
|
||||
}
|
||||
|
||||
// helper function to provide a randomized eat time for Philos
|
||||
inline QP::QTimeEvtCtr eat_time() {
|
||||
return static_cast<QP::QTimeEvtCtr>((BSP::random() % BSP::TICKS_PER_SEC)
|
||||
+ BSP::TICKS_PER_SEC);
|
||||
}
|
||||
|
||||
// helper function to provide the ID of Philo "me"
|
||||
inline uint8_t PHILO_ID(Philo const * const me) {
|
||||
return static_cast<uint8_t>(me - l_philo);
|
||||
}
|
||||
|
||||
enum InternalSignals { // internal signals
|
||||
TIMEOUT_SIG = MAX_SIG
|
||||
};
|
||||
|
||||
// Global objects ------------------------------------------------------------
|
||||
QP::QMActive * const AO_Philo[N_PHILO] = { // "opaque" pointers to Philo AO
|
||||
&l_philo[0],
|
||||
&l_philo[1],
|
||||
&l_philo[2],
|
||||
&l_philo[3],
|
||||
&l_philo[4]
|
||||
};
|
||||
|
||||
} // namespace DPP
|
||||
|
||||
// Philo definition ----------------------------------------------------------
|
||||
$define(AOs::Philo)</text>
|
||||
</file>
|
||||
<file name="table.cpp">
|
||||
<text>#include "qpcpp.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
// Active object class -------------------------------------------------------
|
||||
$declare(AOs::Table)
|
||||
|
||||
namespace DPP {
|
||||
|
||||
// helper function to provide the RIGHT neighbour of a Philo[n]
|
||||
inline uint8_t RIGHT(uint8_t const n) {
|
||||
return static_cast<uint8_t>((n + (N_PHILO - 1U)) % N_PHILO);
|
||||
}
|
||||
|
||||
// helper function to provide the LEFT neighbour of a Philo[n]
|
||||
inline uint8_t LEFT(uint8_t const n) {
|
||||
return static_cast<uint8_t>((n + 1U) % N_PHILO);
|
||||
}
|
||||
|
||||
static uint8_t const FREE = static_cast<uint8_t>(0);
|
||||
static uint8_t const USED = static_cast<uint8_t>(1);
|
||||
|
||||
static char_t const * const THINKING = &"thinking"[0];
|
||||
static char_t const * const HUNGRY = &"hungry "[0];
|
||||
static char_t const * const EATING = &"eating "[0];
|
||||
|
||||
// Local objects -------------------------------------------------------------
|
||||
static Table l_table; // the single instance of the Table active object
|
||||
|
||||
// Global-scope objects ------------------------------------------------------
|
||||
QP::QMActive * const AO_Table = &l_table; // "opaque" AO pointer
|
||||
|
||||
} // namespace DPP
|
||||
|
||||
//............................................................................
|
||||
$define(AOs::Table)</text>
|
||||
</file>
|
||||
</directory>
|
||||
</model>
|
539
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/iar/dpp.cfg
Normal file
539
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/iar/dpp.cfg
Normal file
@ -0,0 +1,539 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2016, Texas Instruments Incorporated
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ================ Clock configuration ================ */
|
||||
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
|
||||
/*
|
||||
* Default value is family dependent. For example, Linux systems often only
|
||||
* support a minimum period of 10000 us and multiples of 10000 us.
|
||||
* TI platforms have a default of 1000 us.
|
||||
*/
|
||||
Clock.tickPeriod = 1000;
|
||||
|
||||
|
||||
|
||||
/* ================ Defaults (module) configuration ================ */
|
||||
var Defaults = xdc.useModule('xdc.runtime.Defaults');
|
||||
/*
|
||||
* A flag to allow module names to be loaded on the target. Module name
|
||||
* strings are placed in the .const section for debugging purposes.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Setting this parameter to true will include name strings in the .const
|
||||
* section so that Errors and Asserts are easier to debug.
|
||||
* - false
|
||||
* Setting this parameter to false will reduce footprint in the .const
|
||||
* section. As a result, Error and Assert messages will contain an
|
||||
* "unknown module" prefix instead of the actual module name.
|
||||
*/
|
||||
Defaults.common$.namedModule = true;
|
||||
//Defaults.common$.namedModule = false;
|
||||
|
||||
|
||||
|
||||
/* ================ Error configuration ================ */
|
||||
var Error = xdc.useModule('xdc.runtime.Error');
|
||||
/*
|
||||
* This function is called to handle all raised errors, but unlike
|
||||
* Error.raiseHook, this function is responsible for completely handling the
|
||||
* error with an appropriately initialized Error_Block.
|
||||
*
|
||||
* Pick one:
|
||||
* - Error.policyDefault (default)
|
||||
* Calls Error.raiseHook with an initialized Error_Block structure and logs
|
||||
* the error using the module's logger.
|
||||
* - Error.policySpin
|
||||
* Simple alternative that traps on a while(1) loop for minimized target
|
||||
* footprint.
|
||||
* Using Error.policySpin, the Error.raiseHook will NOT called.
|
||||
*/
|
||||
Error.policyFxn = Error.policyDefault;
|
||||
//Error.policyFxn = Error.policySpin;
|
||||
|
||||
/*
|
||||
* If Error.policyFxn is set to Error.policyDefault, this function is called
|
||||
* whenever an error is raised by the Error module.
|
||||
*
|
||||
* Pick one:
|
||||
* - Error.print (default)
|
||||
* Errors are formatted and output via System_printf() for easier
|
||||
* debugging.
|
||||
* - null
|
||||
* Errors are not formatted or logged. This option reduces code footprint.
|
||||
* - non-null function
|
||||
* Errors invoke custom user function. See the Error module documentation
|
||||
* for more details.
|
||||
*/
|
||||
Error.raiseHook = Error.print;
|
||||
//Error.raiseHook = null;
|
||||
//Error.raiseHook = "&myErrorFxn";
|
||||
|
||||
/*
|
||||
* If Error.policyFxn is set to Error.policyDefault, this option applies to the
|
||||
* maximum number of times the Error.raiseHook function can be recursively
|
||||
* invoked. This option limits the possibility of an infinite recursion that
|
||||
* could lead to a stack overflow.
|
||||
* The default value is 16.
|
||||
*/
|
||||
Error.maxDepth = 2;
|
||||
|
||||
|
||||
|
||||
/* ================ Hwi configuration ================ */
|
||||
var halHwi = xdc.useModule('ti.sysbios.hal.Hwi');
|
||||
var m3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
|
||||
/*
|
||||
* Checks for Hwi (system) stack overruns while in the Idle loop.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Checks the top word for system stack overflows during the idle loop and
|
||||
* raises an Error if one is detected.
|
||||
* - false
|
||||
* Disabling the runtime check improves runtime performance and yields a
|
||||
* reduced flash footprint.
|
||||
*/
|
||||
halHwi.checkStackFlag = true;
|
||||
//halHwi.checkStackFlag = false;
|
||||
|
||||
/*
|
||||
* The following options alter the system's behavior when a hardware exception
|
||||
* is detected.
|
||||
*
|
||||
* Pick one:
|
||||
* - Hwi.enableException = true
|
||||
* This option causes the default m3Hwi.excHandlerFunc function to fully
|
||||
* decode an exception and dump the registers to the system console.
|
||||
* This option raises errors in the Error module and displays the
|
||||
* exception in ROV.
|
||||
* - Hwi.enableException = false
|
||||
* This option reduces code footprint by not decoding or printing the
|
||||
* exception to the system console.
|
||||
* It however still raises errors in the Error module and displays the
|
||||
* exception in ROV.
|
||||
* - Hwi.excHandlerFunc = null
|
||||
* This is the most aggressive option for code footprint savings; but it
|
||||
* can difficult to debug exceptions. It reduces flash footprint by
|
||||
* plugging in a default while(1) trap when exception occur. This option
|
||||
* does not raise an error with the Error module.
|
||||
*/
|
||||
m3Hwi.enableException = true;
|
||||
//m3Hwi.enableException = false;
|
||||
//m3Hwi.excHandlerFunc = null;
|
||||
|
||||
/*
|
||||
* Enable hardware exception generation when dividing by zero.
|
||||
*
|
||||
* Pick one:
|
||||
* - 0 (default)
|
||||
* Disables hardware exceptions when dividing by zero
|
||||
* - 1
|
||||
* Enables hardware exceptions when dividing by zero
|
||||
*/
|
||||
m3Hwi.nvicCCR.DIV_0_TRP = 0;
|
||||
//m3Hwi.nvicCCR.DIV_0_TRP = 1;
|
||||
|
||||
/*
|
||||
* Enable hardware exception generation for invalid data alignment.
|
||||
*
|
||||
* Pick one:
|
||||
* - 0 (default)
|
||||
* Disables hardware exceptions for data alignment
|
||||
* - 1
|
||||
* Enables hardware exceptions for data alignment
|
||||
*/
|
||||
m3Hwi.nvicCCR.UNALIGN_TRP = 0;
|
||||
//m3Hwi.nvicCCR.UNALIGN_TRP = 1;
|
||||
|
||||
|
||||
|
||||
/* ================ Idle configuration ================ */
|
||||
var Idle = xdc.useModule('ti.sysbios.knl.Idle');
|
||||
/*
|
||||
* The Idle module is used to specify a list of functions to be called when no
|
||||
* other tasks are running in the system.
|
||||
*
|
||||
* Functions added here will be run continuously within the idle task.
|
||||
*
|
||||
* Function signature:
|
||||
* Void func(Void);
|
||||
*/
|
||||
Idle.addFunc("&myIdleFunc");
|
||||
|
||||
|
||||
|
||||
/* ================ Kernel (SYS/BIOS) configuration ================ */
|
||||
var BIOS = xdc.useModule('ti.sysbios.BIOS');
|
||||
/*
|
||||
* Enable asserts in the BIOS library.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Enables asserts for debugging purposes.
|
||||
* - false
|
||||
* Disables asserts for a reduced code footprint and better performance.
|
||||
*/
|
||||
//BIOS.assertsEnabled = true;
|
||||
BIOS.assertsEnabled = false;
|
||||
|
||||
/*
|
||||
* Specify default heap size for BIOS.
|
||||
*/
|
||||
BIOS.heapSize = 1024;
|
||||
|
||||
/*
|
||||
* A flag to determine if xdc.runtime sources are to be included in a custom
|
||||
* built BIOS library.
|
||||
*
|
||||
* Pick one:
|
||||
* - false (default)
|
||||
* The pre-built xdc.runtime library is provided by the respective target
|
||||
* used to build the application.
|
||||
* - true
|
||||
* xdc.runtime library sources are to be included in the custom BIOS
|
||||
* library. This option yields the most efficient library in both code
|
||||
* footprint and runtime performance.
|
||||
*/
|
||||
BIOS.includeXdcRuntime = false;
|
||||
//BIOS.includeXdcRuntime = true;
|
||||
|
||||
/*
|
||||
* The SYS/BIOS runtime is provided in the form of a library that is linked
|
||||
* with the application. Several forms of this library are provided with the
|
||||
* SYS/BIOS product.
|
||||
*
|
||||
* Pick one:
|
||||
* - BIOS.LibType_Custom
|
||||
* Custom built library that is highly optimized for code footprint and
|
||||
* runtime performance.
|
||||
* - BIOS.LibType_Debug
|
||||
* Custom built library that is non-optimized that can be used to
|
||||
* single-step through APIs with a debugger.
|
||||
*
|
||||
*/
|
||||
BIOS.libType = BIOS.LibType_Custom;
|
||||
//BIOS.libType = BIOS.LibType_Debug;
|
||||
|
||||
/*
|
||||
* Runtime instance creation enable flag.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Allows Mod_create() and Mod_delete() to be called at runtime which
|
||||
* requires a default heap for dynamic memory allocation.
|
||||
* - false
|
||||
* Reduces code footprint by disallowing Mod_create() and Mod_delete() to
|
||||
* be called at runtime. Object instances are constructed via
|
||||
* Mod_construct() and destructed via Mod_destruct().
|
||||
*/
|
||||
BIOS.runtimeCreatesEnabled = true;
|
||||
//BIOS.runtimeCreatesEnabled = false;
|
||||
|
||||
/*
|
||||
* Enable logs in the BIOS library.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Enables logs for debugging purposes.
|
||||
* - false
|
||||
* Disables logging for reduced code footprint and improved runtime
|
||||
* performance.
|
||||
*/
|
||||
//BIOS.logsEnabled = true;
|
||||
BIOS.logsEnabled = false;
|
||||
|
||||
|
||||
|
||||
/* ================ Memory configuration ================ */
|
||||
var Memory = xdc.useModule('xdc.runtime.Memory');
|
||||
/*
|
||||
* The Memory module itself simply provides a common interface for any
|
||||
* variety of system and application specific memory management policies
|
||||
* implemented by the IHeap modules(Ex. HeapMem, HeapBuf).
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ================ Program configuration ================ */
|
||||
/*
|
||||
* Program.stack is ignored with IAR. Use the project options in
|
||||
* IAR Embedded Workbench to alter the system stack size.
|
||||
*/
|
||||
if (!Program.build.target.$name.match(/iar/)) {
|
||||
/*
|
||||
* Reducing the system stack size (used by ISRs and Swis) to reduce
|
||||
* RAM usage.
|
||||
*/
|
||||
Program.stack = 768;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Enable Semihosting for GNU targets to print to CCS console
|
||||
*/
|
||||
if (Program.build.target.$name.match(/gnu/)) {
|
||||
var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
|
||||
}
|
||||
/* ================ Semaphore configuration ================ */
|
||||
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
|
||||
/*
|
||||
* Enables global support for Task priority pend queuing.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* This allows pending tasks to be serviced based on their task priority.
|
||||
* - false
|
||||
* Pending tasks are services based on first in, first out basis.
|
||||
*
|
||||
* When using BIOS in ROM:
|
||||
* This option must be set to false.
|
||||
*/
|
||||
//Semaphore.supportsPriority = true;
|
||||
Semaphore.supportsPriority = false;
|
||||
|
||||
/*
|
||||
* Allows for the implicit posting of events through the semaphore,
|
||||
* disable for additional code saving.
|
||||
*
|
||||
* Pick one:
|
||||
* - true
|
||||
* This allows the Semaphore module to post semaphores and events
|
||||
* simultaneously.
|
||||
* - false (default)
|
||||
* Events must be explicitly posted to unblock tasks.
|
||||
*
|
||||
*/
|
||||
//Semaphore.supportsEvents = true;
|
||||
Semaphore.supportsEvents = false;
|
||||
|
||||
|
||||
|
||||
/* ================ Swi configuration ================ */
|
||||
var Swi = xdc.useModule('ti.sysbios.knl.Swi');
|
||||
/*
|
||||
* A software interrupt is an object that encapsulates a function to be
|
||||
* executed and a priority. Software interrupts are prioritized, preempt tasks
|
||||
* and are preempted by hardware interrupt service routines.
|
||||
*
|
||||
* This module is included to allow Swi's in a users' application.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ================ System configuration ================ */
|
||||
var System = xdc.useModule('xdc.runtime.System');
|
||||
/*
|
||||
* The Abort handler is called when the system exits abnormally.
|
||||
*
|
||||
* Pick one:
|
||||
* - System.abortStd (default)
|
||||
* Call the ANSI C Standard 'abort()' to terminate the application.
|
||||
* - System.abortSpin
|
||||
* A lightweight abort function that loops indefinitely in a while(1) trap
|
||||
* function.
|
||||
* - A custom abort handler
|
||||
* A user-defined function. See the System module documentation for
|
||||
* details.
|
||||
*/
|
||||
System.abortFxn = System.abortStd;
|
||||
//System.abortFxn = System.abortSpin;
|
||||
//System.abortFxn = "&myAbortSystem";
|
||||
|
||||
/*
|
||||
* The Exit handler is called when the system exits normally.
|
||||
*
|
||||
* Pick one:
|
||||
* - System.exitStd (default)
|
||||
* Call the ANSI C Standard 'exit()' to terminate the application.
|
||||
* - System.exitSpin
|
||||
* A lightweight exit function that loops indefinitely in a while(1) trap
|
||||
* function.
|
||||
* - A custom exit function
|
||||
* A user-defined function. See the System module documentation for
|
||||
* details.
|
||||
*/
|
||||
System.exitFxn = System.exitStd;
|
||||
//System.exitFxn = System.exitSpin;
|
||||
//System.exitFxn = "&myExitSystem";
|
||||
|
||||
/*
|
||||
* Minimize exit handler array in the System module. The System module includes
|
||||
* an array of functions that are registered with System_atexit() which is
|
||||
* called by System_exit(). The default value is 8.
|
||||
*/
|
||||
System.maxAtexitHandlers = 2;
|
||||
|
||||
/*
|
||||
* The System.SupportProxy defines a low-level implementation of System
|
||||
* functions such as System_printf(), System_flush(), etc.
|
||||
*
|
||||
* Pick one pair:
|
||||
* - SysMin
|
||||
* This module maintains an internal configurable circular buffer that
|
||||
* stores the output until System_flush() is called.
|
||||
* The size of the circular buffer is set via SysMin.bufSize.
|
||||
* - SysCallback
|
||||
* SysCallback allows for user-defined implementations for System APIs.
|
||||
* The SysCallback support proxy has a smaller code footprint and can be
|
||||
* used to supply custom System_printf services.
|
||||
* The default SysCallback functions point to stub functions. See the
|
||||
* SysCallback module's documentation.
|
||||
*/
|
||||
var SysMin = xdc.useModule('xdc.runtime.SysMin');
|
||||
SysMin.bufSize = 512;
|
||||
System.SupportProxy = SysMin;
|
||||
//var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
|
||||
//System.SupportProxy = SysCallback;
|
||||
//SysCallback.abortFxn = "&myUserAbort";
|
||||
//SysCallback.exitFxn = "&myUserExit";
|
||||
//SysCallback.flushFxn = "&myUserFlush";
|
||||
//SysCallback.putchFxn = "&myUserPutch";
|
||||
//SysCallback.readyFxn = "&myUserReady";
|
||||
|
||||
|
||||
|
||||
|
||||
/* ================ Task configuration ================ */
|
||||
var Task = xdc.useModule('ti.sysbios.knl.Task');
|
||||
/*
|
||||
* Check task stacks for overflow conditions.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Enables runtime checks for task stack overflow conditions during
|
||||
* context switching ("from" and "to")
|
||||
* - false
|
||||
* Disables runtime checks for task stack overflow conditions.
|
||||
*/
|
||||
Task.checkStackFlag = true;
|
||||
//Task.checkStackFlag = false;
|
||||
|
||||
/*
|
||||
* Set the default task stack size when creating tasks.
|
||||
*
|
||||
* The default is dependent on the device being used. Reducing the default stack
|
||||
* size yields greater memory savings.
|
||||
*/
|
||||
Task.defaultStackSize = 512;
|
||||
|
||||
/*
|
||||
* Enables the idle task.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* Creates a task with priority of 0 which calls idle hook functions. This
|
||||
* option must be set to true to gain power savings provided by the Power
|
||||
* module.
|
||||
* - false
|
||||
* No idle task is created. This option consumes less memory as no
|
||||
* additional default task stack is needed.
|
||||
* To gain power savings by the Power module without having the idle task,
|
||||
* add Idle.run as the Task.allBlockedFunc.
|
||||
*/
|
||||
//Task.enableIdleTask = true;
|
||||
//Task.enableIdleTask = false;
|
||||
Task.allBlockedFunc = Idle.run;
|
||||
|
||||
/*
|
||||
* If Task.enableIdleTask is set to true, this option sets the idle task's
|
||||
* stack size.
|
||||
*
|
||||
* Reducing the idle stack size yields greater memory savings.
|
||||
*/
|
||||
Task.idleTaskStackSize = 512;
|
||||
|
||||
/*
|
||||
* Reduce the number of task priorities.
|
||||
* The default is 16.
|
||||
* Decreasing the number of task priorities yield memory savings.
|
||||
*/
|
||||
Task.numPriorities = 16;
|
||||
|
||||
|
||||
|
||||
/* ================ Text configuration ================ */
|
||||
var Text = xdc.useModule('xdc.runtime.Text');
|
||||
/*
|
||||
* These strings are placed in the .const section. Setting this parameter to
|
||||
* false will save space in the .const section. Error, Assert and Log messages
|
||||
* will print raw ids and args instead of a formatted message.
|
||||
*
|
||||
* Pick one:
|
||||
* - true (default)
|
||||
* This option loads test string into the .const for easier debugging.
|
||||
* - false
|
||||
* This option reduces the .const footprint.
|
||||
*/
|
||||
Text.isLoaded = true;
|
||||
//Text.isLoaded = false;
|
||||
|
||||
|
||||
|
||||
/* ================ Types configuration ================ */
|
||||
var Types = xdc.useModule('xdc.runtime.Types');
|
||||
/*
|
||||
* This module defines basic constants and types used throughout the
|
||||
* xdc.runtime package.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ================ TI-RTOS middleware configuration ================ */
|
||||
var mwConfig = xdc.useModule('ti.mw.Config');
|
||||
/*
|
||||
* Include TI-RTOS middleware libraries
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ================ TI-RTOS drivers' configuration ================ */
|
||||
var driversConfig = xdc.useModule('ti.drivers.Config');
|
||||
/*
|
||||
* Include TI-RTOS drivers
|
||||
*
|
||||
* Pick one:
|
||||
* - driversConfig.LibType_NonInstrumented (default)
|
||||
* Use TI-RTOS drivers library optimized for footprint and performance
|
||||
* without asserts or logs.
|
||||
* - driversConfig.LibType_Instrumented
|
||||
* Use TI-RTOS drivers library for debugging with asserts and logs enabled.
|
||||
*/
|
||||
driversConfig.libType = driversConfig.LibType_NonInstrumented;
|
||||
//driversConfig.libType = driversConfig.LibType_Instrumented;
|
||||
|
||||
|
||||
|
||||
/* ================ Application Specific Instances ================ */
|
3269
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/iar/dpp.ewd
Normal file
3269
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/iar/dpp.ewd
Normal file
File diff suppressed because it is too large
Load Diff
2080
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/iar/dpp.ewp
Normal file
2080
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/iar/dpp.ewp
Normal file
File diff suppressed because it is too large
Load Diff
10
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/iar/dpp.eww
Normal file
10
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/iar/dpp.eww
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<workspace>
|
||||
<project>
|
||||
<path>$WS_DIR$\dpp.ewp</path>
|
||||
</project>
|
||||
<batchBuild/>
|
||||
</workspace>
|
||||
|
||||
|
@ -0,0 +1,29 @@
|
||||
/*###ICF### Section handled by ICF editor, don't touch! ****/
|
||||
/*-Editor annotation file-*/
|
||||
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
|
||||
/*-Specials-*/
|
||||
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
|
||||
/*-Memory Regions-*/
|
||||
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
|
||||
define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF;
|
||||
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
|
||||
define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF;
|
||||
/*-Sizes-*/
|
||||
define symbol __ICFEDIT_size_cstack__ = 0x800;
|
||||
define symbol __ICFEDIT_size_heap__ = 0x2000;
|
||||
/**** End of ICF editor section. ###ICF###*/
|
||||
|
||||
define memory mem with size = 4G;
|
||||
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
|
||||
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
|
||||
|
||||
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
|
||||
initialize by copy { readwrite };
|
||||
do not initialize { section .noinit };
|
||||
|
||||
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
|
||||
place in ROM_region { readonly };
|
||||
place in RAM_region { readwrite,
|
||||
block CSTACK, block HEAP };
|
2
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/iar/notes.txt
Normal file
2
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/iar/notes.txt
Normal file
@ -0,0 +1,2 @@
|
||||
Software Interrupt video:
|
||||
http://focus.ti.com/download/trng/multimedia/dsp/OLT110026/swis.mp4
|
77
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/main.cpp
Normal file
77
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/main.cpp
Normal file
@ -0,0 +1,77 @@
|
||||
//****************************************************************************
|
||||
// DPP example
|
||||
// Last updated for version 5.6.2
|
||||
// Last updated on 2016-03-31
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
//
|
||||
// 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
|
||||
// by the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Alternatively, this program may be distributed and modified under the
|
||||
// terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
// the GNU General Public License and are specifically designed for
|
||||
// licensees interested in retaining the proprietary status of their code.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// Contact information:
|
||||
// http://www.state-machine.com
|
||||
// mailto:info@state-machine.com
|
||||
//****************************************************************************
|
||||
#include "qpcpp.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
//............................................................................
|
||||
int main() {
|
||||
static QP::QEvt const *tableQueueSto[N_PHILO];
|
||||
static QP::QEvt const *philoQueueSto[N_PHILO][N_PHILO];
|
||||
static QP::QSubscrList subscrSto[DPP::MAX_PUB_SIG];
|
||||
|
||||
static QF_MPOOL_EL(DPP::TableEvt) smlPoolSto[2*N_PHILO];
|
||||
|
||||
|
||||
QP::QF::init(); // initialize the framework and the underlying RT kernel
|
||||
|
||||
DPP::BSP::init(); // initialize the BSP
|
||||
|
||||
// object dictionaries...
|
||||
QS_OBJ_DICTIONARY(smlPoolSto);
|
||||
QS_OBJ_DICTIONARY(tableQueueSto);
|
||||
QS_OBJ_DICTIONARY(philoQueueSto[0]);
|
||||
QS_OBJ_DICTIONARY(philoQueueSto[1]);
|
||||
QS_OBJ_DICTIONARY(philoQueueSto[2]);
|
||||
QS_OBJ_DICTIONARY(philoQueueSto[3]);
|
||||
QS_OBJ_DICTIONARY(philoQueueSto[4]);
|
||||
|
||||
QP::QF::psInit(subscrSto, Q_DIM(subscrSto)); // init publish-subscribe
|
||||
|
||||
// initialize event pools...
|
||||
QP::QF::poolInit(smlPoolSto,
|
||||
sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
|
||||
|
||||
// start the active objects...
|
||||
for (uint8_t n = 0U; n < N_PHILO; ++n) {
|
||||
DPP::AO_Philo[n]->start((uint_fast8_t)(n + 1U),
|
||||
philoQueueSto[n], Q_DIM(philoQueueSto[n]),
|
||||
(void *)0, 0U);
|
||||
}
|
||||
DPP::AO_Table->start((uint_fast8_t)(N_PHILO + 1U),
|
||||
tableQueueSto, Q_DIM(tableQueueSto),
|
||||
(void *)0, 0U);
|
||||
|
||||
return QP::QF::run(); // run the QF application
|
||||
}
|
5
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/notes.txt
Normal file
5
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/notes.txt
Normal file
@ -0,0 +1,5 @@
|
||||
http://processors.wiki.ti.com/index.php/Creating_TI-RTOS_Applications_in_IAR_Embedded_Workbench
|
||||
|
||||
Software Interrupt video:
|
||||
http://focus.ti.com/download/trng/multimedia/dsp/OLT110026/swis.mp4
|
||||
|
310
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/philo.cpp
Normal file
310
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/philo.cpp
Normal file
@ -0,0 +1,310 @@
|
||||
//****************************************************************************
|
||||
// Model: dpp.qm
|
||||
// File: ./philo.cpp
|
||||
//
|
||||
// This code has been generated by QM tool (see state-machine.com/qm).
|
||||
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
||||
//
|
||||
// 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
|
||||
// by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
// for more details.
|
||||
//****************************************************************************
|
||||
//${.::philo.cpp} ............................................................
|
||||
#include "qpcpp.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
// Active object class -------------------------------------------------------
|
||||
namespace DPP {
|
||||
|
||||
//${AOs::Philo} ..............................................................
|
||||
class Philo : public QP::QMActive {
|
||||
private:
|
||||
QP::QTimeEvt m_timeEvt;
|
||||
|
||||
public:
|
||||
Philo();
|
||||
|
||||
protected:
|
||||
static QP::QState initial(Philo * const me, QP::QEvt const * const e);
|
||||
static QP::QState thinking (Philo * const me, QP::QEvt const * const e);
|
||||
static QP::QState thinking_e(Philo * const me);
|
||||
static QP::QState thinking_x(Philo * const me);
|
||||
static QP::QMState const thinking_s;
|
||||
static QP::QState hungry (Philo * const me, QP::QEvt const * const e);
|
||||
static QP::QState hungry_e(Philo * const me);
|
||||
static QP::QMState const hungry_s;
|
||||
static QP::QState eating (Philo * const me, QP::QEvt const * const e);
|
||||
static QP::QState eating_e(Philo * const me);
|
||||
static QP::QState eating_x(Philo * const me);
|
||||
static QP::QMState const eating_s;
|
||||
};
|
||||
|
||||
} // namespace DPP
|
||||
|
||||
namespace DPP {
|
||||
|
||||
// Local objects -------------------------------------------------------------
|
||||
static Philo l_philo[N_PHILO]; // storage for all Philos
|
||||
|
||||
// helper function to provide a randomized think time for Philos
|
||||
inline QP::QTimeEvtCtr think_time() {
|
||||
return static_cast<QP::QTimeEvtCtr>((BSP::random() % BSP::TICKS_PER_SEC)
|
||||
+ (BSP::TICKS_PER_SEC/2U));
|
||||
}
|
||||
|
||||
// helper function to provide a randomized eat time for Philos
|
||||
inline QP::QTimeEvtCtr eat_time() {
|
||||
return static_cast<QP::QTimeEvtCtr>((BSP::random() % BSP::TICKS_PER_SEC)
|
||||
+ BSP::TICKS_PER_SEC);
|
||||
}
|
||||
|
||||
// helper function to provide the ID of Philo "me"
|
||||
inline uint8_t PHILO_ID(Philo const * const me) {
|
||||
return static_cast<uint8_t>(me - l_philo);
|
||||
}
|
||||
|
||||
enum InternalSignals { // internal signals
|
||||
TIMEOUT_SIG = MAX_SIG
|
||||
};
|
||||
|
||||
// Global objects ------------------------------------------------------------
|
||||
QP::QMActive * const AO_Philo[N_PHILO] = { // "opaque" pointers to Philo AO
|
||||
&l_philo[0],
|
||||
&l_philo[1],
|
||||
&l_philo[2],
|
||||
&l_philo[3],
|
||||
&l_philo[4]
|
||||
};
|
||||
|
||||
} // namespace DPP
|
||||
|
||||
// Philo definition ----------------------------------------------------------
|
||||
namespace DPP {
|
||||
|
||||
//${AOs::Philo} ..............................................................
|
||||
//${AOs::Philo::Philo} .......................................................
|
||||
Philo::Philo()
|
||||
: QMActive(Q_STATE_CAST(&Philo::initial)),
|
||||
m_timeEvt(this, TIMEOUT_SIG, 0U)
|
||||
{}
|
||||
|
||||
//${AOs::Philo::SM} ..........................................................
|
||||
QP::QState Philo::initial(Philo * const me, QP::QEvt const * const e) {
|
||||
static struct {
|
||||
QP::QMState const *target;
|
||||
QP::QActionHandler act[2];
|
||||
} const tatbl_ = { // transition-action table
|
||||
&thinking_s,
|
||||
{
|
||||
Q_ACTION_CAST(&thinking_e), // entry
|
||||
Q_ACTION_CAST(0) // zero terminator
|
||||
}
|
||||
};
|
||||
// ${AOs::Philo::SM::initial}
|
||||
static bool registered = false; // starts off with 0, per C-standard
|
||||
(void)e; // suppress the compiler warning about unused parameter
|
||||
if (!registered) {
|
||||
registered = true;
|
||||
|
||||
QS_OBJ_DICTIONARY(&l_philo[0]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[0].m_timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[1]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[1].m_timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[2]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[2].m_timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[3]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[3].m_timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[4]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[4].m_timeEvt);
|
||||
|
||||
QS_FUN_DICTIONARY(&Philo::initial);
|
||||
QS_FUN_DICTIONARY(&Philo::thinking);
|
||||
QS_FUN_DICTIONARY(&Philo::hungry);
|
||||
QS_FUN_DICTIONARY(&Philo::eating);
|
||||
}
|
||||
QS_SIG_DICTIONARY(HUNGRY_SIG, me); // signal for each Philos
|
||||
QS_SIG_DICTIONARY(TIMEOUT_SIG, me); // signal for each Philos
|
||||
|
||||
me->subscribe(EAT_SIG);
|
||||
me->subscribe(TEST_SIG);
|
||||
return QM_TRAN_INIT(&tatbl_);
|
||||
}
|
||||
//${AOs::Philo::SM::thinking} ................................................
|
||||
QP::QMState const Philo::thinking_s = {
|
||||
static_cast<QP::QMState const *>(0), // superstate (top)
|
||||
Q_STATE_CAST(&thinking),
|
||||
Q_ACTION_CAST(&thinking_e),
|
||||
Q_ACTION_CAST(&thinking_x),
|
||||
Q_ACTION_CAST(0) // no intitial tran.
|
||||
};
|
||||
// ${AOs::Philo::SM::thinking}
|
||||
QP::QState Philo::thinking_e(Philo * const me) {
|
||||
me->m_timeEvt.armX(think_time(), 0U);
|
||||
return QM_ENTRY(&thinking_s);
|
||||
}
|
||||
// ${AOs::Philo::SM::thinking}
|
||||
QP::QState Philo::thinking_x(Philo * const me) {
|
||||
(void)me->m_timeEvt.disarm();
|
||||
return QM_EXIT(&thinking_s);
|
||||
}
|
||||
// ${AOs::Philo::SM::thinking}
|
||||
QP::QState Philo::thinking(Philo * const me, QP::QEvt const * const e) {
|
||||
QP::QState status_;
|
||||
switch (e->sig) {
|
||||
// ${AOs::Philo::SM::thinking::TIMEOUT}
|
||||
case TIMEOUT_SIG: {
|
||||
static struct {
|
||||
QP::QMState const *target;
|
||||
QP::QActionHandler act[3];
|
||||
} const tatbl_ = { // transition-action table
|
||||
&hungry_s,
|
||||
{
|
||||
Q_ACTION_CAST(&thinking_x), // exit
|
||||
Q_ACTION_CAST(&hungry_e), // entry
|
||||
Q_ACTION_CAST(0) // zero terminator
|
||||
}
|
||||
};
|
||||
status_ = QM_TRAN(&tatbl_);
|
||||
break;
|
||||
}
|
||||
// ${AOs::Philo::SM::thinking::EAT, DONE}
|
||||
case EAT_SIG: // intentionally fall through
|
||||
case DONE_SIG: {
|
||||
/* EAT or DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
|
||||
status_ = QM_HANDLED();
|
||||
break;
|
||||
}
|
||||
// ${AOs::Philo::SM::thinking::TEST}
|
||||
case TEST_SIG: {
|
||||
status_ = QM_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status_ = QM_SUPER();
|
||||
break;
|
||||
}
|
||||
}
|
||||
(void)me; // avoid compiler warning in case 'me' is not used
|
||||
return status_;
|
||||
}
|
||||
//${AOs::Philo::SM::hungry} ..................................................
|
||||
QP::QMState const Philo::hungry_s = {
|
||||
static_cast<QP::QMState const *>(0), // superstate (top)
|
||||
Q_STATE_CAST(&hungry),
|
||||
Q_ACTION_CAST(&hungry_e),
|
||||
Q_ACTION_CAST(0), // no exit action
|
||||
Q_ACTION_CAST(0) // no intitial tran.
|
||||
};
|
||||
// ${AOs::Philo::SM::hungry}
|
||||
QP::QState Philo::hungry_e(Philo * const me) {
|
||||
TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
|
||||
pe->philoNum = PHILO_ID(me);
|
||||
AO_Table->POST(pe, me);
|
||||
return QM_ENTRY(&hungry_s);
|
||||
}
|
||||
// ${AOs::Philo::SM::hungry}
|
||||
QP::QState Philo::hungry(Philo * const me, QP::QEvt const * const e) {
|
||||
QP::QState status_;
|
||||
switch (e->sig) {
|
||||
// ${AOs::Philo::SM::hungry::EAT}
|
||||
case EAT_SIG: {
|
||||
// ${AOs::Philo::SM::hungry::EAT::[Q_EVT_CAST(TableEvt)->philoNum=~}
|
||||
if (Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)) {
|
||||
static struct {
|
||||
QP::QMState const *target;
|
||||
QP::QActionHandler act[2];
|
||||
} const tatbl_ = { // transition-action table
|
||||
&eating_s,
|
||||
{
|
||||
Q_ACTION_CAST(&eating_e), // entry
|
||||
Q_ACTION_CAST(0) // zero terminator
|
||||
}
|
||||
};
|
||||
status_ = QM_TRAN(&tatbl_);
|
||||
}
|
||||
else {
|
||||
status_ = QM_UNHANDLED();
|
||||
}
|
||||
break;
|
||||
}
|
||||
// ${AOs::Philo::SM::hungry::DONE}
|
||||
case DONE_SIG: {
|
||||
/* DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
|
||||
status_ = QM_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status_ = QM_SUPER();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status_;
|
||||
}
|
||||
//${AOs::Philo::SM::eating} ..................................................
|
||||
QP::QMState const Philo::eating_s = {
|
||||
static_cast<QP::QMState const *>(0), // superstate (top)
|
||||
Q_STATE_CAST(&eating),
|
||||
Q_ACTION_CAST(&eating_e),
|
||||
Q_ACTION_CAST(&eating_x),
|
||||
Q_ACTION_CAST(0) // no intitial tran.
|
||||
};
|
||||
// ${AOs::Philo::SM::eating}
|
||||
QP::QState Philo::eating_e(Philo * const me) {
|
||||
me->m_timeEvt.armX(eat_time(), 0U);
|
||||
return QM_ENTRY(&eating_s);
|
||||
}
|
||||
// ${AOs::Philo::SM::eating}
|
||||
QP::QState Philo::eating_x(Philo * const me) {
|
||||
TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
|
||||
pe->philoNum = PHILO_ID(me);
|
||||
QP::QF::PUBLISH(pe, me);
|
||||
(void)me->m_timeEvt.disarm();
|
||||
return QM_EXIT(&eating_s);
|
||||
}
|
||||
// ${AOs::Philo::SM::eating}
|
||||
QP::QState Philo::eating(Philo * const me, QP::QEvt const * const e) {
|
||||
QP::QState status_;
|
||||
switch (e->sig) {
|
||||
// ${AOs::Philo::SM::eating::TIMEOUT}
|
||||
case TIMEOUT_SIG: {
|
||||
static struct {
|
||||
QP::QMState const *target;
|
||||
QP::QActionHandler act[3];
|
||||
} const tatbl_ = { // transition-action table
|
||||
&thinking_s,
|
||||
{
|
||||
Q_ACTION_CAST(&eating_x), // exit
|
||||
Q_ACTION_CAST(&thinking_e), // entry
|
||||
Q_ACTION_CAST(0) // zero terminator
|
||||
}
|
||||
};
|
||||
status_ = QM_TRAN(&tatbl_);
|
||||
break;
|
||||
}
|
||||
// ${AOs::Philo::SM::eating::EAT, DONE}
|
||||
case EAT_SIG: // intentionally fall through
|
||||
case DONE_SIG: {
|
||||
/* EAT or DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
|
||||
status_ = QM_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status_ = QM_SUPER();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status_;
|
||||
}
|
||||
|
||||
} // namespace DPP
|
360
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/table.cpp
Normal file
360
examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl/table.cpp
Normal file
@ -0,0 +1,360 @@
|
||||
//****************************************************************************
|
||||
// Model: dpp.qm
|
||||
// File: ./table.cpp
|
||||
//
|
||||
// This code has been generated by QM tool (see state-machine.com/qm).
|
||||
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
||||
//
|
||||
// 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
|
||||
// by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
// for more details.
|
||||
//****************************************************************************
|
||||
//${.::table.cpp} ............................................................
|
||||
#include "qpcpp.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
// Active object class -------------------------------------------------------
|
||||
namespace DPP {
|
||||
|
||||
//${AOs::Table} ..............................................................
|
||||
class Table : public QP::QMActive {
|
||||
private:
|
||||
uint8_t m_fork[N_PHILO];
|
||||
bool m_isHungry[N_PHILO];
|
||||
|
||||
public:
|
||||
Table();
|
||||
|
||||
protected:
|
||||
static QP::QState initial(Table * const me, QP::QEvt const * const e);
|
||||
static QP::QState active (Table * const me, QP::QEvt const * const e);
|
||||
static QP::QMState const active_s;
|
||||
static QP::QState serving (Table * const me, QP::QEvt const * const e);
|
||||
static QP::QState serving_e(Table * const me);
|
||||
static QP::QMState const serving_s;
|
||||
static QP::QState paused (Table * const me, QP::QEvt const * const e);
|
||||
static QP::QState paused_e(Table * const me);
|
||||
static QP::QState paused_x(Table * const me);
|
||||
static QP::QMState const paused_s;
|
||||
};
|
||||
|
||||
} // namespace DPP
|
||||
|
||||
namespace DPP {
|
||||
|
||||
// helper function to provide the RIGHT neighbour of a Philo[n]
|
||||
inline uint8_t RIGHT(uint8_t const n) {
|
||||
return static_cast<uint8_t>((n + (N_PHILO - 1U)) % N_PHILO);
|
||||
}
|
||||
|
||||
// helper function to provide the LEFT neighbour of a Philo[n]
|
||||
inline uint8_t LEFT(uint8_t const n) {
|
||||
return static_cast<uint8_t>((n + 1U) % N_PHILO);
|
||||
}
|
||||
|
||||
static uint8_t const FREE = static_cast<uint8_t>(0);
|
||||
static uint8_t const USED = static_cast<uint8_t>(1);
|
||||
|
||||
static char_t const * const THINKING = &"thinking"[0];
|
||||
static char_t const * const HUNGRY = &"hungry "[0];
|
||||
static char_t const * const EATING = &"eating "[0];
|
||||
|
||||
// Local objects -------------------------------------------------------------
|
||||
static Table l_table; // the single instance of the Table active object
|
||||
|
||||
// Global-scope objects ------------------------------------------------------
|
||||
QP::QMActive * const AO_Table = &l_table; // "opaque" AO pointer
|
||||
|
||||
} // namespace DPP
|
||||
|
||||
//............................................................................
|
||||
namespace DPP {
|
||||
|
||||
//${AOs::Table} ..............................................................
|
||||
//${AOs::Table::Table} .......................................................
|
||||
Table::Table()
|
||||
: QMActive(Q_STATE_CAST(&Table::initial))
|
||||
{
|
||||
for (uint8_t n = 0U; n < N_PHILO; ++n) {
|
||||
m_fork[n] = FREE;
|
||||
m_isHungry[n] = false;
|
||||
}
|
||||
}
|
||||
|
||||
//${AOs::Table::SM} ..........................................................
|
||||
QP::QState Table::initial(Table * const me, QP::QEvt const * const e) {
|
||||
static struct {
|
||||
QP::QMState const *target;
|
||||
QP::QActionHandler act[2];
|
||||
} const tatbl_ = { // transition-action table
|
||||
&serving_s,
|
||||
{
|
||||
Q_ACTION_CAST(&serving_e), // entry
|
||||
Q_ACTION_CAST(0) // zero terminator
|
||||
}
|
||||
};
|
||||
// ${AOs::Table::SM::initial}
|
||||
(void)e; // suppress the compiler warning about unused parameter
|
||||
|
||||
QS_OBJ_DICTIONARY(&l_table);
|
||||
QS_FUN_DICTIONARY(&QP::QHsm::top);
|
||||
QS_FUN_DICTIONARY(&Table::initial);
|
||||
QS_FUN_DICTIONARY(&Table::active);
|
||||
QS_FUN_DICTIONARY(&Table::serving);
|
||||
QS_FUN_DICTIONARY(&Table::paused);
|
||||
|
||||
QS_SIG_DICTIONARY(DONE_SIG, (void *)0); // global signals
|
||||
QS_SIG_DICTIONARY(EAT_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(PAUSE_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(SERVE_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(TEST_SIG, (void *)0);
|
||||
|
||||
QS_SIG_DICTIONARY(HUNGRY_SIG, me); // signal just for Table
|
||||
|
||||
me->subscribe(DONE_SIG);
|
||||
me->subscribe(PAUSE_SIG);
|
||||
me->subscribe(SERVE_SIG);
|
||||
me->subscribe(TEST_SIG);
|
||||
|
||||
for (uint8_t n = 0U; n < N_PHILO; ++n) {
|
||||
me->m_fork[n] = FREE;
|
||||
me->m_isHungry[n] = false;
|
||||
BSP::displayPhilStat(n, THINKING);
|
||||
}
|
||||
return QM_TRAN_INIT(&tatbl_);
|
||||
}
|
||||
//${AOs::Table::SM::active} ..................................................
|
||||
QP::QMState const Table::active_s = {
|
||||
static_cast<QP::QMState const *>(0), // superstate (top)
|
||||
Q_STATE_CAST(&active),
|
||||
Q_ACTION_CAST(0), // no entry action
|
||||
Q_ACTION_CAST(0), // no exit action
|
||||
Q_ACTION_CAST(0) // no intitial tran.
|
||||
};
|
||||
// ${AOs::Table::SM::active}
|
||||
QP::QState Table::active(Table * const me, QP::QEvt const * const e) {
|
||||
QP::QState status_;
|
||||
switch (e->sig) {
|
||||
// ${AOs::Table::SM::active::TEST}
|
||||
case TEST_SIG: {
|
||||
status_ = QM_HANDLED();
|
||||
break;
|
||||
}
|
||||
// ${AOs::Table::SM::active::EAT}
|
||||
case EAT_SIG: {
|
||||
Q_ERROR();
|
||||
status_ = QM_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status_ = QM_SUPER();
|
||||
break;
|
||||
}
|
||||
}
|
||||
(void)me; // avoid compiler warning in case 'me' is not used
|
||||
return status_;
|
||||
}
|
||||
//${AOs::Table::SM::active::serving} .........................................
|
||||
QP::QMState const Table::serving_s = {
|
||||
&Table::active_s, // superstate
|
||||
Q_STATE_CAST(&serving),
|
||||
Q_ACTION_CAST(&serving_e),
|
||||
Q_ACTION_CAST(0), // no exit action
|
||||
Q_ACTION_CAST(0) // no intitial tran.
|
||||
};
|
||||
// ${AOs::Table::SM::active::serving}
|
||||
QP::QState Table::serving_e(Table * const me) {
|
||||
for (uint8_t n = 0U; n < N_PHILO; ++n) { // give permissions to eat...
|
||||
if (me->m_isHungry[n]
|
||||
&& (me->m_fork[LEFT(n)] == FREE)
|
||||
&& (me->m_fork[n] == FREE))
|
||||
{
|
||||
me->m_fork[LEFT(n)] = USED;
|
||||
me->m_fork[n] = USED;
|
||||
TableEvt *te = Q_NEW(TableEvt, EAT_SIG);
|
||||
te->philoNum = n;
|
||||
QP::QF::PUBLISH(te, me);
|
||||
me->m_isHungry[n] = false;
|
||||
BSP::displayPhilStat(n, EATING);
|
||||
}
|
||||
}
|
||||
return QM_ENTRY(&serving_s);
|
||||
}
|
||||
// ${AOs::Table::SM::active::serving}
|
||||
QP::QState Table::serving(Table * const me, QP::QEvt const * const e) {
|
||||
QP::QState status_;
|
||||
switch (e->sig) {
|
||||
// ${AOs::Table::SM::active::serving::HUNGRY}
|
||||
case HUNGRY_SIG: {
|
||||
uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
// phil ID must be in range and he must be not hungry
|
||||
Q_ASSERT((n < N_PHILO) && (!me->m_isHungry[n]));
|
||||
|
||||
BSP::displayPhilStat(n, HUNGRY);
|
||||
uint8_t m = LEFT(n);
|
||||
// ${AOs::Table::SM::active::serving::HUNGRY::[bothfree]}
|
||||
if ((me->m_fork[m] == FREE) && (me->m_fork[n] == FREE)) {
|
||||
me->m_fork[m] = USED;
|
||||
me->m_fork[n] = USED;
|
||||
TableEvt *pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = n;
|
||||
QP::QF::PUBLISH(pe, me);
|
||||
BSP::displayPhilStat(n, EATING);
|
||||
status_ = QM_HANDLED();
|
||||
}
|
||||
// ${AOs::Table::SM::active::serving::HUNGRY::[else]}
|
||||
else {
|
||||
me->m_isHungry[n] = true;
|
||||
status_ = QM_HANDLED();
|
||||
}
|
||||
break;
|
||||
}
|
||||
// ${AOs::Table::SM::active::serving::DONE}
|
||||
case DONE_SIG: {
|
||||
uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
// phil ID must be in range and he must be not hungry
|
||||
Q_ASSERT((n < N_PHILO) && (!me->m_isHungry[n]));
|
||||
|
||||
BSP::displayPhilStat(n, THINKING);
|
||||
uint8_t m = LEFT(n);
|
||||
// both forks of Phil[n] must be used
|
||||
Q_ASSERT((me->m_fork[n] == USED) && (me->m_fork[m] == USED));
|
||||
|
||||
me->m_fork[m] = FREE;
|
||||
me->m_fork[n] = FREE;
|
||||
m = RIGHT(n); // check the right neighbor
|
||||
|
||||
if (me->m_isHungry[m] && (me->m_fork[m] == FREE)) {
|
||||
me->m_fork[n] = USED;
|
||||
me->m_fork[m] = USED;
|
||||
me->m_isHungry[m] = false;
|
||||
TableEvt *pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = m;
|
||||
QP::QF::PUBLISH(pe, me);
|
||||
BSP::displayPhilStat(m, EATING);
|
||||
}
|
||||
m = LEFT(n); // check the left neighbor
|
||||
n = LEFT(m); // left fork of the left neighbor
|
||||
if (me->m_isHungry[m] && (me->m_fork[n] == FREE)) {
|
||||
me->m_fork[m] = USED;
|
||||
me->m_fork[n] = USED;
|
||||
me->m_isHungry[m] = false;
|
||||
TableEvt *pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = m;
|
||||
QP::QF::PUBLISH(pe, me);
|
||||
BSP::displayPhilStat(m, EATING);
|
||||
}
|
||||
status_ = QM_HANDLED();
|
||||
break;
|
||||
}
|
||||
// ${AOs::Table::SM::active::serving::EAT}
|
||||
case EAT_SIG: {
|
||||
Q_ERROR();
|
||||
status_ = QM_HANDLED();
|
||||
break;
|
||||
}
|
||||
// ${AOs::Table::SM::active::serving::PAUSE}
|
||||
case PAUSE_SIG: {
|
||||
static struct {
|
||||
QP::QMState const *target;
|
||||
QP::QActionHandler act[2];
|
||||
} const tatbl_ = { // transition-action table
|
||||
&paused_s,
|
||||
{
|
||||
Q_ACTION_CAST(&paused_e), // entry
|
||||
Q_ACTION_CAST(0) // zero terminator
|
||||
}
|
||||
};
|
||||
status_ = QM_TRAN(&tatbl_);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status_ = QM_SUPER();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status_;
|
||||
}
|
||||
//${AOs::Table::SM::active::paused} ..........................................
|
||||
QP::QMState const Table::paused_s = {
|
||||
&Table::active_s, // superstate
|
||||
Q_STATE_CAST(&paused),
|
||||
Q_ACTION_CAST(&paused_e),
|
||||
Q_ACTION_CAST(&paused_x),
|
||||
Q_ACTION_CAST(0) // no intitial tran.
|
||||
};
|
||||
// ${AOs::Table::SM::active::paused}
|
||||
QP::QState Table::paused_e(Table * const me) {
|
||||
BSP::displayPaused(1U);
|
||||
(void)me; // avoid compiler warning in case 'me' is not used
|
||||
return QM_ENTRY(&paused_s);
|
||||
}
|
||||
// ${AOs::Table::SM::active::paused}
|
||||
QP::QState Table::paused_x(Table * const me) {
|
||||
BSP::displayPaused(0U);
|
||||
(void)me; // avoid compiler warning in case 'me' is not used
|
||||
return QM_EXIT(&paused_s);
|
||||
}
|
||||
// ${AOs::Table::SM::active::paused}
|
||||
QP::QState Table::paused(Table * const me, QP::QEvt const * const e) {
|
||||
QP::QState status_;
|
||||
switch (e->sig) {
|
||||
// ${AOs::Table::SM::active::paused::SERVE}
|
||||
case SERVE_SIG: {
|
||||
static struct {
|
||||
QP::QMState const *target;
|
||||
QP::QActionHandler act[3];
|
||||
} const tatbl_ = { // transition-action table
|
||||
&serving_s,
|
||||
{
|
||||
Q_ACTION_CAST(&paused_x), // exit
|
||||
Q_ACTION_CAST(&serving_e), // entry
|
||||
Q_ACTION_CAST(0) // zero terminator
|
||||
}
|
||||
};
|
||||
status_ = QM_TRAN(&tatbl_);
|
||||
break;
|
||||
}
|
||||
// ${AOs::Table::SM::active::paused::HUNGRY}
|
||||
case HUNGRY_SIG: {
|
||||
uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
// philo ID must be in range and he must be not hungry
|
||||
Q_ASSERT((n < N_PHILO) && (!me->m_isHungry[n]));
|
||||
me->m_isHungry[n] = true;
|
||||
BSP::displayPhilStat(n, HUNGRY);
|
||||
status_ = QM_HANDLED();
|
||||
break;
|
||||
}
|
||||
// ${AOs::Table::SM::active::paused::DONE}
|
||||
case DONE_SIG: {
|
||||
uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
// phil ID must be in range and he must be not hungry
|
||||
Q_ASSERT((n < N_PHILO) && (!me->m_isHungry[n]));
|
||||
|
||||
BSP::displayPhilStat(n, THINKING);
|
||||
uint8_t m = LEFT(n);
|
||||
/* both forks of Phil[n] must be used */
|
||||
Q_ASSERT((me->m_fork[n] == USED) && (me->m_fork[m] == USED));
|
||||
|
||||
me->m_fork[m] = FREE;
|
||||
me->m_fork[n] = FREE;
|
||||
status_ = QM_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status_ = QM_SUPER();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status_;
|
||||
}
|
||||
|
||||
} // namespace DPP
|
@ -3,8 +3,8 @@
|
||||
/// @ingroup qep
|
||||
/// @cond
|
||||
///***************************************************************************
|
||||
/// Last updated for version 5.7.2
|
||||
/// Last updated on 2016-09-25
|
||||
/// Last updated for version 5.7.3
|
||||
/// Last updated on 2016-10-07
|
||||
///
|
||||
/// Q u a n t u m L e a P s
|
||||
/// ---------------------------
|
||||
@ -43,15 +43,15 @@
|
||||
//! The current QP version as a decimal constant XYZ, where X is a 1-digit
|
||||
// major version number, Y is a 1-digit minor version number, and Z is
|
||||
// a 1-digit release number.
|
||||
#define QP_VERSION 572
|
||||
#define QP_VERSION 573
|
||||
|
||||
//! The current QP version number string of the form X.Y.Z, where X is
|
||||
// a 1-digit major version number, Y is a 1-digit minor version number,
|
||||
// and Z is a 1-digit release number.
|
||||
#define QP_VERSION_STR "5.7.2"
|
||||
#define QP_VERSION_STR "5.7.3"
|
||||
|
||||
//! Tamperproof current QP release (5.7.2) and date (16-10-07)
|
||||
#define QP_RELEASE 0xA00845D3U
|
||||
//! Tamperproof current QP release (5.7.3) and date (16-10-07)
|
||||
#define QP_RELEASE 0xA00845D2U
|
||||
|
||||
//****************************************************************************
|
||||
#ifndef Q_SIGNAL_SIZE
|
||||
|
@ -3,8 +3,8 @@
|
||||
/// @ingroup qf
|
||||
/// @cond
|
||||
///***************************************************************************
|
||||
/// Last updated for version 5.7.1
|
||||
/// Last updated on 2016-09-23
|
||||
/// Last updated for version 5.7.3
|
||||
/// Last updated on 2016-10-06
|
||||
///
|
||||
/// Q u a n t u m L e a P s
|
||||
/// ---------------------------
|
||||
@ -140,6 +140,7 @@ class QEQueue; // forward declaration
|
||||
/// @include qf_qmactive.cpp
|
||||
///
|
||||
class QMActive : public QMsm {
|
||||
public: // for access from extern "C" functions
|
||||
#ifdef QF_EQUEUE_TYPE
|
||||
//! OS-dependent event-queue type.
|
||||
/// @description
|
||||
@ -154,7 +155,6 @@ class QMActive : public QMsm {
|
||||
QF_EQUEUE_TYPE m_eQueue;
|
||||
#endif
|
||||
|
||||
public: // for access from extern "C" functions
|
||||
#ifdef QF_OS_OBJECT_TYPE
|
||||
//! OS-dependent per-thread object.
|
||||
/// @description
|
||||
|
11
include/qk.h
11
include/qk.h
@ -3,8 +3,8 @@
|
||||
/// @ingroup qk
|
||||
/// @cond
|
||||
///***************************************************************************
|
||||
/// Last updated for version 5.7.2
|
||||
/// Last updated on 2016-09-28
|
||||
/// Last updated for version 5.7.3
|
||||
/// Last updated on 2016-10-06
|
||||
///
|
||||
/// Q u a n t u m L e a P s
|
||||
/// ---------------------------
|
||||
@ -142,6 +142,7 @@ private:
|
||||
// interface used only inside QF, but not in applications
|
||||
|
||||
#ifdef QP_IMPL
|
||||
|
||||
#ifndef QK_ISR_CONTEXT_
|
||||
//! Internal port-specific macro that reports the execution context
|
||||
// (ISR vs. thread).
|
||||
@ -174,9 +175,9 @@ private:
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
// native event queue operations...
|
||||
// QK-specific native event queue operations...
|
||||
#define QACTIVE_EQUEUE_WAIT_(me_) \
|
||||
Q_ASSERT_ID(0, (me_)->m_eQueue.m_frontEvt != static_cast<QEvt *>(0))
|
||||
Q_ASSERT_ID(110, (me_)->m_eQueue.m_frontEvt != static_cast<QEvt *>(0))
|
||||
|
||||
#define QACTIVE_EQUEUE_SIGNAL_(me_) do { \
|
||||
QK_attr_.readySet.insert((me_)->m_prio); \
|
||||
@ -189,7 +190,7 @@ private:
|
||||
#define QACTIVE_EQUEUE_ONEMPTY_(me_) \
|
||||
QK_attr_.readySet.remove((me_)->m_prio)
|
||||
|
||||
// native QF event pool operations...
|
||||
// QK-specific native QF event pool operations...
|
||||
#define QF_EPOOL_TYPE_ QMPool
|
||||
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
|
||||
(p_).init((poolSto_), (poolSize_), (evtSize_))
|
||||
|
@ -172,6 +172,7 @@
|
||||
QP::QMActive::m_osObject,
|
||||
QP::QMActive::m_thread)
|
||||
-estring(1960, // 11-0-1(req) non-private data member
|
||||
m_eQueue,
|
||||
m_thread,
|
||||
m_prio)
|
||||
-estring(1923, // 16-2-2 could become const variable
|
||||
|
11
include/qv.h
11
include/qv.h
@ -3,8 +3,8 @@
|
||||
/// @ingroup qv
|
||||
/// @cond
|
||||
///***************************************************************************
|
||||
/// Last updated for version 5.7.2
|
||||
/// Last updated on 2016-09-28
|
||||
/// Last updated for version 5.7.3
|
||||
/// Last updated on 2016-10-06
|
||||
///
|
||||
/// Q u a n t u m L e a P s
|
||||
/// ---------------------------
|
||||
@ -105,16 +105,15 @@ extern "C" {
|
||||
#define QF_SCHED_LOCK_(dummy) ((void)0)
|
||||
#define QF_SCHED_UNLOCK_() ((void)0)
|
||||
|
||||
// native event queue operations...
|
||||
// QV-specific native event queue operations...
|
||||
#define QACTIVE_EQUEUE_WAIT_(me_) \
|
||||
Q_ASSERT((me_)->m_eQueue.m_frontEvt != static_cast<QEvt const *>(0))
|
||||
Q_ASSERT_ID(110, (me_)->m_eQueue.m_frontEvt != static_cast<QEvt *>(0))
|
||||
#define QACTIVE_EQUEUE_SIGNAL_(me_) \
|
||||
(QV_readySet_.insert((me_)->m_prio))
|
||||
|
||||
#define QACTIVE_EQUEUE_ONEMPTY_(me_) \
|
||||
(QV_readySet_.remove((me_)->m_prio))
|
||||
|
||||
// native QF event pool operations...
|
||||
// QV-specific native QF event pool operations...
|
||||
#define QF_EPOOL_TYPE_ QMPool
|
||||
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
|
||||
(p_).init((poolSto_), (poolSize_), (evtSize_))
|
||||
|
@ -4,8 +4,8 @@
|
||||
/// @ingroup qxk
|
||||
/// @cond
|
||||
///***************************************************************************
|
||||
/// Last updated for version 5.7.2
|
||||
/// Last updated on 2016-09-28
|
||||
/// Last updated for version 5.7.3
|
||||
/// Last updated on 2016-10-06
|
||||
///
|
||||
/// Q u a n t u m L e a P s
|
||||
/// ---------------------------
|
||||
@ -200,9 +200,9 @@ private:
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
// native event queue operations...
|
||||
// QXK-specific native event queue operations...
|
||||
#define QACTIVE_EQUEUE_WAIT_(me_) \
|
||||
Q_ASSERT_ID(0, (me_)->m_eQueue.m_frontEvt != static_cast<QEvt *>(0))
|
||||
Q_ASSERT_ID(110, (me_)->m_eQueue.m_frontEvt != static_cast<QEvt *>(0))
|
||||
|
||||
#define QACTIVE_EQUEUE_SIGNAL_(me_) do { \
|
||||
QXK_attr_.readySet.insert((me_)->m_prio); \
|
||||
@ -216,7 +216,7 @@ private:
|
||||
#define QACTIVE_EQUEUE_ONEMPTY_(me_) \
|
||||
QXK_attr_.readySet.remove((me_)->m_prio)
|
||||
|
||||
// native QF event pool operations...
|
||||
// QXK-specific native QF event pool operations...
|
||||
#define QF_EPOOL_TYPE_ QMPool
|
||||
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
|
||||
(p_).init((poolSto_), (poolSize_), (evtSize_))
|
||||
|
@ -1,7 +1,7 @@
|
||||
;*****************************************************************************
|
||||
; Product: QK port to ARM Cortex-M (M0,M0+,M3,M4,M7), IAR ARM assembler
|
||||
; Last Updated for Version: 5.7.2
|
||||
; Date of the Last Update: 2016-09-26
|
||||
; Last Updated for Version: 5.7.3
|
||||
; Date of the Last Update: 2016-10-07
|
||||
;
|
||||
; Q u a n t u m L e a P s
|
||||
; ---------------------------
|
||||
@ -46,12 +46,13 @@ QF_BASEPRI EQU (0xFF:SHR:2)
|
||||
THUMB
|
||||
|
||||
PRESERVE8 ; this code preserves 8-byte stack alignment
|
||||
ALIGN ; ensures alignment
|
||||
|
||||
;*****************************************************************************
|
||||
; The QK_init() function sets the priority of PendSV to 0xFF (lowest).
|
||||
; This operation is performed in a critical section.
|
||||
;*****************************************************************************
|
||||
QK_init
|
||||
QK_init FUNCTION
|
||||
MRS r0,PRIMASK ; store the state of the PRIMASK in r0
|
||||
CPSID i ; disable interrupts (set PRIMASK)
|
||||
|
||||
@ -64,6 +65,7 @@ QK_init
|
||||
|
||||
MSR PRIMASK,r0 ; restore the original PRIMASK
|
||||
BX lr ; return to the caller
|
||||
ENDFUNC
|
||||
|
||||
|
||||
;*****************************************************************************
|
||||
@ -83,10 +85,10 @@ QK_init
|
||||
;
|
||||
; Due to tail-chaining and its lowest priority, the PendSV exception will be
|
||||
; entered immediately after the exit from the *last* nested interrupt (or
|
||||
; exception). In QK, this is exactly the time when the QK scheduler needs to
|
||||
; check for the asynchronous preemption.
|
||||
; exception). In QK, this is exactly the time when the QK activator needs to
|
||||
; handle the asynchronous preemption.
|
||||
;*****************************************************************************
|
||||
PendSV_Handler
|
||||
PendSV_Handler FUNCTION
|
||||
; Prepare some constants in registers before entering critical section
|
||||
LDR r3,=0xE000ED04 ; Interrupt Control and State Register
|
||||
MOVS r1,#1
|
||||
@ -116,8 +118,9 @@ PendSV_Handler
|
||||
;
|
||||
; NOTE: the QK activator is called with interrupts DISABLED and also
|
||||
; returns with interrupts DISABLED.
|
||||
LSRS r3,r1,#3 ; r3 := (1 << 24), set the T bit (new xpsr)
|
||||
LDR r2,=QK_activate_ ; address of the QK activator (new pc)
|
||||
LSRS r3,r1,#3 ; r3 := (r1 >> 3), set the T bit (new xpsr)
|
||||
LDR r2,=QK_activate_ ; address of QK_activate_
|
||||
SUBS r2,r2,#1 ; align Thumb-address at halfword (new pc)
|
||||
LDR r1,=Thread_ret ; return address after the call (new lr)
|
||||
|
||||
SUB sp,sp,#8*4 ; reserve space for exception stack frame
|
||||
@ -126,7 +129,8 @@ PendSV_Handler
|
||||
|
||||
MOVS r0,#6
|
||||
MVNS r0,r0 ; r0 := ~6 == 0xFFFFFFF9
|
||||
BX r0 ; exception-return to the QK scheduler
|
||||
BX r0 ; exception-return to the QK activator
|
||||
ENDFUNC
|
||||
|
||||
|
||||
;*****************************************************************************
|
||||
@ -135,13 +139,13 @@ PendSV_Handler
|
||||
; NOTE: Thread_ret does not execute in the PendSV context!
|
||||
; NOTE: Thread_ret executes entirely with interrupts DISABLED.
|
||||
;*****************************************************************************
|
||||
Thread_ret
|
||||
; After the QK scheduler returns, we need to resume the preempted
|
||||
Thread_ret FUNCTION
|
||||
; After the QK activator returns, we need to resume the preempted
|
||||
; task. However, this must be accomplished by a return-from-exception,
|
||||
; while we are still in the task context. The switch to the exception
|
||||
; contex is accomplished by triggering the NMI exception.
|
||||
; NOTE: The NMI exception is triggered with nterrupts DISABLED,
|
||||
; because QK scheduler disables interrutps before return.
|
||||
; because QK activator disables interrutps before return.
|
||||
|
||||
; before triggering the NMI exception, make sure that the
|
||||
; VFP stack frame will NOT be used...
|
||||
@ -157,6 +161,7 @@ Thread_ret
|
||||
LSLS r1,r1,#31 ; r0 := (1 << 31) (NMI bit)
|
||||
STR r1,[r0] ; ICSR[31] := 1 (pend NMI)
|
||||
B . ; wait for preemption by NMI
|
||||
ENDFUNC
|
||||
|
||||
|
||||
;*****************************************************************************
|
||||
@ -168,7 +173,7 @@ Thread_ret
|
||||
; NOTE: The NMI exception is entered with interrupts DISABLED, so it needs
|
||||
; to re-enable interrupts before it returns to the preempted task.
|
||||
;*****************************************************************************
|
||||
NMI_Handler
|
||||
NMI_Handler FUNCTION
|
||||
ADD sp,sp,#(8*4) ; remove one 8-register exception frame
|
||||
|
||||
IF {TARGET_ARCH_THUMB} == 3 ; Cortex-M0/M0+/M1 (v6-M, v6S-M)?
|
||||
@ -183,6 +188,7 @@ NMI_Handler
|
||||
BX lr ; return to the preempted task
|
||||
ENDIF ; VFP available ENDIF
|
||||
ENDIF ; M3/M4/M7
|
||||
ENDFUNC
|
||||
|
||||
ALIGN ; make sure the END is properly aligned
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*****************************************************************************
|
||||
* Product: QK port to ARM Cortex-M (M0,M0+,M3,M4,M7), GNU-ARM assembler
|
||||
* Last Updated for Version: 5.7.2
|
||||
* Date of the Last Update: 2016-09-26
|
||||
* Last Updated for Version: 5.7.3
|
||||
* Date of the Last Update: 2016-10-07
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
@ -80,8 +80,8 @@ QK_init:
|
||||
*
|
||||
* Due to tail-chaining and its lowest priority, the PendSV exception will be
|
||||
* entered immediately after the exit from the *last* nested interrupt (or
|
||||
* exception). In QK, this is exactly the time when the QK scheduler needs to
|
||||
* check for the asynchronous preemption.
|
||||
* exception). In QK, this is exactly the time when the QK activator needs to
|
||||
* handle the asynchronous preemption.
|
||||
*****************************************************************************/
|
||||
.section .text.PendSV_Handler
|
||||
.global PendSV_Handler /* CMSIS-compliant exception name */
|
||||
@ -120,8 +120,9 @@ PendSV_Handler:
|
||||
* NOTE: the QK activator is called with interrupts DISABLED and also
|
||||
* returns with interrupts DISABLED.
|
||||
*/
|
||||
LSRS r3,r1,#3 /* r3 := (1 << 24), set the T bit (new xpsr) */
|
||||
LDR r2,=QK_activate_ /* address of the QK activator (new pc) */
|
||||
LSRS r3,r1,#3 /* r3 := (r1 >> 3), set the T bit (new xpsr) */
|
||||
LDR r2,=QK_activate_ /* address of QK_activate_ */
|
||||
SUBS r2,r2,#1 /* align Thumb-address at halfword (new pc) */
|
||||
LDR r1,=Thread_ret /* return address after the call (new lr) */
|
||||
|
||||
SUB sp,sp,#8*4 /* reserve space for exception stack frame */
|
||||
@ -131,7 +132,7 @@ PendSV_Handler:
|
||||
|
||||
MOVS r0,#6
|
||||
MVNS r0,r0 /* r0 := ~6 == 0xFFFFFFF9 */
|
||||
BX r0 /* exception-return to the QK scheduler */
|
||||
BX r0 /* exception-return to the QK activator */
|
||||
.size PendSV_Handler, . - PendSV_Handler
|
||||
|
||||
|
||||
@ -145,12 +146,12 @@ PendSV_Handler:
|
||||
.type Thread_ret, %function
|
||||
|
||||
Thread_ret:
|
||||
/* After the QK scheduler returns, we need to resume the preempted
|
||||
/* After the QK activator returns, we need to resume the preempted
|
||||
* task. However, this must be accomplished by a return-from-exception,
|
||||
* while we are still in the task context. The switch to the exception
|
||||
* contex is accomplished by triggering the NMI exception.
|
||||
* NOTE: The NMI exception is triggered with nterrupts DISABLED,
|
||||
* because QK scheduler disables interrutps before return.
|
||||
* because QK activator disables interrutps before return.
|
||||
*/
|
||||
|
||||
/* before triggering the PendSV exception, make sure that the
|
||||
|
@ -1,7 +1,7 @@
|
||||
;*****************************************************************************
|
||||
; Product: QK port to ARM Cortex-M (M0,M0+,M3,M4,M7), IAR ARM assembler
|
||||
; Last Updated for Version: 5.7.2
|
||||
; Date of the Last Update: 2016-09-26
|
||||
; Product: QK port to ARM Cortex-M (M0,M0+,M3,M4,M7), IAR-ARM assembler
|
||||
; Last Updated for Version: 5.7.3
|
||||
; Date of the Last Update: 2016-10-07
|
||||
;
|
||||
; Q u a n t u m L e a P s
|
||||
; ---------------------------
|
||||
@ -43,6 +43,11 @@
|
||||
QF_BASEPRI EQU (0xFF >> 2)
|
||||
|
||||
RSEG CODE:CODE:NOROOT(2)
|
||||
THUMB
|
||||
|
||||
PRESERVE8 ; this code preserves 8-byte stack alignment
|
||||
ALIGNROM 2 ; ensures alignment at 2^2 boundary
|
||||
|
||||
;*****************************************************************************
|
||||
; The QK_init() function sets the priority of PendSV to 0xFF (lowest).
|
||||
; This operation is performed in a nestable critical section.
|
||||
@ -79,8 +84,8 @@ QK_init:
|
||||
;
|
||||
; Due to tail-chaining and its lowest priority, the PendSV exception will be
|
||||
; entered immediately after the exit from the *last* nested interrupt (or
|
||||
; exception). In QK, this is exactly the time when the QK scheduler needs to
|
||||
; check for the asynchronous preemption.
|
||||
; exception). In QK, this is exactly the time when the QK activator needs to
|
||||
; handle the asynchronous preemption.
|
||||
;*****************************************************************************
|
||||
PendSV_Handler:
|
||||
; Prepare some constants in registers before entering critical section
|
||||
@ -112,8 +117,9 @@ PendSV_Handler:
|
||||
;
|
||||
; NOTE: the QK activator is called with interrupts DISABLED and also
|
||||
; returns with interrupts DISABLED.
|
||||
LSRS r3,r1,#3 ; r3 := (1 << 24), set the T bit (new xpsr)
|
||||
LDR r2,=QK_activate_ ; address of the QK activator (new pc)
|
||||
LSRS r3,r1,#3 ; r3 := (r1 >> 3), set the T bit (new xpsr)
|
||||
LDR r2,=QK_activate_ ; address of QK_activate_
|
||||
SUBS r2,r2,#1 ; align Thumb-address at halfword (new pc)
|
||||
LDR r1,=Thread_ret ; return address after the call (new lr)
|
||||
|
||||
SUB sp,sp,#8*4 ; reserve space for exception stack frame
|
||||
@ -122,22 +128,23 @@ PendSV_Handler:
|
||||
|
||||
MOVS r0,#6
|
||||
MVNS r0,r0 ; r0 := ~6 == 0xFFFFFFF9
|
||||
BX r0 ; exception-return to the QK scheduler
|
||||
BX r0 ; exception-return to the QK activator
|
||||
|
||||
|
||||
;*****************************************************************************
|
||||
; Thread_ret is a helper function executed when the QXK activator returns.
|
||||
; Thread_ret is a helper function executed when the QK activator returns.
|
||||
;
|
||||
; NOTE: Thread_ret does not execute in the PendSV context!
|
||||
; NOTE: Thread_ret executes entirely with interrupts DISABLED.
|
||||
;*****************************************************************************
|
||||
REQUIRE Thread_ret ; forces (THUMB) symbol to be referenced
|
||||
Thread_ret:
|
||||
; After the QK scheduler returns, we need to resume the preempted
|
||||
; After the QK activator returns, we need to resume the preempted
|
||||
; task. However, this must be accomplished by a return-from-exception,
|
||||
; while we are still in the task context. The switch to the exception
|
||||
; contex is accomplished by triggering the NMI exception.
|
||||
; NOTE: The NMI exception is triggered with nterrupts DISABLED,
|
||||
; because QK scheduler disables interrutps before return.
|
||||
; because QK activator disables interrutps before return.
|
||||
|
||||
; before triggering the NMI exception, make sure that the
|
||||
; VFP stack frame will NOT be used...
|
||||
@ -148,9 +155,10 @@ Thread_ret:
|
||||
#endif ; VFP available
|
||||
|
||||
; trigger NMI to return to preempted task...
|
||||
; NOTE: The NMI exception is triggered with nterrupts DISABLED
|
||||
LDR r0,=0xE000ED04 ; Interrupt Control and State Register
|
||||
MOVS r1,#1
|
||||
LSLS r1,r1,#31 ; r0 := (1 << 31) (NMI bit)
|
||||
LSLS r1,r1,#31 ; r1 := (1 << 31) (NMI bit)
|
||||
STR r1,[r0] ; ICSR[31] := 1 (pend NMI)
|
||||
B . ; wait for preemption by NMI
|
||||
|
||||
@ -180,6 +188,6 @@ NMI_Handler:
|
||||
#endif ; no VFP
|
||||
#endif ; M3/M4/M7
|
||||
|
||||
ALIGNROM 2,0xFF ; make sure the END is properly aligned
|
||||
ALIGNROM 2 ; ensures alignment at 2^2 boundary
|
||||
|
||||
END
|
||||
|
@ -1,7 +1,7 @@
|
||||
;*****************************************************************************
|
||||
; Product: QK port to ARM Cortex-M (M0,M0+,M3,M4,M7), TI-ARM assembler
|
||||
; Last Updated for Version: 5.7.2
|
||||
; Date of the Last Update: 2016-09-26
|
||||
; Last Updated for Version: 5.7.3
|
||||
; Date of the Last Update: 2016-10-07
|
||||
;
|
||||
; Q u a n t u m L e a P s
|
||||
; ---------------------------
|
||||
@ -90,8 +90,8 @@ QK_init: .asmfunc
|
||||
;
|
||||
; Due to tail-chaining and its lowest priority, the PendSV exception will be
|
||||
; entered immediately after the exit from the *last* nested interrupt (or
|
||||
; exception). In QK, this is exactly the time when the QK scheduler needs to
|
||||
; check for the asynchronous preemption.
|
||||
; exception). In QK, this is exactly the time when the QK activator needs to
|
||||
; handle the asynchronous preemption.
|
||||
;*****************************************************************************
|
||||
PendSV_Handler: .asmfunc
|
||||
|
||||
@ -124,8 +124,9 @@ PendSV_Handler: .asmfunc
|
||||
;
|
||||
; NOTE: the QK activator is called with interrupts DISABLED and also
|
||||
; returns with interrupts DISABLED.
|
||||
LSRS r3,r1,#3 ; r3 := (1 << 24), set the T bit (new xpsr)
|
||||
LDR r2,QK_activate_addr ; address of the QK activator (new pc)
|
||||
LSRS r3,r1,#3 ; r3 := (r1 >> 3), set the T bit (new xpsr)
|
||||
LDR r2,QK_activate_addr ; address of QK_activate_
|
||||
SUBS r2,r2,#1 ; align Thumb-address at halfword (new pc)
|
||||
LDR r1,Thread_ret_addr ; return address after the call (new lr)
|
||||
|
||||
SUB sp,sp,#8*4 ; reserve space for exception stack frame
|
||||
@ -134,7 +135,7 @@ PendSV_Handler: .asmfunc
|
||||
|
||||
MOVS r0,#6
|
||||
MVNS r0,r0 ; r0 := ~6 == 0xFFFFFFF9
|
||||
BX r0 ; exception-return to the QK scheduler
|
||||
BX r0 ; exception-return to the QK activator
|
||||
.endasmfunc
|
||||
|
||||
|
||||
@ -145,12 +146,12 @@ PendSV_Handler: .asmfunc
|
||||
; NOTE: Thread_ret executes entirely with interrupts DISABLED.
|
||||
;*****************************************************************************
|
||||
Thread_ret: .asmfunc ; to ensure that the label is THUMB
|
||||
; After the QK scheduler returns, we need to resume the preempted
|
||||
; After the QK activator returns, we need to resume the preempted
|
||||
; task. However, this must be accomplished by a return-from-exception,
|
||||
; while we are still in the task context. The switch to the exception
|
||||
; contex is accomplished by triggering the NMI exception.
|
||||
; NOTE: The NMI exception is triggered with nterrupts DISABLED,
|
||||
; because QK scheduler disables interrutps before return.
|
||||
; because QK activator disables interrutps before return.
|
||||
|
||||
; before triggering the NMI exception, make sure that the
|
||||
; VFP stack frame will NOT be used...
|
||||
|
@ -1,7 +1,7 @@
|
||||
;*****************************************************************************
|
||||
; Product: QXK port to ARM Cortex-M (M0,M0+,M1,M3,M4,M7), ARM-Keil assembler
|
||||
; Last Updated for Version: 5.7.2
|
||||
; Date of the Last Update: 2016-09-25
|
||||
; Last Updated for Version: 5.7.3
|
||||
; Date of the Last Update: 2016-10-07
|
||||
;
|
||||
; Q u a n t u m L e a P s
|
||||
; ---------------------------
|
||||
@ -59,12 +59,13 @@ QMACTIVE_PRIO EQU 44
|
||||
THUMB
|
||||
|
||||
PRESERVE8 ; this code preserves 8-byte stack alignment
|
||||
ALIGN ; ensures alignment
|
||||
|
||||
;*****************************************************************************
|
||||
; The QXK_init() function sets the priority of PendSV to 0xFF (lowest).
|
||||
; This operation is performed in a nestable critical section.
|
||||
;*****************************************************************************
|
||||
QXK_init
|
||||
QXK_init FUNCTION
|
||||
MRS r0,PRIMASK ; store the state of the PRIMASK in r0
|
||||
CPSID i ; disable interrupts (set PRIMASK)
|
||||
|
||||
@ -77,6 +78,7 @@ QXK_init
|
||||
|
||||
MSR PRIMASK,r0 ; restore the original PRIMASK
|
||||
BX lr ; return to the caller
|
||||
ENDFUNC
|
||||
|
||||
|
||||
;*****************************************************************************
|
||||
@ -98,10 +100,10 @@ QXK_init
|
||||
;
|
||||
; Due to tail-chaining and its lowest priority, the PendSV exception will be
|
||||
; entered immediately after the exit from the *last* nested interrupt (or
|
||||
; exception). In QXK, this is exactly the time when the QXK scheduler needs to
|
||||
; check for the asynchronous preemption.
|
||||
; exception). In QXK, this is exactly the time when the QXK activator needs to
|
||||
; handle the asynchronous preemption.
|
||||
;*****************************************************************************
|
||||
PendSV_Handler
|
||||
PendSV_Handler FUNCTION
|
||||
; Prepare some constants (an address and a bitmask) before entering
|
||||
; a critical section...
|
||||
LDR r3,=QXK_attr_
|
||||
@ -153,7 +155,8 @@ PendSV_activate
|
||||
; it returns with interrupts DISABLED.
|
||||
MOVS r3,#1
|
||||
LSLS r3,r3,#24 ; r3:=(1 << 24), set the T bit (new xpsr)
|
||||
LDR r2,=QXK_activate_ ; address of the QXK activator (new pc)
|
||||
LDR r2,=QXK_activate_ ; address of QXK_activate_
|
||||
SUBS r2,r2,#1 ; align Thumb-address at halfword (new pc)
|
||||
LDR r1,=Thread_ret ; return address after the call (new lr)
|
||||
|
||||
SUB sp,sp,#8*4 ; reserve space for exception stack frame
|
||||
@ -340,6 +343,7 @@ PendSV_restore_ex
|
||||
MSR PSP,r2 ; Process Stack Pointer := r2
|
||||
|
||||
BX lr ; return to the next extended-thread
|
||||
ENDFUNC
|
||||
|
||||
|
||||
;*****************************************************************************
|
||||
@ -348,7 +352,7 @@ PendSV_restore_ex
|
||||
; NOTE: Thread_ret does not execute in the PendSV context!
|
||||
; NOTE: Thread_ret executes entirely with interrupts DISABLED.
|
||||
;*****************************************************************************
|
||||
Thread_ret
|
||||
Thread_ret FUNCTION
|
||||
; After the QXK activator returns, we need to resume the preempted
|
||||
; thread. However, this must be accomplished by a return-from-exception,
|
||||
; while we are still in the thread context. The switch to the exception
|
||||
@ -369,6 +373,7 @@ Thread_ret
|
||||
LSLS r1,r1,#31 ; r1 := (1 << 31) (NMI bit)
|
||||
STR r1,[r0] ; ICSR[31] := 1 (pend NMI)
|
||||
B . ; wait for preemption by NMI
|
||||
ENDFUNC
|
||||
|
||||
|
||||
;*****************************************************************************
|
||||
@ -380,7 +385,7 @@ Thread_ret
|
||||
; NOTE: The NMI exception is entered with interrupts DISABLED, so it needs
|
||||
; to re-enable interrupts before it returns to the preempted task.
|
||||
;*****************************************************************************
|
||||
NMI_Handler
|
||||
NMI_Handler FUNCTION
|
||||
ADD sp,sp,#(8*4) ; remove one 8-register exception frame
|
||||
|
||||
IF {TARGET_ARCH_THUMB} == 3 ; Cortex-M0/M0+/M1 (v6-M, v6S-M)?
|
||||
@ -395,6 +400,7 @@ NMI_Handler
|
||||
BX lr ; return to the preempted task
|
||||
ENDIF ; no VFP
|
||||
ENDIF ; M3/M4/M7
|
||||
ENDFUNC
|
||||
|
||||
|
||||
;*****************************************************************************
|
||||
@ -412,7 +418,7 @@ NMI_Handler
|
||||
; aware of this QXK thread. In that case there can be no external
|
||||
; communication with this thread, so no critical section is needed.
|
||||
;*****************************************************************************
|
||||
QXK_stackInit_
|
||||
QXK_stackInit_ FUNCTION
|
||||
; assignment of parameters (AAPCS)
|
||||
; r0 - QMActive pointer (act)
|
||||
; r1 - thread routine
|
||||
@ -513,6 +519,7 @@ QXK_stackInit_fill
|
||||
STMIA r3!,{r2} ; xPSR
|
||||
|
||||
BX lr ; return to the caller
|
||||
ENDFUNC
|
||||
|
||||
ALIGN ; make sure the END is properly aligned
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*****************************************************************************
|
||||
* Product: QXK port to ARM Cortex-M (M0,M0+,M1,M3,M4,M7), GNU-ARM assembler
|
||||
* Last Updated for Version: 5.7.2
|
||||
* Date of the Last Update: 2016-09-25
|
||||
* Last Updated for Version: 5.7.3
|
||||
* Date of the Last Update: 2016-10-07
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
@ -33,6 +33,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
.syntax unified
|
||||
.thumb
|
||||
|
||||
/* NOTE: keep in synch with QF_BASEPRI value defined in "qf_port.h" !!! */
|
||||
.equ QF_BASEPRI,(0xFF >> 2)
|
||||
@ -90,8 +91,8 @@ QXK_init:
|
||||
*
|
||||
* Due to tail-chaining and its lowest priority, the PendSV exception will be
|
||||
* entered immediately after the exit from the *last* nested interrupt (or
|
||||
* exception). In QXK, this is exactly the time when the QXK scheduler needs to
|
||||
* check for the asynchronous preemption.
|
||||
* exception). In QXK, this is exactly the time when the QXK activator needs to
|
||||
* handle the asynchronous preemption.
|
||||
*****************************************************************************/
|
||||
.section .text.PendSV_Handler
|
||||
.global PendSV_Handler /* CMSIS-compliant exception name */
|
||||
@ -106,7 +107,8 @@ PendSV_Handler:
|
||||
MOVS r1,#1
|
||||
LSLS r1,r1,#27 /* r0 := (1 << 27) (UNPENDSVSET bit) */
|
||||
|
||||
/*<<<<<<<<<<<<<<<<<<<<<<< CRITICAL SECTION BEGIN <<<<<<<<<<<<<<<<<<<<<<<*/
|
||||
|
||||
/* <<<<<<<<<<<<<<<<<<<<<<< CRITICAL SECTION BEGIN <<<<<<<<<<<<<<<<<<<<< */
|
||||
.if __ARM_ARCH == 6 /* Cortex-M0/M0+/M1 (v6-M, v6S-M)? */
|
||||
CPSID i /* disable interrupts (set PRIMASK) */
|
||||
.else /* M3/M4/M7 */
|
||||
@ -153,7 +155,8 @@ PendSV_activate:
|
||||
*/
|
||||
MOVS r3,#1
|
||||
LSLS r3,r3,#24 /* r3:=(1 << 24), set the T bit (new xpsr) */
|
||||
LDR r2,=QXK_activate_ /* address of the QXK activator (new pc) */
|
||||
LDR r2,=QXK_activate_ /* address of QXK_activate_ */
|
||||
SUBS r2,r2,#1 /* align Thumb-address at halfword (new pc) */
|
||||
LDR r1,=Thread_ret /* return address after the call (new lr) */
|
||||
|
||||
SUB sp,sp,#8*4 /* reserve space for exception stack frame */
|
||||
@ -395,7 +398,6 @@ Thread_ret:
|
||||
.section .text.NMI_Handler
|
||||
.global NMI_Handler
|
||||
.type NMI_Handler, %function
|
||||
.thumb
|
||||
|
||||
NMI_Handler:
|
||||
ADD sp,sp,#(8*4) /* remove one 8-register exception frame */
|
||||
@ -433,7 +435,6 @@ NMI_Handler:
|
||||
.section .text.QXK_stackInit_
|
||||
.global QXK_stackInit_
|
||||
.type QXK_stackInit_, %function
|
||||
.thumb
|
||||
|
||||
QXK_stackInit_:
|
||||
/* assignment of parameters (AAPCS)
|
||||
|
@ -1,7 +1,7 @@
|
||||
;*****************************************************************************
|
||||
; Product: QXK port to ARM Cortex-M (M0,M0+,M3,M4,M7), IAR-ARM assembler
|
||||
; Last Updated for Version: 5.7.2
|
||||
; Date of the Last Update: 2016-09-25
|
||||
; Last Updated for Version: 5.7.3
|
||||
; Date of the Last Update: 2016-10-07
|
||||
;
|
||||
; Q u a n t u m L e a P s
|
||||
; ---------------------------
|
||||
@ -56,6 +56,11 @@ QMACTIVE_PRIO EQU 44
|
||||
|
||||
|
||||
RSEG CODE:CODE:NOROOT(2)
|
||||
THUMB
|
||||
|
||||
PRESERVE8 ; this code preserves 8-byte stack alignment
|
||||
ALIGNROM 2 ; ensures alignment at 2^2 boundary
|
||||
|
||||
;*****************************************************************************
|
||||
; The QXK_init() function sets the priority of PendSV to 0xFF (lowest).
|
||||
; This operation is performed in a nestable critical section.
|
||||
@ -94,8 +99,8 @@ QXK_init:
|
||||
;
|
||||
; Due to tail-chaining and its lowest priority, the PendSV exception will be
|
||||
; entered immediately after the exit from the *last* nested interrupt (or
|
||||
; exception). In QXK, this is exactly the time when the QXK scheduler needs to
|
||||
; check for the asynchronous preemption.
|
||||
; exception). In QXK, this is exactly the time when the QXK activator needs to
|
||||
; handle the asynchronous preemption.
|
||||
;*****************************************************************************
|
||||
PendSV_Handler:
|
||||
; Prepare some constants (an address and a bitmask) before entering
|
||||
@ -148,8 +153,9 @@ PendSV_activate:
|
||||
; NOTE: the QXK activator is called with interrupts DISABLED and also
|
||||
; it returns with interrupts DISABLED.
|
||||
MOVS r3,#1
|
||||
LSLS r3,r3,#24 ; r3:=(1 << 24), set the T bit (new xpsr)
|
||||
LDR r2,=QXK_activate_ ; address of the QXK activator (new pc)
|
||||
LSLS r3,r3,#24 ; r3 := (1 << 24), set the T bit (new xpsr)
|
||||
LDR r2,=QXK_activate_ ; address of QXK_activate_
|
||||
SUBS r2,r2,#1 ; align Thumb-address at halfword (new pc)
|
||||
LDR r1,=Thread_ret ; return address after the call (new lr)
|
||||
|
||||
SUB sp,sp,#8*4 ; reserve space for exception stack frame
|
||||
@ -344,6 +350,7 @@ PendSV_restore_ex:
|
||||
; NOTE: Thread_ret does not execute in the PendSV context!
|
||||
; NOTE: Thread_ret executes entirely with interrupts DISABLED.
|
||||
;*****************************************************************************
|
||||
REQUIRE Thread_ret ; forces (THUMB) symbol to be referenced
|
||||
Thread_ret:
|
||||
; After the QXK activator returns, we need to resume the preempted
|
||||
; thread. However, this must be accomplished by a return-from-exception,
|
||||
@ -510,6 +517,6 @@ QXK_stackInit_fill:
|
||||
|
||||
BX lr ; return to the caller
|
||||
|
||||
ALIGNROM 2,0xFF ; make sure the END is properly aligned
|
||||
ALIGNROM 2 ; ensures alignment at 2^2 boundary
|
||||
|
||||
END
|
||||
|
@ -1,7 +1,7 @@
|
||||
;*****************************************************************************
|
||||
; Product: QXK port to ARM Cortex-M (M0,M0+,M1,M3,M4,M7), TI-ARM assembler
|
||||
; Last Updated for Version: 5.7.2
|
||||
; Date of the Last Update: 2016-09-25
|
||||
; Last Updated for Version: 5.7.3
|
||||
; Date of the Last Update: 2016-10-07
|
||||
;
|
||||
; Q u a n t u m L e a P s
|
||||
; ---------------------------
|
||||
@ -102,8 +102,8 @@ QXK_init: .asmfunc
|
||||
;
|
||||
; Due to tail-chaining and its lowest priority, the PendSV exception will be
|
||||
; entered immediately after the exit from the *last* nested interrupt (or
|
||||
; exception). In QXK, this is exactly the time when the QXK scheduler needs to
|
||||
; check for the asynchronous preemption.
|
||||
; exception). In QXK, this is exactly the time when the QXK activator needs to
|
||||
; handle the asynchronous preemption.
|
||||
;*****************************************************************************
|
||||
PendSV_Handler: .asmfunc
|
||||
|
||||
@ -158,7 +158,8 @@ PendSV_activate:
|
||||
; it returns with interrupts DISABLED.
|
||||
MOVS r3,#1
|
||||
LSLS r3,r3,#24 ; r3:=(1 << 24), set the T bit (new xpsr)
|
||||
LDR r2,QXK_activate_addr ; address of the QXK activator (new pc)
|
||||
LDR r2,QXK_activate_addr ; address of QXK_activate_
|
||||
SUBS r2,r2,#1 ; align Thumb-address at halfword (new pc)
|
||||
LDR r1,Thread_ret_addr ; return address after the call (new lr)
|
||||
|
||||
SUB sp,sp,#8*4 ; reserve space for exception stack frame
|
||||
|
7
ports/ti-rtos/README.url
Normal file
7
ports/ti-rtos/README.url
Normal file
@ -0,0 +1,7 @@
|
||||
[InternetShortcut]
|
||||
URL=http://www.state-machine.com/qpcpp/ti-rtos.html
|
||||
IconFile=http://www.state-machine.com/qp.ico
|
||||
IDList=
|
||||
HotKey=0
|
||||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,2
|
45
ports/ti-rtos/qep_port.h
Normal file
45
ports/ti-rtos/qep_port.h
Normal file
@ -0,0 +1,45 @@
|
||||
/// @file
|
||||
/// @brief QEP/C++ port to a generic C++ compiler
|
||||
/// @cond
|
||||
///***************************************************************************
|
||||
/// Last updated for version 5.4.0
|
||||
/// Last updated on 2015-03-14
|
||||
///
|
||||
/// Q u a n t u m L e a P s
|
||||
/// ---------------------------
|
||||
/// innovating embedded systems
|
||||
///
|
||||
/// Copyright (C) Quantum Leaps, 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
|
||||
/// by the Free Software Foundation, either version 3 of the License, or
|
||||
/// (at your option) any later version.
|
||||
///
|
||||
/// Alternatively, this program may be distributed and modified under the
|
||||
/// terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
/// the GNU General Public License and are specifically designed for
|
||||
/// licensees interested in retaining the proprietary status of their code.
|
||||
///
|
||||
/// This program is distributed in the hope that it will be useful,
|
||||
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
/// GNU General Public License for more details.
|
||||
///
|
||||
/// You should have received a copy of the GNU General Public License
|
||||
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
///
|
||||
/// Contact information:
|
||||
/// Web: www.state-machine.com
|
||||
/// Email: info@state-machine.com
|
||||
///***************************************************************************
|
||||
/// @endcond
|
||||
|
||||
#ifndef qep_port_h
|
||||
#define qep_port_h
|
||||
|
||||
#include <stdint.h> // Exact-width types. WG14/N843 C99 Standard
|
||||
|
||||
#include "qep.h" // QEP platform-independent public interface
|
||||
|
||||
#endif // qep_port_h
|
128
ports/ti-rtos/qf_port.cpp
Normal file
128
ports/ti-rtos/qf_port.cpp
Normal file
@ -0,0 +1,128 @@
|
||||
/// @file
|
||||
/// @brief QF/C++ port to TI-RTOS kernel, all supported compilers
|
||||
/// @cond
|
||||
////**************************************************************************
|
||||
/// Last updated for version 5.7.3
|
||||
/// Last updated on 2016-10-06
|
||||
///
|
||||
/// Q u a n t u m L e a P s
|
||||
/// ---------------------------
|
||||
/// innovating embedded systems
|
||||
///
|
||||
/// 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
|
||||
/// by the Free Software Foundation, either version 3 of the License, or
|
||||
/// (at your option) any later version.
|
||||
///
|
||||
/// Alternatively, this program may be distributed and modified under the
|
||||
/// terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
/// the GNU General Public License and are specifically designed for
|
||||
/// licensees interested in retaining the proprietary status of their code.
|
||||
///
|
||||
/// This program is distributed in the hope that it will be useful,
|
||||
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
/// GNU General Public License for more details.
|
||||
///
|
||||
/// You should have received a copy of the GNU General Public License
|
||||
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
///
|
||||
/// Contact information:
|
||||
/// http://www.state-machine.com
|
||||
/// mailto:info@state-machine.com
|
||||
////**************************************************************************
|
||||
/// @endcond
|
||||
|
||||
#define QP_IMPL // this is QP implementation
|
||||
#include "qf_port.h" // QF port
|
||||
#include "qf_pkg.h"
|
||||
#include "qassert.h"
|
||||
#ifdef Q_SPY // QS software tracing enabled?
|
||||
#include "qs_port.h" // include QS port
|
||||
#else
|
||||
#include "qs_dummy.h" // disable the QS software tracing
|
||||
#endif // Q_SPY
|
||||
|
||||
#include <ti/sysbios/BIOS.h> // SYS/BIOS API (for BIOS_start())
|
||||
|
||||
// namespace QP ==============================================================
|
||||
namespace QP {
|
||||
|
||||
Q_DEFINE_THIS_MODULE("qf_port")
|
||||
|
||||
// Local objects -------------------------------------------------------------
|
||||
static void swi_function(UArg arg0, UArg arg1); // TI-RTOS Swi signature
|
||||
|
||||
//............................................................................
|
||||
void QF::init(void) {
|
||||
}
|
||||
//............................................................................
|
||||
int_t QF::run(void) {
|
||||
onStartup(); // configure & start interrupts, see NOTE0
|
||||
BIOS_start(); // start TI-RTOT (SYS/BIOS)
|
||||
|
||||
Q_ERROR_ID(100); // BIOS_start() should never return
|
||||
return static_cast<int_t>(0); // dummy return to make the compiler happy
|
||||
}
|
||||
//............................................................................
|
||||
void QF::stop(void) {
|
||||
onCleanup(); // cleanup callback
|
||||
}
|
||||
|
||||
//............................................................................
|
||||
void QMActive::start(uint_fast8_t prio,
|
||||
QEvt const *qSto[], uint_fast16_t qLen,
|
||||
void *stkSto, uint_fast16_t /* stkSize */,
|
||||
QEvt const *ie)
|
||||
{
|
||||
/// @pre the priority must be in range and the stack storage must not
|
||||
/// be provided, because this TI-RTOS port does not need per-AO stacks.
|
||||
///
|
||||
Q_REQUIRE_ID(400, (static_cast<uint_fast8_t>(0) < prio)
|
||||
&& (prio <= static_cast<uint_fast8_t>(QF_MAX_ACTIVE))
|
||||
&& (stkSto == static_cast<void *>(0)));
|
||||
|
||||
|
||||
m_eQueue.init(qSto, qLen); // initialize QEQueue of this AO
|
||||
m_prio = prio; // set QF priority of this AO before adding it to QF
|
||||
QF::add_(this); // make QF aware of this active object
|
||||
init(ie); // thake the top-most initial tran.
|
||||
QS_FLUSH(); // flush the trace buffer to the host
|
||||
|
||||
// create TI-RTOS Swi to run this active object...
|
||||
Swi_Params swiParams;
|
||||
Swi_Params_init(&swiParams);
|
||||
swiParams.arg0 = (xdc_UArg)this; // the "me" pointer
|
||||
swiParams.arg1 = 0; // not used
|
||||
swiParams.priority = prio; // TI-RTOS Swis can use the QP priority
|
||||
swiParams.trigger = 0; // not used
|
||||
Swi_construct(&m_osObject, &swi_function, &swiParams, NULL);
|
||||
m_thread = Swi_handle(&m_osObject);
|
||||
|
||||
// TI-RTOS Swi must be created correctly
|
||||
Q_ENSURE_ID(490, m_thread != 0);
|
||||
}
|
||||
//............................................................................
|
||||
void QMActive::stop() {
|
||||
m_thread = static_cast<uint32_t>(0); // stop the thread loop
|
||||
}
|
||||
|
||||
//............................................................................
|
||||
static void swi_function(UArg arg0, UArg /* arg1 */) { // TI-RTOS Swi
|
||||
QMActive *act = reinterpret_cast<QMActive *>(arg0);
|
||||
QEvt const *e = act->get_();
|
||||
act->dispatch(e);
|
||||
QF::gc(e);
|
||||
|
||||
// are events still available for this AO?
|
||||
if (!act->m_eQueue.isEmpty()) {
|
||||
Swi_post(act->m_thread);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace QP
|
||||
|
||||
///***************************************************************************
|
||||
//
|
115
ports/ti-rtos/qf_port.h
Normal file
115
ports/ti-rtos/qf_port.h
Normal file
@ -0,0 +1,115 @@
|
||||
/// @file
|
||||
/// @brief QF/C++ port to TI-RTOS kernel (SYS/BIOS), all supported compilers
|
||||
/// @cond
|
||||
///***************************************************************************
|
||||
/// Last updated for version 5.7.3
|
||||
/// Last updated on 2016-10-06
|
||||
///
|
||||
/// Q u a n t u m L e a P s
|
||||
/// ---------------------------
|
||||
/// innovating embedded systems
|
||||
///
|
||||
/// 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
|
||||
/// by the Free Software Foundation, either version 3 of the License, or
|
||||
/// (at your option) any later version.
|
||||
///
|
||||
/// Alternatively, this program may be distributed and modified under the
|
||||
/// terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
/// the GNU General Public License and are specifically designed for
|
||||
/// licensees interested in retaining the proprietary status of their code.
|
||||
///
|
||||
/// This program is distributed in the hope that it will be useful,
|
||||
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
/// GNU General Public License for more details.
|
||||
///
|
||||
/// You should have received a copy of the GNU General Public License
|
||||
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
///
|
||||
/// Contact information:
|
||||
/// http://www.state-machine.com
|
||||
/// mailto:info@state-machine.com
|
||||
///***************************************************************************
|
||||
/// @endcond
|
||||
|
||||
#ifndef qf_port_h
|
||||
#define qf_port_h
|
||||
|
||||
// TI-RTOS-specific event queue and thread types, see NOTE1
|
||||
#define QF_EQUEUE_TYPE QEQueue
|
||||
#define QF_OS_OBJECT_TYPE Swi_Struct
|
||||
#define QF_THREAD_TYPE Swi_Handle
|
||||
|
||||
// The maximum number of active objects in the application, see NOTE2
|
||||
#define QF_MAX_ACTIVE 32
|
||||
|
||||
// TI-RTOS-specific critical section operations, NOTE3
|
||||
#define QF_CRIT_STAT_TYPE UInt
|
||||
#define QF_CRIT_ENTRY(key_) ((key_) = Hwi_disable())
|
||||
#define QF_CRIT_EXIT(key_) (Hwi_restore((key_)))
|
||||
|
||||
#include <ti/sysbios/hal/Hwi.h> // TI-RTOS Hwi package
|
||||
#include <ti/sysbios/knl/Swi.h> // TI-RTOS Swi package
|
||||
|
||||
#include "qep_port.h" // QEP port
|
||||
#include "qequeue.h" // this QF port uses the native QF event queue
|
||||
#include "qmpool.h" // this QF port uses the native QF memory pool
|
||||
#include "qf.h" // QF platform-independent public interface
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// interface used only inside QF, but not in applications
|
||||
//
|
||||
#ifdef QP_IMPL
|
||||
|
||||
// TI-RTOS-specific scheduler locking, see NOTE4
|
||||
#define QF_SCHED_STAT_ UInt key_;
|
||||
#define QF_SCHED_LOCK_(dummy) (key_ = Swi_disable())
|
||||
#define QF_SCHED_UNLOCK_() (Swi_restore(key_))
|
||||
|
||||
// TI-RTOS-specific native event queue operations...
|
||||
#define QACTIVE_EQUEUE_WAIT_(me_) \
|
||||
Q_ASSERT_ID(110, (me_)->m_eQueue.m_frontEvt != static_cast<QEvt *>(0))
|
||||
#define QACTIVE_EQUEUE_SIGNAL_(me_) Swi_post((me_)->m_thread)
|
||||
#define QACTIVE_EQUEUE_ONEMPTY_(dummy) ((void)0)
|
||||
|
||||
// TI-RTOS native QF event pool operations...
|
||||
#define QF_EPOOL_TYPE_ QMPool
|
||||
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
|
||||
(p_).init((poolSto_), (poolSize_), (evtSize_))
|
||||
#define QF_EPOOL_EVENT_SIZE_(p_) \
|
||||
static_cast<uint_fast16_t>((p_).getBlockSize())
|
||||
#define QF_EPOOL_GET_(p_, e_, m_) \
|
||||
((e_) = static_cast<QEvt *>((p_).get((m_))))
|
||||
#define QF_EPOOL_PUT_(p_, e_) ((p_).put(e_))
|
||||
|
||||
#endif // ifdef QP_IMPL
|
||||
|
||||
#endif // qf_port_h
|
||||
|
||||
//****************************************************************************
|
||||
//
|
||||
// NOTE1:
|
||||
// This QP port uses the TI-RTOS Swis ("Software Interrupts") to provide the
|
||||
// thread context to run QP active objects. The TI-RTOS Swis are a perfect
|
||||
// match to execute the run-to-completion (RTC) event-processing in active
|
||||
// objects and requre far less resources (no private stacks) than regular
|
||||
// blocking threads.
|
||||
//
|
||||
// NOTE2:
|
||||
// The maximum number of active objects in the application cannot exceed the
|
||||
// number of Swis available in TI-RTOS. On 32-bit CPUs, such as ARM Cortex-M,
|
||||
// the maximum number of Swis is 32.
|
||||
//
|
||||
// NOTE3:
|
||||
// The QF critical section is implemented with the TI-RTOS Hwi disable/enable.
|
||||
// The type of critical section preserves the interrupt status and allows
|
||||
// critical sections to nest.
|
||||
//
|
||||
// NOTE4:
|
||||
// TI-RTOS provides only global disabling of Swis. Therefore, locking the
|
||||
// scheduler only up to the specified lock priority is not supported.
|
||||
//
|
54
ports/ti-rtos/qs_port.h
Normal file
54
ports/ti-rtos/qs_port.h
Normal file
@ -0,0 +1,54 @@
|
||||
/// @file
|
||||
/// @brief QS/C++ port to a 32-bit CPU, generic compiler
|
||||
/// @cond
|
||||
///***************************************************************************
|
||||
/// Last updated for version 5.6.0
|
||||
/// Last updated on 2015-12-26
|
||||
///
|
||||
/// Q u a n t u m L e a P s
|
||||
/// ---------------------------
|
||||
/// innovating embedded systems
|
||||
///
|
||||
/// Copyright (C) Quantum Leaps. 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
|
||||
/// by the Free Software Foundation, either version 3 of the License, or
|
||||
/// (at your option) any later version.
|
||||
///
|
||||
/// Alternatively, this program may be distributed and modified under the
|
||||
/// terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
/// the GNU General Public License and are specifically designed for
|
||||
/// licensees interested in retaining the proprietary status of their code.
|
||||
///
|
||||
/// This program is distributed in the hope that it will be useful,
|
||||
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
/// GNU General Public License for more details.
|
||||
///
|
||||
/// You should have received a copy of the GNU General Public License
|
||||
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
///
|
||||
/// Contact information:
|
||||
/// http://www.state-machine.com
|
||||
/// mailto:info@state-machine.com
|
||||
///***************************************************************************
|
||||
/// @endcond
|
||||
|
||||
#ifndef qs_port_h
|
||||
#define qs_port_h
|
||||
|
||||
#define QS_TIME_SIZE 4
|
||||
#define QS_OBJ_PTR_SIZE 4
|
||||
#define QS_FUN_PTR_SIZE 4
|
||||
|
||||
//****************************************************************************
|
||||
// NOTE: QS might be used with or without other QP components, in which case
|
||||
// the separate definitions of the macros QF_CRIT_STAT_TYPE, QF_CRIT_ENTRY,
|
||||
// and QF_CRIT_EXIT are needed. In this port QS is configured to be used with
|
||||
// the QF framework, by simply including "qf_port.h" *before* "qs.h".
|
||||
//
|
||||
#include "qf_port.h" // use QS with QF
|
||||
#include "qs.h" // QS platform-independent public interface
|
||||
|
||||
#endif // qs_port_h
|
Binary file not shown.
Binary file not shown.
@ -8,8 +8,8 @@
|
||||
/// @ingroup qf
|
||||
/// @cond
|
||||
///***************************************************************************
|
||||
/// Last updated for version 5.7.2
|
||||
/// Last updated on 2016-09-29
|
||||
/// Last updated for version 5.7.3
|
||||
/// Last updated on 2016-10-06
|
||||
///
|
||||
/// Q u a n t u m L e a P s
|
||||
/// ---------------------------
|
||||
@ -156,7 +156,7 @@ bool QMActive::post_(QEvt const * const e, uint_fast16_t const margin,
|
||||
else {
|
||||
/// @note assert if event cannot be posted and dropping events is
|
||||
/// not acceptable
|
||||
Q_ASSERT_ID(110, margin != static_cast<uint_fast16_t>(0));
|
||||
Q_ASSERT_ID(120, margin != static_cast<uint_fast16_t>(0));
|
||||
|
||||
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_ATTEMPT, QS::priv_.aoObjFilter,
|
||||
this)
|
||||
|
@ -4,7 +4,7 @@
|
||||
/// @cond
|
||||
///***************************************************************************
|
||||
/// Last updated for version 5.7.2
|
||||
/// Last updated on 2016-09-28
|
||||
/// Last updated on 2016-09-30
|
||||
///
|
||||
/// Q u a n t u m L e a P s
|
||||
/// ---------------------------
|
||||
@ -206,11 +206,6 @@ bool QXThread::post_(QEvt const * const e, uint_fast16_t const margin,
|
||||
|
||||
QF_CRIT_ENTRY_();
|
||||
|
||||
// is the owner thread blocked on its internal event queue?
|
||||
if (m_temp.obj == reinterpret_cast<QMState const *>(&m_eQueue)) {
|
||||
(void)teDisarm_();
|
||||
}
|
||||
|
||||
QEQueueCtr nFree = m_eQueue.m_nFree; // get volatile into temporary
|
||||
|
||||
// margin available?
|
||||
@ -246,6 +241,7 @@ bool QXThread::post_(QEvt const * const e, uint_fast16_t const margin,
|
||||
if (m_temp.obj
|
||||
== reinterpret_cast<QMState const *>(&m_eQueue))
|
||||
{
|
||||
(void)teDisarm_();
|
||||
QXK_attr_.readySet.insert(m_prio);
|
||||
if (!QXK_ISR_CONTEXT_()) {
|
||||
(void)QXK_sched_();
|
||||
|
@ -1,2 +0,0 @@
|
||||
QP/C++ 5.7.2
|
||||
2016-10-07
|
2
version-5.7.3
Normal file
2
version-5.7.3
Normal file
@ -0,0 +1,2 @@
|
||||
QP/C++ 5.7.3
|
||||
2016-10-07
|
Loading…
x
Reference in New Issue
Block a user