Commit ff7c5129 authored by Robert Manzke's avatar Robert Manzke

JSON facilites for processor information

parent 37fa1ccd
......@@ -9,12 +9,14 @@ foreach(VAR ${JSON})
get_filename_component(MYFILE_WITHOUT_EXT ${VAR} NAME_WLE)
message(${MYFILE_WITHOUT_EXT})
bin2h(SOURCE_FILE ${VAR}
HEADER_FILE ${VAR}.h
HEADER_FILE ../gen_include/${MYFILE_WITHOUT_EXT}_JSN.h
VARIABLE_NAME ${MYFILE_WITHOUT_EXT}_JSN
NULL_TERMINATE
)
file(READ ${JSON} JSON_DATA)
sbeParseJson(JSON_DATA_PARSED JSON_DATA)
string(TOUPPER ${MYFILE_WITHOUT_EXT} MYFILE_WITHOUT_EXT_UC)
file(APPEND ../gen_include/${MYFILE_WITHOUT_EXT}_JSN.h "const unsigned char ${MYFILE_WITHOUT_EXT_UC}_ID[] = \"${JSON_DATA_PARSED.id}\\0\"")
message(${JSON_DATA_PARSED.id})
sbeClearJson(example)
endforeach()
......
......@@ -74,7 +74,7 @@ function(BIN2H)
# declares byte array and the length variables
set(arrayDefinition "const unsigned char ${BIN2H_VARIABLE_NAME}[] = { ${arrayValues} };")
set(arraySizeDefinition "const size_t ${BIN2H_VARIABLE_NAME}_SIZE = ${arraySize};")
set(arraySizeDefinition "const unsigned int ${BIN2H_VARIABLE_NAME}_SIZE = ${arraySize};")
set(declarations "${arrayDefinition}\n\n${arraySizeDefinition}\n\n")
if(BIN2H_APPEND)
......@@ -158,7 +158,7 @@ function(BIN2H)
# declares byte array and the length variables
set(arrayDefinition "const unsigned char ${BIN2H_VARIABLE_NAME}[] = { ${arrayValues} };")
set(arraySizeDefinition "const size_t ${BIN2H_VARIABLE_NAME}_SIZE = ${arraySize};")
set(arraySizeDefinition "const unsigned int ${BIN2H_VARIABLE_NAME}_SIZE = ${arraySize};")
set(declarations "${arrayDefinition}\n\n${arraySizeDefinition}\n\n")
if(BIN2H_APPEND)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment