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:51 -05:00
parent 4a0ba19b3a
commit 18cf7603e9
4 changed files with 63 additions and 27 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>
@ -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

@ -4,14 +4,14 @@
* @ingroup ports
* @cond
******************************************************************************
* Last updated for version 6.9.1
* Last updated on 2020-09-03
* 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, LLC. All rights reserved.
* Copyright (C) 2005-2021 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
@ -112,6 +112,8 @@ void QActive_start_(QActive * const me, uint_fast8_t prio,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
{
char task_name[4]; /* task name to be passed to OS_CreateTaskEx() */
/* create the embOS message box for the AO */
OS_CreateMB(&me->eQueue,
(OS_U16)sizeof(QEvt *),
@ -123,9 +125,17 @@ void QActive_start_(QActive * const me, uint_fast8_t prio,
QHSM_INIT(&me->super, par, me->prio); /* 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 Active Object
*/
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(&me->thread,
"AO",
task_name, /* the unique task name */
(OS_PRIO)prio, /* embOS uses the same numbering as QP */
&thread_function,
(void OS_STACKPTR *)stkSto,

View File

@ -87,13 +87,15 @@ void QActive_start_(QActive * const me, uint_fast8_t prio,
void const * const par)
{
UINT tx_prio; /* ThreadX priority corresponding to the QF priority prio */
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,
@ -116,7 +118,7 @@ void QActive_start_(QActive * const me, uint_fast8_t prio,
Q_ALLEGE_ID(220,
tx_thread_create(
&me->thread, /* ThreadX thread control block */
tx_name, /* thread name */
tx_name, /* unique thread name */
&thread_function, /* thread function */
(ULONG)me, /* thread parameter */
stkSto, /* stack start */

View File

@ -4,14 +4,14 @@
* @ingroup ports
* @cond
******************************************************************************
* Last updated for version 6.9.1
* Last updated on 2020-09-03
* Last updated for version 6.9.2a
* Last updated on 2020-01-26
*
* Q u a n t u m L e a P s
* ------------------------
* Modern Embedded Software
*
* Copyright (C) 2005-2020 Quantum Leaps, LLC. All rights reserved.
* Copyright (C) 2005-2021 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
@ -89,6 +89,7 @@ void QActive_start_(QActive * const me, uint_fast8_t prio,
{
INT8U p_ucos;
INT8U err;
char_t task_name[4]; /* task name to be passed to OSTaskCreateExt() */
me->eQueue = OSQCreate((void **)qSto, qLen); /* create uC/OS-II queue */
/* the uC/OS-II queue must be created correctly */
@ -103,6 +104,14 @@ void QActive_start_(QActive * const me, uint_fast8_t prio,
/* map from QP to uC/OS priority */
p_ucos = (INT8U)(QF_MAX_ACTIVE - me->prio);
/* prepare the unique task name of the form "Axx",
* where xx is a 2-digit QP priority of the Active Object
*/
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
@ -121,7 +130,7 @@ void QActive_start_(QActive * const me, uint_fast8_t prio,
(INT16U)me->prio, /* the unique AO priority as task ID */
(OS_STK *)stkSto, /* pbos */
(INT32U)(stkSize/sizeof(OS_STK)),/* stack size in OS_STK units */
(void *)0, /* pext */
task_name, /* pext */
(INT16U)me->thread); /* task options, see NOTE1 */
/* uC/OS-II task must be created correctly */