Skip to content

Commit d4089f5

Browse files
author
Bo Chen
committed
Release 6.1.7
1 parent d42808c commit d4089f5

56 files changed

Lines changed: 399 additions & 176 deletions

File tree

Some content is hidden

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

CMakeLists.txt

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ project(levelx
66
LANGUAGES C ASM
77
)
88

9+
option(LX_STANDALONE_ENABLE "Enable LevelX in standalone mode" OFF)
10+
911
if(NOT DEFINED THREADX_ARCH)
1012
message(FATAL_ERROR "Error: THREADX_ARCH not defined")
1113
endif()
@@ -19,14 +21,38 @@ add_library(${PROJECT_NAME})
1921
add_library("azrtos::${PROJECT_NAME}" ALIAS ${PROJECT_NAME})
2022

2123
# Define any required dependencies between this library and others
22-
target_link_libraries(${PROJECT_NAME} PUBLIC
23-
"azrtos::threadx"
24-
"azrtos::filex"
25-
)
24+
if(NOT LX_STANDALONE_ENABLE)
25+
target_link_libraries(${PROJECT_NAME} PUBLIC
26+
"azrtos::threadx")
27+
endif()
28+
29+
# A place for generated/copied include files (no need to change)
30+
set(CUSTOM_INC_DIR ${CMAKE_CURRENT_BINARY_DIR}/custom_inc)
2631

2732
# Pick up the common stuff
2833
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/common)
2934

35+
# Include the user's override file if required
36+
if (NOT LX_USER_FILE)
37+
message(STATUS "Using default lx_user.h file")
38+
set(LX_USER_FILE ${CMAKE_CURRENT_LIST_DIR}/common/inc/lx_user_sample.h)
39+
else()
40+
message(STATUS "Using custom lx_user.h file from ${LX_USER_FILE}")
41+
endif()
42+
configure_file(${LX_USER_FILE} ${CUSTOM_INC_DIR}/lx_user.h COPYONLY)
43+
target_include_directories(${PROJECT_NAME}
44+
PUBLIC
45+
${CUSTOM_INC_DIR}
46+
)
47+
48+
if(NOT LX_STANDALONE_ENABLE)
49+
target_compile_definitions(${PROJECT_NAME} PUBLIC "LX_INCLUDE_USER_DEFINE_FILE" )
50+
else()
51+
# Enable LevelX and FileX standalone support (No Azure RTOS support)
52+
set(FX_STANDALONE_ENABLE ON CACHE BOOL "Standalone enable")
53+
target_compile_definitions(${PROJECT_NAME} PUBLIC "LX_INCLUDE_USER_DEFINE_FILE" -DLX_STANDALONE_ENABLE -DFX_STANDALONE_ENABLE)
54+
endif()
55+
3056
# Enable a build target that produces a ZIP file of all sources
3157
set(CPACK_SOURCE_GENERATOR "ZIP")
3258
set(CPACK_SOURCE_IGNORE_FILES
@@ -39,4 +65,5 @@ set(CPACK_SOURCE_IGNORE_FILES
3965
".*~$"
4066
)
4167
set(CPACK_VERBATIM_VARIABLES YES)
42-
include(CPack)
68+
include(CPack)
69+

common/inc/lx_api.h

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* APPLICATION INTERFACE DEFINITION RELEASE */
2727
/* */
2828
/* lx_api.h PORTABLE C */
29-
/* 6.1.3 */
29+
/* 6.1.7 */
3030
/* AUTHOR */
3131
/* */
3232
/* William E. Lamie, Microsoft Corporation */
@@ -52,6 +52,9 @@
5252
/* 12-31-2020 William E. Lamie Modified comment(s), and */
5353
/* updated product constants, */
5454
/* resulting in version 6.1.3 */
55+
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
56+
/* added standalone support, */
57+
/* resulting in version 6.1.7 */
5558
/* */
5659
/**************************************************************************/
5760

@@ -71,7 +74,9 @@ extern "C" {
7174

7275
/* Include necessary system files. */
7376

77+
#ifndef LX_STANDALONE_ENABLE
7478
#include "tx_api.h"
79+
#endif
7580

7681
/* Determine if the optional LevelX user define file should be used. */
7782

@@ -85,6 +90,65 @@ extern "C" {
8590
#endif
8691

8792

93+
#ifdef LX_STANDALONE_ENABLE
94+
95+
/* Define compiler library include files. */
96+
97+
#include <stdint.h>
98+
#include <stdlib.h>
99+
#include <string.h>
100+
101+
#ifndef VOID
102+
#define VOID void
103+
typedef char CHAR;
104+
typedef char BOOL;
105+
typedef unsigned char UCHAR;
106+
typedef int INT;
107+
typedef unsigned int UINT;
108+
typedef long LONG;
109+
typedef unsigned long ULONG;
110+
typedef short SHORT;
111+
typedef unsigned short USHORT;
112+
#endif
113+
114+
#ifndef ULONG64_DEFINED
115+
#define ULONG64_DEFINED
116+
typedef unsigned long long ULONG64;
117+
#endif
118+
119+
/* Define basic alignment type used in block and byte pool operations. This data type must
120+
be at least 32-bits in size and also be large enough to hold a pointer type. */
121+
122+
#ifndef ALIGN_TYPE_DEFINED
123+
#define ALIGN_TYPE_DEFINED
124+
#define ALIGN_TYPE ULONG
125+
#endif
126+
127+
/* Define the LX_MEMSET macro to the standard library function, if not already defined. */
128+
#ifndef LX_MEMSET
129+
#define LX_MEMSET(a,b,c) memset((a),(b),(c))
130+
#endif
131+
132+
/* Disable usage of ThreadX mutex in standalone mode */
133+
#ifdef LX_THREAD_SAFE_ENABLE
134+
#undef LX_THREAD_SAFE_ENABLE
135+
#endif
136+
137+
#define LX_INTERRUPT_SAVE_AREA
138+
#define LX_DISABLE
139+
#define LX_RESTORE
140+
141+
#else
142+
143+
#define LX_MEMSET TX_MEMSET
144+
145+
#define LX_INTERRUPT_SAVE_AREA TX_INTERRUPT_SAVE_AREA
146+
#define LX_DISABLE TX_DISABLE
147+
#define LX_RESTORE TX_RESTORE
148+
149+
#endif
150+
151+
88152
/* Disable warning of parameter not used. */
89153
#ifndef LX_PARAMETER_NOT_USED
90154
#define LX_PARAMETER_NOT_USED(p) ((void)(p))
@@ -95,7 +159,7 @@ extern "C" {
95159
#define AZURE_RTOS_LEVELX
96160
#define LEVELX_MAJOR_VERSION 6
97161
#define LEVELX_MINOR_VERSION 1
98-
#define LEVELX_PATCH_VERSION 3
162+
#define LEVELX_PATCH_VERSION 7
99163

100164

101165
/* Define general LevelX Constants. */

common/inc/lx_user_sample.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* PORT SPECIFIC C INFORMATION RELEASE */
2727
/* */
2828
/* lx_user.h PORTABLE C */
29-
/* 6.1.2 */
29+
/* 6.1.7 */
3030
/* */
3131
/* AUTHOR */
3232
/* */
@@ -45,6 +45,9 @@
4545
/* DATE NAME DESCRIPTION */
4646
/* */
4747
/* 11-09-2020 William E. Lamie Initial Version 6.1.2 */
48+
/* 06-02-2021 Bhupendra Naphade Modified comment(s), and */
49+
/* added standalone support, */
50+
/* resulting in version 6.1.7 */
4851
/* */
4952
/**************************************************************************/
5053

@@ -113,6 +116,10 @@
113116
#define LX_THREAD_SAFE_ENABLE
114117
*/
115118

119+
/* Defined, LevelX will be used in standalone mode (without Azure RTOS ThreadX) */
120+
121+
/* #define LX_STANDALONE_ENABLE */
122+
116123

117124

118125
#endif

common/src/fx_nand_flash_simulated_driver.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
/* Include necessary system files. */
2525

26-
#include "tx_api.h"
2726
#include "fx_api.h"
2827
#include "lx_api.h"
2928

@@ -69,7 +68,7 @@ VOID _fx_nand_flash_simulator_driver(FX_MEDIA *media_ptr);
6968
/* FUNCTION RELEASE */
7069
/* */
7170
/* _fx_nand_simulator_driver PORTABLE C */
72-
/* 6.1 */
71+
/* 6.1.7 */
7372
/* AUTHOR */
7473
/* */
7574
/* William E. Lamie, Microsoft Corporation */
@@ -122,6 +121,8 @@ VOID _fx_nand_flash_simulator_driver(FX_MEDIA *media_ptr);
122121
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
123122
/* 09-30-2020 William E. Lamie Modified comment(s), */
124123
/* resulting in version 6.1 */
124+
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
125+
/* resulting in version 6.1.7 */
125126
/* */
126127
/**************************************************************************/
127128
VOID _fx_nand_flash_simulator_driver(FX_MEDIA *media_ptr)

common/src/fx_nor_flash_simulator_driver.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
/* Include necessary system files. */
2525

26-
#include "tx_api.h"
2726
#include "fx_api.h"
2827
#include "lx_api.h"
2928

@@ -65,7 +64,7 @@ VOID _fx_nor_flash_simulator_driver(FX_MEDIA *media_ptr);
6564
/* FUNCTION RELEASE */
6665
/* */
6766
/* _fx_nor_flash_simulator_driver PORTABLE C */
68-
/* 6.1 */
67+
/* 6.1.7 */
6968
/* AUTHOR */
7069
/* */
7170
/* William E. Lamie, Microsoft Corporation */
@@ -118,6 +117,8 @@ VOID _fx_nor_flash_simulator_driver(FX_MEDIA *media_ptr);
118117
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
119118
/* 09-30-2020 William E. Lamie Modified comment(s), */
120119
/* resulting in version 6.1 */
120+
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
121+
/* resulting in version 6.1.7 */
121122
/* */
122123
/**************************************************************************/
123124
VOID _fx_nor_flash_simulator_driver(FX_MEDIA *media_ptr)

common/src/lx_nand_flash_256byte_ecc_check.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
/* Disable ThreadX error checking. */
2727

28-
#ifndef TX_DISABLE_ERROR_CHECKING
29-
#define TX_DISABLE_ERROR_CHECKING
28+
#ifndef LX_DISABLE_ERROR_CHECKING
29+
#define LX_DISABLE_ERROR_CHECKING
3030
#endif
3131

3232

@@ -40,7 +40,7 @@
4040
/* FUNCTION RELEASE */
4141
/* */
4242
/* _lx_nand_flash_256byte_ecc_check PORTABLE C */
43-
/* 6.1 */
43+
/* 6.1.7 */
4444
/* AUTHOR */
4545
/* */
4646
/* William E. Lamie, Microsoft Corporation */
@@ -74,6 +74,8 @@
7474
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
7575
/* 09-30-2020 William E. Lamie Modified comment(s), */
7676
/* resulting in version 6.1 */
77+
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
78+
/* resulting in version 6.1.7 */
7779
/* */
7880
/**************************************************************************/
7981
UINT _lx_nand_flash_256byte_ecc_check(UCHAR *page_buffer, UCHAR *ecc_buffer)

common/src/lx_nand_flash_256byte_ecc_compute.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
/* Disable ThreadX error checking. */
2727

28-
#ifndef TX_DISABLE_ERROR_CHECKING
29-
#define TX_DISABLE_ERROR_CHECKING
28+
#ifndef LX_DISABLE_ERROR_CHECKING
29+
#define LX_DISABLE_ERROR_CHECKING
3030
#endif
3131

3232

@@ -40,7 +40,7 @@
4040
/* FUNCTION RELEASE */
4141
/* */
4242
/* _lx_nand_flash_256byte_ecc_compute PORTABLE C */
43-
/* 6.1 */
43+
/* 6.1.7 */
4444
/* AUTHOR */
4545
/* */
4646
/* William E. Lamie, Microsoft Corporation */
@@ -75,6 +75,8 @@
7575
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
7676
/* 09-30-2020 William E. Lamie Modified comment(s), */
7777
/* resulting in version 6.1 */
78+
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
79+
/* resulting in version 6.1.7 */
7880
/* */
7981
/**************************************************************************/
8082
UINT _lx_nand_flash_256byte_ecc_compute(UCHAR *page_buffer, UCHAR *ecc_buffer)

common/src/lx_nand_flash_block_full_update.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
/* Disable ThreadX error checking. */
2727

28-
#ifndef TX_DISABLE_ERROR_CHECKING
29-
#define TX_DISABLE_ERROR_CHECKING
28+
#ifndef LX_DISABLE_ERROR_CHECKING
29+
#define LX_DISABLE_ERROR_CHECKING
3030
#endif
3131

3232

@@ -40,7 +40,7 @@
4040
/* FUNCTION RELEASE */
4141
/* */
4242
/* _lx_nand_flash_block_full_update PORTABLE C */
43-
/* 6.1 */
43+
/* 6.1.7 */
4444
/* AUTHOR */
4545
/* */
4646
/* William E. Lamie, Microsoft Corporation */
@@ -78,6 +78,8 @@
7878
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
7979
/* 09-30-2020 William E. Lamie Modified comment(s), */
8080
/* resulting in version 6.1 */
81+
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
82+
/* resulting in version 6.1.7 */
8183
/* */
8284
/**************************************************************************/
8385
UINT _lx_nand_flash_block_full_update(LX_NAND_FLASH *nand_flash, ULONG block, ULONG erase_count)

common/src/lx_nand_flash_block_obsoleted_check.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
/* Disable ThreadX error checking. */
2727

28-
#ifndef TX_DISABLE_ERROR_CHECKING
29-
#define TX_DISABLE_ERROR_CHECKING
28+
#ifndef LX_DISABLE_ERROR_CHECKING
29+
#define LX_DISABLE_ERROR_CHECKING
3030
#endif
3131

3232

@@ -40,7 +40,7 @@
4040
/* FUNCTION RELEASE */
4141
/* */
4242
/* _lx_nand_flash_block_obsoleted_check PORTABLE C */
43-
/* 6.1 */
43+
/* 6.1.7 */
4444
/* AUTHOR */
4545
/* */
4646
/* William E. Lamie, Microsoft Corporation */
@@ -84,6 +84,8 @@
8484
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
8585
/* 09-30-2020 William E. Lamie Modified comment(s), */
8686
/* resulting in version 6.1 */
87+
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
88+
/* resulting in version 6.1.7 */
8789
/* */
8890
/**************************************************************************/
8991
VOID _lx_nand_flash_block_obsoleted_check(LX_NAND_FLASH *nand_flash, ULONG block)

common/src/lx_nand_flash_block_reclaim.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
/* Disable ThreadX error checking. */
2727

28-
#ifndef TX_DISABLE_ERROR_CHECKING
29-
#define TX_DISABLE_ERROR_CHECKING
28+
#ifndef LX_DISABLE_ERROR_CHECKING
29+
#define LX_DISABLE_ERROR_CHECKING
3030
#endif
3131

3232

@@ -40,7 +40,7 @@
4040
/* FUNCTION RELEASE */
4141
/* */
4242
/* _lx_nand_flash_block_reclaim PORTABLE C */
43-
/* 6.1 */
43+
/* 6.1.7 */
4444
/* AUTHOR */
4545
/* */
4646
/* William E. Lamie, Microsoft Corporation */
@@ -86,6 +86,8 @@
8686
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
8787
/* 09-30-2020 William E. Lamie Modified comment(s), */
8888
/* resulting in version 6.1 */
89+
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
90+
/* resulting in version 6.1.7 */
8991
/* */
9092
/**************************************************************************/
9193
UINT _lx_nand_flash_block_reclaim(LX_NAND_FLASH *nand_flash)

0 commit comments

Comments
 (0)