Skip to content

Commit

Permalink
Release 6.1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxin-azrtos committed Jul 26, 2022
1 parent 54cda6e commit 8c3c08f
Show file tree
Hide file tree
Showing 217 changed files with 13,427 additions and 13,461 deletions.
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,17 @@ endif()
# Pick up the common stuff
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/common)



# Define the FreeRTOS adaptation layer
add_library(freertos-threadx EXCLUDE_FROM_ALL)
target_include_directories(freertos-threadx
PUBLIC
${CMAKE_CURRENT_LIST_DIR}/utility/rtos_compatibility_layers/FreeRTOS
)
target_sources(freertos-threadx
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/utility/rtos_compatibility_layers/FreeRTOS/tx_freertos.c
)
target_link_libraries(freertos-threadx PUBLIC threadx)

# If the user provided an override, copy it to the custom directory
if (NOT TX_USER_FILE)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Azure RTOS provides OEMs with components to secure communication and to create c

# Adaptation layer for ThreadX

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.).
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.).

# Licensing

Expand Down
1 change: 1 addition & 0 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ target_sources(${PROJECT_NAME}

# Add the Common/inc directory to the project include list
target_include_directories(${PROJECT_NAME}
SYSTEM
PUBLIC
${CMAKE_CURRENT_LIST_DIR}/inc
)
Expand Down
7 changes: 5 additions & 2 deletions common/inc/tx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/* APPLICATION INTERFACE DEFINITION RELEASE */
/* */
/* tx_api.h PORTABLE C */
/* 6.1.11 */
/* 6.1.12 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
Expand Down Expand Up @@ -86,6 +86,9 @@
/* optimized the definition of */
/* TX_TIMER_TICKS_PER_SECOND, */
/* resulting in version 6.1.11 */
/* 07-29-2022 Scott Larson Modified comment(s), */
/* update patch number, */
/* resulting in version 6.1.12 */
/* */
/**************************************************************************/

Expand Down Expand Up @@ -122,7 +125,7 @@ extern "C" {
#define AZURE_RTOS_THREADX
#define THREADX_MAJOR_VERSION 6
#define THREADX_MINOR_VERSION 1
#define THREADX_PATCH_VERSION 11
#define THREADX_PATCH_VERSION 12

/* Define the following symbol for backward compatibility */
#define EL_PRODUCT_THREADX
Expand Down
15 changes: 12 additions & 3 deletions common/src/tx_trace_object_register.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/* FUNCTION RELEASE */
/* */
/* _tx_trace_object_register PORTABLE C */
/* 6.1 */
/* 6.1.12 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
Expand Down Expand Up @@ -69,9 +69,12 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 07-29-2022 Scott Larson Modified comment(s), */
/* check for null name, */
/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
VOID _tx_trace_object_register(UCHAR object_type, VOID *object_ptr, CHAR *object_name, ULONG parameter_1, ULONG parameter_2)
Expand Down Expand Up @@ -223,6 +226,12 @@ TX_TRACE_OBJECT_ENTRY *entry_ptr;
work_ptr = TX_CHAR_TO_UCHAR_POINTER_CONVERT(object_name);
work_ptr = TX_UCHAR_POINTER_ADD(work_ptr, i);

/* Determine if object_name (work_ptr) is null. */
if (work_ptr == TX_NULL)
{
break;
}

/* Copy a character of the name. */
entry_ptr -> tx_trace_object_entry_name[i] = (UCHAR) *work_ptr;

Expand Down
139 changes: 139 additions & 0 deletions common_modules/module_manager/utilities/module_binary_to_c_array.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


/* Define the file handles. */

FILE *source_file;
FILE *array_file;


int main(int argc, char* argv[])
{

int alpha;
int alpha1;
int alpha2;
int alpha3;
unsigned long address;
unsigned long column;


/* Determine if the proper number of files are provided. */
if (argc != 3)
{

/* Print an error message out and wait for user key hit. */
printf("module_binary_to_c_array.exe - Copyright (c) Microsoft Corporation v5.8\n");
printf("**** Error: invalid input parameter for module_binary_to_c_array.exe **** \n");
printf(" Command Line Should be:\n\n");
printf(" > module_binary_to_c_array source_binary_file c_array_file <cr> \n\n");
return(1);
}

/* Attempt to open the source file for reading. */
source_file = fopen(argv[1], "rb");

/* Determine if the source file was opened properly. */
if (source_file == NULL)
{

/* Print an error message out and wait for user key hit. */
printf("**** Error: open failed on binary source file **** \n");
printf(" File: %s ", argv[1]);
return(2);
}

/* Determine if the binary file is a valid ThreadX module. */
alpha = fgetc(source_file);
alpha1 = fgetc(source_file);
alpha2 = fgetc(source_file);
alpha3 = fgetc(source_file);

if ((alpha != 0x4D && alpha != 0x55) || (alpha1 != 0x4F && alpha1 != 0x44) || (alpha2 != 0x44 && alpha2 != 0x4F) || (alpha3 != 0x55 && alpha3 != 0x4D))
{

/* Print an error message out and wait for user key hit. */
printf("**** Error: invalid format of binary input file **** \n");
printf(" File: %s ", argv[1]);
return(3);
}

/* Attempt to open the dump file for writing. */
array_file = fopen(argv[2], "w");

/* Determine if the dump file was opened properly. */
if (array_file == NULL)
{

/* Print an error message out and wait for user key hit. */
printf("**** Error: open failed on C array file **** \n");
printf(" File: %s ", argv[2]);
return(4);
}

fprintf(array_file, "/**************************** Module-Binary-to-C-array Utility **********************************/\n");
fprintf(array_file, "/* */\n");
fprintf(array_file, "/* Copyright (c) Microsoft Corporation Version 5.4, build date: 03-01-2018 */\n");
fprintf(array_file, "/* */\n");
fprintf(array_file, "/************************************************************************************************/\n\n");
fprintf(array_file, "/* \n");
fprintf(array_file, " Input Binary file: %30s\n", argv[1]);
fprintf(array_file, " Output C Array file: %30s\n", argv[2]);
fprintf(array_file, "*/\n\n");

/* Now print out the sections in a C array. */
fprintf(array_file, "unsigned char module_code[] = {\n\n");
fprintf(array_file, "/* Address Contents */\n\n");

/* Seek to the beginning of the source file. */
fseek(source_file, 0, SEEK_SET);

/* Initialize the variables. */
address = 0;
column = 0;

do
{

/* Get character from the input file. */
alpha = fgetc(source_file);

/* Have we reached EOF? */
if (alpha == EOF)
break;

/* Print out character with a leading comma, except on the first character. */
if (column == 0)
{
if (address != 0)
fprintf(array_file, ",\n");
fprintf(array_file, "/* 0x%08X */ 0x%02X", address, (unsigned int) alpha);
}
else
fprintf(array_file, ", 0x%02X", (unsigned int) alpha);

/* Move column forward. */
column++;

/* Are we at the end of the column? */
if (column >= 16)
{

column = 0;
}

/* Move address forward. */
address++;
} while (alpha != EOF);

/* Finally, finish the C array containing the module code. */
fprintf(array_file, "};\n\n");

/* Close files. */
fclose(source_file);
fclose(array_file);

return 0;
}
Loading

0 comments on commit 8c3c08f

Please sign in to comment.