Subversion Repositories HomeAutomation

Rev

Rev 1258 | Rev 1572 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1258 Rev 1259
Line 156... Line 156...
156
	pcints = 0
156
	pcints = 0
157
		
157
		
158
	for moduleName, moduleSection in moduleSections.iteritems():
158
	for moduleName, moduleSection in moduleSections.iteritems():
159
		c = 0
159
		c = 0
160
		for line in moduleSection:
160
		for line in moduleSection:
-
 
161
			if len(line) > 0:
-
 
162
				if line[0] != '#':
-
 
163
					if line.find("<ID>") != -1:
-
 
164
						line = line.replace("<ID>", getFreeModuleId(moduleName))
-
 
165
					elif line.find("<TIMER>") != -1:
-
 
166
						line = line[:line.find("=")+1] + hex(timers) + " /* <TIMER> -- DO NOT REMOVE THIS COMMENT -- */"
-
 
167
						timers += 1
-
 
168
					elif line.find("<PCINT>") != -1:
-
 
169
						line = line[:line.find("=")+1] + hex(pcints) + " /* <PCINT> -- DO NOT REMOVE THIS COMMENT -- */"
-
 
170
						pcints += 1
-
 
171
	
-
 
172
			moduleSection[c] = line;
-
 
173
			c += 1
-
 
174
	
-
 
175
	c = 0
-
 
176
	for line in applicationSection:
-
 
177
		if len(line) > 0:
161
			if line[0] != '#':
178
			if line[0] != '#':
162
				if line.find("<ID>") != -1:
-
 
163
					line = line.replace("<ID>", getFreeModuleId(moduleName))
-
 
164
				elif line.find("<TIMER>") != -1:
179
				if line.find("<TIMER>") != -1:
165
					line = line[:line.find("=")+1] + hex(timers) + " /* <TIMER> -- DO NOT REMOVE THIS COMMENT -- */"
180
					line = line[:line.find("=")+1] + hex(timers) + " /* <TIMER> -- DO NOT REMOVE THIS COMMENT -- */"
166
					timers += 1
181
					timers += 1
-
 
182
				elif line.find("TIMER_NUM_TIMERS=") != -1:
-
 
183
					line = "TIMER_NUM_TIMERS=" + hex(timers)
-
 
184
				elif line.find("NUMBER_OF_MODULES=") != -1:
-
 
185
					line = "NUMBER_OF_MODULES=" + hex(len(modules))
167
				elif line.find("<PCINT>") != -1:
186
				elif line.find("<PCINT>") != -1:
168
					line = line[:line.find("=")+1] + hex(pcints) + " /* <PCINT> -- DO NOT REMOVE THIS COMMENT -- */"
187
					line = line[:line.find("=")+1] + hex(pcints) + " /* <PCINT> -- DO NOT REMOVE THIS COMMENT -- */"
169
					pcints += 1
188
					pcints += 1
170
	
-
 
171
			moduleSection[c] = line;
-
 
172
			c += 1
-
 
173
	
-
 
174
	c = 0
-
 
175
	for line in applicationSection:
-
 
176
		if line[0] != '#':
-
 
177
			if line.find("<TIMER>") != -1:
-
 
178
				line = line[:line.find("=")+1] + hex(timers) + " /* <TIMER> -- DO NOT REMOVE THIS COMMENT -- */"
-
 
179
				timers += 1
-
 
180
			elif line.find("TIMER_NUM_TIMERS=") != -1:
-
 
181
				line = "TIMER_NUM_TIMERS=" + hex(timers)
-
 
182
			elif line.find("NUMBER_OF_MODULES=") != -1:
-
 
183
				line = "NUMBER_OF_MODULES=" + hex(len(modules))
-
 
184
			elif line.find("<PCINT>") != -1:
-
 
185
				line = line[:line.find("=")+1] + hex(pcints) + " /* <PCINT> -- DO NOT REMOVE THIS COMMENT -- */"
-
 
186
				pcints += 1
-
 
187
			elif line.find("PCINT_NUM_PCINTS=") != -1:
189
				elif line.find("PCINT_NUM_PCINTS=") != -1:
188
				line = "PCINT_NUM_PCINTS=" + hex(pcints)
190
					line = "PCINT_NUM_PCINTS=" + hex(pcints)
189
		applicationSection[c] = line;
191
		applicationSection[c] = line;
190
		c += 1
192
		c += 1
191
		
193
		
192
	config_inc = open('config.inc', 'w')
194
	config_inc = open('config.inc', 'w')
193
	
195