8 Commits

Author SHA1 Message Date
Frédéric Desbiens
738d0a8228 Added coding conventions draft. 2026-02-02 17:28:17 -05:00
Frédéric Desbiens
4b6e8100d9 Merge commit from fork
Fix: Return 0u when no counters available
2026-01-09 09:38:16 -05:00
Frédéric Desbiens
a9b31c3102 Merge pull request #495 from eclipse-threadx/dev
Merge changes ahead of the v6.4.5.202504 release
2026-01-09 09:36:27 -05:00
Frédéric Desbiens
5c58767c5d Updated the version number 2026-01-09 09:33:14 -05:00
Frédéric Desbiens
d24ef8db37 Updated the version number 2026-01-09 09:31:57 -05:00
Frédéric Desbiens
44fadf7143 Merge pull request #478 from ayedm1/fix_typo
fix typo TX_BYTE_POOL_DELAY_VALUE  instead of TX_BTYE_POOL_DELAY_VALUE
2025-11-27 17:05:17 -05:00
MAY
a9558def77 fix typo TX_BYTE_POOL_DELAY_VALUE instead of TX_BTYE_POOL_DELAY_VALUE 2025-11-25 19:33:46 +01:00
nopnopnop-lavine
c09b444792 Fix: Return 0u when no counters available 2025-11-18 14:43:17 +08:00
4 changed files with 94 additions and 13 deletions

80
CODINGCONVENTIONS.md Normal file
View File

@@ -0,0 +1,80 @@
# Eclipse ThreadX Coding Conventions
_Version: 2026.01-DRAFT_
All ThreadX software conforms to a strict set of coding conventions.
## 1. C coding conventions
Versions of ThreadX 6.0 and greater follow the MISRA-C:2004 and MISRA C:2012 coding conventions.
### 1.1. ThreadX File Names
All ThreadX C file names take the form `tx_x.c` where `x` represents the component name (e.g., `tx_thread_create.c` contains the function `_tx_thread_create`). Component specification file names take the form `tx_x.h` (e.g., `tx_thread.h`). These naming conventions distinguish ThreadX files from all other application source files.
### 1.2. ThreadX Name Space
All ThreadX functions and global data have a leading `_tx` in their name. This keeps ThreadX global symbols separate from the application symbols and in one contiguous area of the load map created by the linker.
### 1.3. ThreadX Constant Names
All ThreadX constants have the form `TX_NAME` or `TX_C_NAME` and are comprised of capital letters, numerals, and underscores. System constants defined in `tx_api.h` or `tx_port.h` take the form `TX_NAME` (e.g., `TX_SUCCESS`). Component constants defined in component specification files take the form `TX_x_NAME` where `x` represents the capitalized entire component name (e.g., `TX_INITIALIZE_IN_PROGRESS`).
### 1.4. ThreadX Struct and Typedef Names
ThreadX C structure and typedef names are similar to component-specific constant names. System-wide typedefs have the form `TX_X_NAME`, where `x` is the capitalized component name (e.g., `TX_QUEUE`). Component-specific typedefs are contained in `tx_api.h`. Primitive data types like `UINT`, `ULONG`, and `VOID` do not require the leading `TX` modifier and are defined in `tx_port.h`.
#### 1.4.1 ThreadX Member Names
Structure member names are all lower case and take the form `tx_x_name` where `x` is the entire component name (e.g., `tx_thread_id` in the `TX_THREAD` structure).
### 1.5. ThreadX Global Data Names
Each component has a small amount of global C data elements. These elements are lower-case and have the form `_tx_x_name` (e.g., `_tx_thread_current_ptr`).
### 1.6. ThreadX Local Data Names
Readability is the primary requirement for local data elements defined inside ThreadX C functions. Frequently used elements are typically assigned the register modifier if supported by the target compiler.
### 1.7. ThreadX Function Names
All component function names have the form `_tx_x_name` in lower-case, where `x` represents the entire component name (e.g., `_tx_thread_create`).
### 1.8. Source Code Indentation
The standard indentation increment is four spaces. Tab characters are avoided to make the source code less sensitive to text editors.
### 1.9. Comments
Each C statement in the ThreadX source code generally has a meaningful comment. Each source file contains a standardised header as described below.
## 2. Assembly coding conventions
### 2.1. TBD
## 3.0. File headers
ThreadX file headers are made of two distinct sections.
The first section states the copyright owners of the code found in the file, and states the applicable license. The MIT license applies to the vast majority of the files making up ThreadX. It is mandatory to include the applicable SPDX license identifier.
The second section describes the ThreadX component the files belongs to.
Below is a sample file header.
```
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2026 Eclipse ThreadX Contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Block Pool */
/** */
/**************************************************************************/
/**************************************************************************/
```

View File

@@ -148,8 +148,8 @@ extern "C" {
#define AZURE_RTOS_THREADX
#define THREADX_MAJOR_VERSION 6
#define THREADX_MINOR_VERSION 4
#define THREADX_PATCH_VERSION 3
#define THREADX_BUILD_VERSION 202503
#define THREADX_PATCH_VERSION 5
#define THREADX_BUILD_VERSION 202504
#define THREADX_HOTFIX_VERSION ' '
/* Define the following symbol for backward compatibility */

View File

@@ -135,9 +135,10 @@ extern "C" {
#ifndef TX_BYTE_POOL_MULTIPLE_BLOCK_SEARCH
#define TX_BYTE_POOL_MULTIPLE_BLOCK_SEARCH 20
#endif
#ifndef TX_BTYE_POOL_DELAY_VALUE
#ifndef TX_BYTE_POOL_DELAY_VALUE
#define TX_BYTE_POOL_DELAY_VALUE 3
#endif
#endif /* TX_BYTE_POOL_DELAY_VALUE */
/* Define basic constants for the ThreadX kernel. */
@@ -149,8 +150,8 @@ extern "C" {
#define AZURE_RTOS_THREADX
#define THREADX_MAJOR_VERSION 6
#define THREADX_MINOR_VERSION 4
#define THREADX_PATCH_VERSION 3
#define THREADX_BUILD_VERSION 202503
#define THREADX_PATCH_VERSION 5
#define THREADX_BUILD_VERSION 202504
#define THREADX_HOTFIX_VERSION ' '

View File

@@ -7751,7 +7751,7 @@ UINT index;
if (index >= OSEK_MAX_COUNTERS)
{
/* No more Counters available - user configuration error. */
return ((CounterType) E_OS_SYS_STACK);
return ((CounterType) 0u);
}
/* Found one. */