Skip to content

Commit 8c3c08f

Browse files
committed
Release 6.1.12
1 parent 54cda6e commit 8c3c08f

File tree

217 files changed

+13427
-13461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+13427
-13461
lines changed

CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,17 @@ endif()
3131
# Pick up the common stuff
3232
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/common)
3333

34-
35-
34+
# Define the FreeRTOS adaptation layer
35+
add_library(freertos-threadx EXCLUDE_FROM_ALL)
36+
target_include_directories(freertos-threadx
37+
PUBLIC
38+
${CMAKE_CURRENT_LIST_DIR}/utility/rtos_compatibility_layers/FreeRTOS
39+
)
40+
target_sources(freertos-threadx
41+
PRIVATE
42+
${CMAKE_CURRENT_LIST_DIR}/utility/rtos_compatibility_layers/FreeRTOS/tx_freertos.c
43+
)
44+
target_link_libraries(freertos-threadx PUBLIC threadx)
3645

3746
# If the user provided an override, copy it to the custom directory
3847
if (NOT TX_USER_FILE)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Azure RTOS provides OEMs with components to secure communication and to create c
8787

8888
# Adaptation layer for ThreadX
8989

90-
Azure RTOS ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications. To help ease application migration to Auzre RTOS, ThreadX provides [adaption layers](https://github.com/azure-rtos/threadx/tree/master/utility/rtos_compatibility_layers) for various legacy RTOS APIs (FreeRTOS, POSIX, OSEK, etc.).
90+
Azure RTOS ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications. To help ease application migration to Azure RTOS, ThreadX provides [adaption layers](https://github.com/azure-rtos/threadx/tree/master/utility/rtos_compatibility_layers) for various legacy RTOS APIs (FreeRTOS, POSIX, OSEK, etc.).
9191

9292
# Licensing
9393

common/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ target_sources(${PROJECT_NAME}
202202

203203
# Add the Common/inc directory to the project include list
204204
target_include_directories(${PROJECT_NAME}
205+
SYSTEM
205206
PUBLIC
206207
${CMAKE_CURRENT_LIST_DIR}/inc
207208
)

common/inc/tx_api.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* APPLICATION INTERFACE DEFINITION RELEASE */
2727
/* */
2828
/* tx_api.h PORTABLE C */
29-
/* 6.1.11 */
29+
/* 6.1.12 */
3030
/* AUTHOR */
3131
/* */
3232
/* William E. Lamie, Microsoft Corporation */
@@ -86,6 +86,9 @@
8686
/* optimized the definition of */
8787
/* TX_TIMER_TICKS_PER_SECOND, */
8888
/* resulting in version 6.1.11 */
89+
/* 07-29-2022 Scott Larson Modified comment(s), */
90+
/* update patch number, */
91+
/* resulting in version 6.1.12 */
8992
/* */
9093
/**************************************************************************/
9194

@@ -122,7 +125,7 @@ extern "C" {
122125
#define AZURE_RTOS_THREADX
123126
#define THREADX_MAJOR_VERSION 6
124127
#define THREADX_MINOR_VERSION 1
125-
#define THREADX_PATCH_VERSION 11
128+
#define THREADX_PATCH_VERSION 12
126129

127130
/* Define the following symbol for backward compatibility */
128131
#define EL_PRODUCT_THREADX

common/src/tx_trace_object_register.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/* FUNCTION RELEASE */
3535
/* */
3636
/* _tx_trace_object_register PORTABLE C */
37-
/* 6.1 */
37+
/* 6.1.12 */
3838
/* AUTHOR */
3939
/* */
4040
/* William E. Lamie, Microsoft Corporation */
@@ -69,9 +69,12 @@
6969
/* */
7070
/* DATE NAME DESCRIPTION */
7171
/* */
72-
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
73-
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
72+
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
73+
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
7474
/* resulting in version 6.1 */
75+
/* 07-29-2022 Scott Larson Modified comment(s), */
76+
/* check for null name, */
77+
/* resulting in version 6.1.12 */
7578
/* */
7679
/**************************************************************************/
7780
VOID _tx_trace_object_register(UCHAR object_type, VOID *object_ptr, CHAR *object_name, ULONG parameter_1, ULONG parameter_2)
@@ -223,6 +226,12 @@ TX_TRACE_OBJECT_ENTRY *entry_ptr;
223226
work_ptr = TX_CHAR_TO_UCHAR_POINTER_CONVERT(object_name);
224227
work_ptr = TX_UCHAR_POINTER_ADD(work_ptr, i);
225228

229+
/* Determine if object_name (work_ptr) is null. */
230+
if (work_ptr == TX_NULL)
231+
{
232+
break;
233+
}
234+
226235
/* Copy a character of the name. */
227236
entry_ptr -> tx_trace_object_entry_name[i] = (UCHAR) *work_ptr;
228237

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
#include <string.h>
4+
5+
6+
/* Define the file handles. */
7+
8+
FILE *source_file;
9+
FILE *array_file;
10+
11+
12+
int main(int argc, char* argv[])
13+
{
14+
15+
int alpha;
16+
int alpha1;
17+
int alpha2;
18+
int alpha3;
19+
unsigned long address;
20+
unsigned long column;
21+
22+
23+
/* Determine if the proper number of files are provided. */
24+
if (argc != 3)
25+
{
26+
27+
/* Print an error message out and wait for user key hit. */
28+
printf("module_binary_to_c_array.exe - Copyright (c) Microsoft Corporation v5.8\n");
29+
printf("**** Error: invalid input parameter for module_binary_to_c_array.exe **** \n");
30+
printf(" Command Line Should be:\n\n");
31+
printf(" > module_binary_to_c_array source_binary_file c_array_file <cr> \n\n");
32+
return(1);
33+
}
34+
35+
/* Attempt to open the source file for reading. */
36+
source_file = fopen(argv[1], "rb");
37+
38+
/* Determine if the source file was opened properly. */
39+
if (source_file == NULL)
40+
{
41+
42+
/* Print an error message out and wait for user key hit. */
43+
printf("**** Error: open failed on binary source file **** \n");
44+
printf(" File: %s ", argv[1]);
45+
return(2);
46+
}
47+
48+
/* Determine if the binary file is a valid ThreadX module. */
49+
alpha = fgetc(source_file);
50+
alpha1 = fgetc(source_file);
51+
alpha2 = fgetc(source_file);
52+
alpha3 = fgetc(source_file);
53+
54+
if ((alpha != 0x4D && alpha != 0x55) || (alpha1 != 0x4F && alpha1 != 0x44) || (alpha2 != 0x44 && alpha2 != 0x4F) || (alpha3 != 0x55 && alpha3 != 0x4D))
55+
{
56+
57+
/* Print an error message out and wait for user key hit. */
58+
printf("**** Error: invalid format of binary input file **** \n");
59+
printf(" File: %s ", argv[1]);
60+
return(3);
61+
}
62+
63+
/* Attempt to open the dump file for writing. */
64+
array_file = fopen(argv[2], "w");
65+
66+
/* Determine if the dump file was opened properly. */
67+
if (array_file == NULL)
68+
{
69+
70+
/* Print an error message out and wait for user key hit. */
71+
printf("**** Error: open failed on C array file **** \n");
72+
printf(" File: %s ", argv[2]);
73+
return(4);
74+
}
75+
76+
fprintf(array_file, "/**************************** Module-Binary-to-C-array Utility **********************************/\n");
77+
fprintf(array_file, "/* */\n");
78+
fprintf(array_file, "/* Copyright (c) Microsoft Corporation Version 5.4, build date: 03-01-2018 */\n");
79+
fprintf(array_file, "/* */\n");
80+
fprintf(array_file, "/************************************************************************************************/\n\n");
81+
fprintf(array_file, "/* \n");
82+
fprintf(array_file, " Input Binary file: %30s\n", argv[1]);
83+
fprintf(array_file, " Output C Array file: %30s\n", argv[2]);
84+
fprintf(array_file, "*/\n\n");
85+
86+
/* Now print out the sections in a C array. */
87+
fprintf(array_file, "unsigned char module_code[] = {\n\n");
88+
fprintf(array_file, "/* Address Contents */\n\n");
89+
90+
/* Seek to the beginning of the source file. */
91+
fseek(source_file, 0, SEEK_SET);
92+
93+
/* Initialize the variables. */
94+
address = 0;
95+
column = 0;
96+
97+
do
98+
{
99+
100+
/* Get character from the input file. */
101+
alpha = fgetc(source_file);
102+
103+
/* Have we reached EOF? */
104+
if (alpha == EOF)
105+
break;
106+
107+
/* Print out character with a leading comma, except on the first character. */
108+
if (column == 0)
109+
{
110+
if (address != 0)
111+
fprintf(array_file, ",\n");
112+
fprintf(array_file, "/* 0x%08X */ 0x%02X", address, (unsigned int) alpha);
113+
}
114+
else
115+
fprintf(array_file, ", 0x%02X", (unsigned int) alpha);
116+
117+
/* Move column forward. */
118+
column++;
119+
120+
/* Are we at the end of the column? */
121+
if (column >= 16)
122+
{
123+
124+
column = 0;
125+
}
126+
127+
/* Move address forward. */
128+
address++;
129+
} while (alpha != EOF);
130+
131+
/* Finally, finish the C array containing the module code. */
132+
fprintf(array_file, "};\n\n");
133+
134+
/* Close files. */
135+
fclose(source_file);
136+
fclose(array_file);
137+
138+
return 0;
139+
}

0 commit comments

Comments
 (0)