Adding convenience capability function declarations.
- This makes it easier to define capabilties in any C file
This commit is contained in:
parent
5f8880d7ef
commit
296fc5946c
@ -129,6 +129,7 @@ class Backend( BackendBase ):
|
||||
|
||||
|
||||
## Capabilities ##
|
||||
self.fill_dict['CapabilitiesFuncDecl'] = ""
|
||||
self.fill_dict['CapabilitiesList'] = "const Capability CapabilitiesList[] = {\n"
|
||||
|
||||
# Keys are pre-sorted
|
||||
@ -136,6 +137,7 @@ class Backend( BackendBase ):
|
||||
funcName = capabilities.funcName( key )
|
||||
argByteWidth = capabilities.totalArgBytes( key )
|
||||
self.fill_dict['CapabilitiesList'] += "\t{{ {0}, {1} }},\n".format( funcName, argByteWidth )
|
||||
self.fill_dict['CapabilitiesFuncDecl'] += "void {0}( uint8_t state, uint8_t stateType, uint8_t *args );\n".format( funcName )
|
||||
|
||||
self.fill_dict['CapabilitiesList'] += "};"
|
||||
|
||||
|
@ -28,6 +28,10 @@
|
||||
|
||||
// ----- Capabilities -----
|
||||
|
||||
// Capability function declarations
|
||||
<|CapabilitiesFuncDecl|>
|
||||
|
||||
|
||||
// Indexed Capabilities Table
|
||||
<|CapabilitiesList|>
|
||||
|
||||
|
Reference in New Issue
Block a user