QP/C ports to embOS/ThreadX/uCOS-II: added thread name of the form Axx
This commit is contained in:
MMS 2021-01-26 18:34:29 -05:00
parent cb76cab6ad
commit 92848155b8
5 changed files with 85 additions and 50 deletions

View File

@ -66,7 +66,7 @@
</option>
<option>
<name>OGLastSavedByProductVersion</name>
<state>8.40.2.22864</state>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
@ -116,7 +116,7 @@
</option>
<option>
<name>GBECoreSlave</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -133,7 +133,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -156,7 +156,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -215,7 +215,7 @@
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>35</version>
<version>36</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -474,6 +474,10 @@
<name>OICompilerExtraOption</name>
<state>1</state>
</option>
<option>
<name>CCStackProtection</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -1179,7 +1183,7 @@
</option>
<option>
<name>GBECoreSlave</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -1196,7 +1200,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -1219,7 +1223,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -1278,7 +1282,7 @@
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>35</version>
<version>36</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
@ -1537,6 +1541,10 @@
<name>OICompilerExtraOption</name>
<state>1</state>
</option>
<option>
<name>CCStackProtection</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -2242,7 +2250,7 @@
</option>
<option>
<name>GBECoreSlave</name>
<version>27</version>
<version>28</version>
<state>40</state>
</option>
<option>
@ -2259,7 +2267,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -2282,7 +2290,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -2341,7 +2349,7 @@
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>35</version>
<version>36</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -2600,6 +2608,10 @@
<name>OICompilerExtraOption</name>
<state>1</state>
</option>
<option>
<name>CCStackProtection</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -3263,18 +3275,9 @@
</group>
<group>
<name>QP_port</name>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\ports\embos\qep_port.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\ports\embos\qf_port.cpp</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\ports\embos\qf_port.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\ports\embos\qs_port.h</name>
</file>
</group>
<group>
<name>QS</name>

View File

@ -66,7 +66,7 @@
</option>
<option>
<name>OGLastSavedByProductVersion</name>
<state>8.40.2.22864</state>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
@ -116,7 +116,7 @@
</option>
<option>
<name>GBECoreSlave</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -133,7 +133,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -156,7 +156,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -215,7 +215,7 @@
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>35</version>
<version>36</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -474,6 +474,10 @@
<name>OICompilerExtraOption</name>
<state>1</state>
</option>
<option>
<name>CCStackProtection</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -1179,7 +1183,7 @@
</option>
<option>
<name>GBECoreSlave</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -1196,7 +1200,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -1219,7 +1223,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -1278,7 +1282,7 @@
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>35</version>
<version>36</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
@ -1538,6 +1542,10 @@
<name>OICompilerExtraOption</name>
<state>1</state>
</option>
<option>
<name>CCStackProtection</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -2243,7 +2251,7 @@
</option>
<option>
<name>GBECoreSlave</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -2260,7 +2268,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -2283,7 +2291,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>27</version>
<version>28</version>
<state>39</state>
</option>
<option>
@ -2342,7 +2350,7 @@
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>35</version>
<version>36</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -2602,6 +2610,10 @@
<name>OICompilerExtraOption</name>
<state>1</state>
</option>
<option>
<name>CCStackProtection</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -3192,6 +3204,9 @@
<data />
</settings>
</configuration>
<mfc>
<configuration>Debug</configuration>
</mfc>
<group>
<name>Application</name>
<file>

View File

@ -2,14 +2,14 @@
/// @brief QF/C++ port to embOS RTOS kernel, all supported compilers
/// @cond
////**************************************************************************
/// Last updated for version 6.9.1
/// Last updated on 2020-10-17
/// Last updated for version 6.9.2a
/// Last updated on 2021-01-26
///
/// Q u a n t u m L e a P s
/// ------------------------
/// Modern Embedded Software
///
/// Copyright (C) 2005-2020 Quantum Leaps. All rights reserved.
/// Copyright (C) 2005-2021 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
@ -130,9 +130,17 @@ void QActive::start(std::uint_fast8_t const prio,
init(par, m_prio); // take the top-most initial tran.
QS_FLUSH(); // flush the trace buffer to the host
// prepare the unique task name of the form "Axx",
// where xx is a 2-digit QP priority of the task
char task_name[4];
task_name[0] = 'A';
task_name[1] = '0' + (prio / 10U);
task_name[2] = '0' + (prio % 10U);
task_name[3] = '\0'; // zero-terminate
// create an embOS task for the AO
OS_CreateTaskEx(&m_thread,
"AO",
task_name, // unique name of the task
static_cast<OS_PRIO>(prio), // embOS uses same numbering as QP
&thread_function,
static_cast<void OS_STACKPTR *>(stkSto),

View File

@ -92,13 +92,14 @@ void QActive::start(std::uint_fast8_t const prio,
void * const stkSto, std::uint_fast16_t const stkSize,
void const * const par)
{
CHAR tx_name[5]; // name passed to ThreadX queue and thread
CHAR tx_name[4]; // name passed to ThreadX queue and thread
// prepare the unique name of the form "Axx",
// where xx is a 2-digit QP priority of the Active Object
tx_name[0] = 'A';
tx_name[1] = 'O';
tx_name[2] = '0' + (prio / 10U);
tx_name[3] = '0' + (prio % 10U);
tx_name[4] = '\0';
tx_name[1] = '0' + (prio / 10U);
tx_name[2] = '0' + (prio % 10U);
tx_name[3] = '\0';
// allege that the ThreadX queue is created successfully
Q_ALLEGE_ID(210,
@ -121,7 +122,7 @@ void QActive::start(std::uint_fast8_t const prio,
Q_ALLEGE_ID(220,
tx_thread_create(
&m_thread, // ThreadX thread control block
tx_name, // thread name
tx_name, // unique thread name
&thread_function, // thread function
reinterpret_cast<ULONG>(this), // thread parameter
stkSto, // stack start

View File

@ -2,14 +2,14 @@
/// @brief QF/C++ port to uC/OS-II RTOS, all supported compilers
/// @cond
///***************************************************************************
/// Last updated for version 6.9.1
/// Last updated on 2020-10-17
/// Last updated for version 6.9.2a
/// Last updated on 2021-01-26
///
/// Q u a n t u m L e a P s
/// ------------------------
/// Modern Embedded Software
///
/// Copyright (C) 2005-2020 Quantum Leaps. All rights reserved.
/// Copyright (C) 2005-2021 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
@ -95,6 +95,14 @@ void QActive::start(std::uint_fast8_t const prio,
// map from QP to uC/OS-II priority
INT8U p_ucos = static_cast<INT8U>(QF_MAX_ACTIVE - m_prio);
// prepare the unique task name of the form "Axx",
// where xx is a 2-digit QP priority of the task
char task_name[4];
task_name[0] = 'A';
task_name[1] = '0' + (prio / 10U);
task_name[2] = '0' + (prio % 10U);
task_name[3] = '\0'; // zero-terminate
// create AO's task...
//
// NOTE: The call to uC/OS-II API OSTaskCreateExt() assumes that the
@ -112,9 +120,9 @@ void QActive::start(std::uint_fast8_t const prio,
#endif
p_ucos, // uC/OS-II task priority
static_cast<INT16U>(prio), // the unique QP priority is the task id
static_cast<OS_STK *>(stkSto), // pbos
static_cast<OS_STK *>(stkSto), // pbos
static_cast<INT32U>(stkSize/sizeof(OS_STK)),// size in OS_STK units
nullptr, // pext
task_name, // pext
static_cast<INT16U>(m_thread)); // task options, see NOTE1
// uC/OS-II task must be created correctly