ctr: Add support for multiple integers in DECL_CTR_INT

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2019-08-22 12:12:21 -04:00
parent 1b83fb72f5
commit 84fd89b8cf
3 changed files with 24 additions and 20 deletions

View File

@@ -16,17 +16,17 @@
#define HF_IN_SHUTDOWN 0x01 // Handler can run even when in emergency stop
// Declare a constant exported to the host
#define DECL_CONSTANT(NAME, VALUE) \
DECL_CTR_INT("_DECL_CONSTANT " NAME, (VALUE))
#define DECL_CONSTANT(NAME, VALUE) \
DECL_CTR_INT("_DECL_CONSTANT " NAME, 1, CTR_INT(VALUE))
#define DECL_CONSTANT_STR(NAME, VALUE) \
DECL_CTR("_DECL_CONSTANT_STR " NAME " " VALUE)
// Declare an enumeration
#define DECL_ENUMERATION(ENUM, NAME, VALUE) \
DECL_CTR_INT("_DECL_ENUMERATION " ENUM " " NAME, (VALUE))
#define DECL_ENUMERATION(ENUM, NAME, VALUE) \
DECL_CTR_INT("_DECL_ENUMERATION " ENUM " " NAME, 1, CTR_INT(VALUE))
#define DECL_ENUMERATION_RANGE(ENUM, NAME, VALUE, COUNT) \
DECL_CTR_INT("_DECL_ENUMERATION_RANGE " ENUM " " NAME \
" " __stringify(COUNT), (VALUE))
" " __stringify(COUNT), 1, CTR_INT(VALUE))
// Send an output message (and declare a static message type for it)
#define output(FMT, args...) \