Skip to content

Commit

Permalink
Adding --enable-capv2 option
Browse files Browse the repository at this point in the history
- Incrementing to 0.5.7.13
- Needed to support bitwidth change of states
  • Loading branch information
haata committed Jun 15, 2019
1 parent ff9f602 commit c8df5e2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kll/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

## Variables

__version__ = '0.5.7.12'
__version__ = '0.5.7.13'
kll_name = 'kll'

# This is updated whenever there is a KLL language breaking behaviour
Expand Down
16 changes: 14 additions & 2 deletions kll/emitters/kiibohd/kiibohd.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def __init__(self, control):
self.def_output = "kll_defs.h"
self.json_output = "kll.json"
self.kiibohd_debug = False
self.enable_capv2 = False

# Convenience
self.capabilities = None
Expand Down Expand Up @@ -162,6 +163,7 @@ def command_line_args(self, args):
self.pixel_output = args.pixel_output
self.json_output = args.json_output
self.kiibohd_debug = args.kiibohd_debug
self.enable_capv2 = args.enable_capv2

def command_line_flags(self, parser):
'''
Expand Down Expand Up @@ -214,6 +216,12 @@ def command_line_flags(self, parser):
default=self.kiibohd_debug,
help="Show debug info from kiibohd emitter.",
)
group.add_argument(
'--enable-capv2',
action='store_true',
default=self.enable_capv2,
help="Enable v2 of capabilities (requires firmware support).",
)

def check_file(self, filepath):
'''
Expand Down Expand Up @@ -1043,8 +1051,12 @@ def get_context_name(context_type, contexts=None):
count,
dkey,
)
self.fill_dict['CapabilitiesFuncDecl'] += \
"void {0}( TriggerMacro *trigger, uint8_t state, uint8_t stateType, uint8_t *args );\n".format(funcName)
if self.enable_capv2:
self.fill_dict['CapabilitiesFuncDecl'] += \
"void {0}( TriggerMacro *trigger, uint16_t state, uint8_t stateType, uint8_t *args );\n".format(funcName)
else:
self.fill_dict['CapabilitiesFuncDecl'] += \
"void {0}( TriggerMacro *trigger, uint8_t state, uint8_t stateType, uint8_t *args );\n".format(funcName)
self.fill_dict['CapabilitiesIndices'] += "\t{0}_index,\n".format(funcName)

# Add to json
Expand Down

0 comments on commit c8df5e2

Please sign in to comment.