Browse Source

Adding convenience capability function declarations.

- This makes it easier to define capabilties in any C file
master
Jacob Alexander 8 years ago
parent
commit
296fc5946c
2 changed files with 6 additions and 0 deletions
  1. 2
    0
      backends/kiibohd.py
  2. 4
    0
      templates/kiibohdKeymap.h

+ 2
- 0
backends/kiibohd.py View File

@@ -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'] += "};"


+ 4
- 0
templates/kiibohdKeymap.h View File

@@ -28,6 +28,10 @@

// ----- Capabilities -----

// Capability function declarations
<|CapabilitiesFuncDecl|>


// Indexed Capabilities Table
<|CapabilitiesList|>