command: Add command.h file to make importing Klipper code easier
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
1 parent
db6a9b4d96
commit
83ecbcc01d
6 files changed
+26
-21
No files matched your search
@@ -35,24 +35,4 @@
|
||||
__section(".compile_time_request") = { \
|
||||
(REQUEST), { args }, 0 }
|
||||
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
* Useful CTR macros from Klipper's command.h
|
||||
*
|
||||
*******************************************************************/
|
||||
|
||||
// Declare a constant exported to the host
|
||||
#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, 1, CTR_INT(VALUE))
|
||||
#define DECL_ENUMERATION_RANGE(ENUM, NAME, VALUE, COUNT) \
|
||||
DECL_CTR_INT("DECL_ENUMERATION_RANGE " ENUM " " NAME, \
|
||||
2, CTR_INT(VALUE), CTR_INT(COUNT))
|
||||
|
||||
#endif // ctr.h
|
||||
Reference in new issue
Block a user