SP8EBC-ParaTNC/include/kiss_communication/kiss_xmacro_helpers.h

42 wiersze
1.2 KiB
C

/*
* kiss_xmacro_helpers.h
*
* Created on: Jun 21, 2023
* Author: mateusz
*/
#ifndef KISS_XMACRO_HELPERS_H_
#define KISS_XMACRO_HELPERS_H_
/**
* This macro is used to define DIDs which return integer values
*/
#define DID_NUMERIC_DEFINITION_EXPANDER(id, first_data_pointer, second_data_pointer, third_data_pointer) \
{ \
.identifier = id, \
.first_data = (void*)first_data_pointer, \
.first_data_size = sizeof(first_data_pointer), \
.second_data = (void*)second_data_pointer, \
.second_data_size = sizeof(second_data_pointer), \
.third_data = (void*)third_data_pointer, \
.third_data_size = sizeof(third_data_pointer) \
},
/**
* Macro to define DID which return float data. Require separate handling as a size
* of single precision float number is the same than 32 bit integer
*/
#define DID_NUMERIC_FLOAT_DEFINITION_EXPANDER(id, first_data_pointer, second_data_pointer, third_data_pointer) \
{ \
.identifier = id, \
.first_data = (void*)first_data_pointer, \
.first_data_size = 0, \
.second_data = (void*)second_data_pointer, \
.second_data_size = 0, \
.third_data = (void*)third_data_pointer, \
.third_data_size = 0 \
},
#endif /* KISS_XMACRO_HELPERS_H_ */