changeset 75:2f849ba7c91c

added print stateWordSize from value when changing, removed regular count prints
author CryHam <cryham@gmail.com>
date Sun, 08 May 2016 09:07:06 +0200
parents 1ba1148e0124
children 91f032304beb
files backends/kiibohd.py
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/backends/kiibohd.py	Sat May 07 21:40:04 2016 +0200
+++ b/backends/kiibohd.py	Sun May 08 09:07:06 2016 +0200
@@ -219,7 +219,6 @@
 		self.fill_dict['ResultMacroList'] += "};"
 		
 		results_count = len( macros.resultsIndexSorted );
-		print( "Results count: ", results_count )
 
 
 		## Result Macro Record ##
@@ -230,7 +229,7 @@
 		self.fill_dict['TriggerMacros'] = ""
 
 		# Iterate through each of the trigger macros
-		triggers_count = 0;
+		triggers_count = len( macros.triggersIndexSorted );
 		for trigger in range( 0, len( macros.triggersIndexSorted ) ):
 			self.fill_dict['TriggerMacros'] += "Guide_TM( {0} ) = {{ ".format( trigger )
 
@@ -251,17 +250,16 @@
 					# TODO Add support for Analog keys
 					# TODO Add support for LED states
 					self.fill_dict['TriggerMacros'] += "0x00, 0x01, 0x{0:02X}, ".format( triggerItem )
-					triggers_count += 1
 
 			# Add list ending 0 and end of list
 			self.fill_dict['TriggerMacros'] += "0 };\n"
 		self.fill_dict['TriggerMacros'] = self.fill_dict['TriggerMacros'][ :-1 ] # Remove last newline
 
-		print( "Triggers count:", triggers_count )
-
 		# check for too small stateWordSize
 		if stateWordSize == "8" and (triggers_count > 255 or results_count > 255):
-			print ("{0} Over 255 trigger or result macros, changing stateWordSize to 16.".format( WARNING ) )
+			print ("{0} Over 255 trigger or result macros, changing stateWordSize from {1} to 16.".format( WARNING, stateWordSize ) )
+			print( "Results count: ", results_count )
+			print( "Triggers count:", triggers_count )
 			stateWordSize == "16"
 			self.fill_dict['Defines'] = self.fill_dict['Defines'].replace("StateWordSize_define 8", "StateWordSize_define 16")
 			#print (self.fill_dict['Defines'])