Skip to content

Commit

Permalink
Fix nasa#2320, reorganize ES header files
Browse files Browse the repository at this point in the history
Organize ES header file contents according to the convention
  • Loading branch information
jphickey committed May 3, 2023
1 parent 7479d22 commit ca1cf87
Show file tree
Hide file tree
Showing 13 changed files with 1,856 additions and 539 deletions.
32 changes: 32 additions & 0 deletions modules/es/arch_build.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
###########################################################
#
# ES Core Module platform build setup
#
# This file is evaluated as part of the "prepare" stage
# and can be used to set up prerequisites for the build,
# such as generating header files
#
###########################################################

# The list of header files that control the ES configuration
set(ES_PLATFORM_CONFIG_FILE_LIST
cfe_es_internal_cfg.h
cfe_es_msgids.h
cfe_es_platform_cfg.h
)

# Create wrappers around the all the config header files
# This makes them individually overridable by the missions, without modifying
# the distribution default copies
foreach(ES_CFGFILE ${ES_PLATFORM_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${ES_CFGFILE}" NAME_WE)
if (DEFINED ES_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE "${ES_CFGFILE_SRC_${CFGKEY}}")
else()
set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${ES_CFGFILE}")
endif()
generate_config_includefile(
FILE_NAME "${ES_CFGFILE}"
FALLBACK_FILE ${DEFAULT_SOURCE}
)
endforeach()
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@
#ifndef CFE_ES_EXTERN_TYPEDEFS_H
#define CFE_ES_EXTERN_TYPEDEFS_H

/* This header may be generated from an EDS file,
* tools are available and the feature is enabled */
#ifdef CFE_EDS_ENABLED_BUILD

/* Use the EDS generated version of these types */
#include "cfe_es_eds_typedefs.h"

#else
/* Use the local definitions of these types */

#include "common_types.h"
#include "cfe_resourceid_typedef.h"
#include "cfe_mission_cfg.h"
Expand Down Expand Up @@ -387,7 +377,7 @@ typedef uint32 CFE_ES_MemOffset_t;
* A converter macro to use when initializing a CFE_ES_MemOffset_t
* from an integer value of a different type.
*/
#define CFE_ES_MEMOFFSET_C(x) ((CFE_ES_MemOffset_t)(x))
#define CFE_ES_MEMOFFSET_C(x) ((CFE_ES_MemOffset_t)(x))

/**
* @brief Memory Offset to integer value (size_t) wrapper
Expand Down Expand Up @@ -424,15 +414,15 @@ typedef uint32 CFE_ES_MemAddress_t;
* A converter macro to use when initializing a CFE_ES_MemAddress_t
* from a pointer value of a different type.
*/
#define CFE_ES_MEMADDRESS_C(x) ((CFE_ES_MemAddress_t)((cpuaddr)(x)&0xFFFFFFFF))
#define CFE_ES_MEMADDRESS_C(x) ((CFE_ES_MemAddress_t)((cpuaddr)(x)&0xFFFFFFFF))

/**
* @brief Memory Address to pointer wrapper
*
* A converter macro to use when interpreting a CFE_ES_MemAddress_t
* as a pointer value.
*/
#define CFE_ES_MEMADDRESS_TO_PTR(x) ((void *)(cpuaddr)(x))
#define CFE_ES_MEMADDRESS_TO_PTR(x) ((void *)(cpuaddr)(x))

/*
* Data Structures shared between API and Message (CMD/TLM) interfaces
Expand Down Expand Up @@ -574,6 +564,4 @@ typedef struct CFE_ES_MemPoolStats
\brief Contains stats on each block size */
} CFE_ES_MemPoolStats_t;

#endif /* CFE_EDS_ENABLED_BUILD */

#endif /* CFE_ES_EXTERN_TYPEDEFS_H */
Loading

0 comments on commit ca1cf87

Please sign in to comment.