Rev 1106 | Rev 1126 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1106 | Rev 1125 | ||
|---|---|---|---|
| Line 151... | Line 151... | ||
| 151 | 151 | ||
| 152 | if len(moduleSections[moduleName]) <= 1: |
152 | if len(moduleSections[moduleName]) <= 1: |
| 153 | moduleSections[moduleName] = readConfigSection(localmoddir + "/" + moduleName + "/config.inc.template", moduleName) |
153 | moduleSections[moduleName] = readConfigSection(localmoddir + "/" + moduleName + "/config.inc.template", moduleName) |
| 154 | 154 | ||
| 155 | timers = 0 |
155 | timers = 0 |
| - | 156 | pcints = 0 |
|
| 156 | 157 | ||
| 157 | for moduleName, moduleSection in moduleSections.iteritems(): |
158 | for moduleName, moduleSection in moduleSections.iteritems(): |
| 158 | c = 0 |
159 | c = 0 |
| 159 | for line in moduleSection: |
160 | for line in moduleSection: |
| 160 | if line.find("<ID>") != -1: |
161 | if line.find("<ID>") != -1: |
| 161 | line = line.replace("<ID>", getFreeModuleId(moduleName)) |
162 | line = line.replace("<ID>", getFreeModuleId(moduleName)) |
| 162 | elif line.find("<TIMER>") != -1: |
163 | elif line.find("<TIMER>") != -1: |
| 163 | line = line[:line.find("=")+1] + hex(timers) + " /* <TIMER> -- DO NOT REMOVE THIS COMMENT -- */" |
164 | line = line[:line.find("=")+1] + hex(timers) + " /* <TIMER> -- DO NOT REMOVE THIS COMMENT -- */" |
| 164 | timers += 1 |
165 | timers += 1 |
| - | 166 | elif line.find("<PCINT>") != -1: |
|
| - | 167 | line = line[:line.find("=")+1] + hex(timers) + " /* <PCINT> -- DO NOT REMOVE THIS COMMENT -- */" |
|
| - | 168 | pcints += 1 |
|
| 165 | 169 | ||
| 166 | moduleSection[c] = line; |
170 | moduleSection[c] = line; |
| 167 | c += 1 |
171 | c += 1 |
| 168 | 172 | ||
| 169 | c = 0 |
173 | c = 0 |
| Line 173... | Line 177... | ||
| 173 | timers += 1 |
177 | timers += 1 |
| 174 | elif line.find("TIMER_NUM_TIMERS=") != -1: |
178 | elif line.find("TIMER_NUM_TIMERS=") != -1: |
| 175 | line = "TIMER_NUM_TIMERS=" + hex(timers) |
179 | line = "TIMER_NUM_TIMERS=" + hex(timers) |
| 176 | elif line.find("NUMBER_OF_MODULES=") != -1: |
180 | elif line.find("NUMBER_OF_MODULES=") != -1: |
| 177 | line = "NUMBER_OF_MODULES=" + hex(len(modules)) |
181 | line = "NUMBER_OF_MODULES=" + hex(len(modules)) |
| - | 182 | elif line.find("<PCINT>") != -1: |
|
| - | 183 | line = line[:line.find("=")+1] + hex(pcints) + " /* <PCINT> -- DO NOT REMOVE THIS COMMENT -- */" |
|
| 178 | 184 | pcints += 1 |
|
| - | 185 | elif line.find("PCINT_NUM_PCINTS=") != -1: |
|
| - | 186 | line = "PCINT_NUM_PCINTS=" + hex(pcints) |
|
| 179 | applicationSection[c] = line; |
187 | applicationSection[c] = line; |
| 180 | c += 1 |
188 | c += 1 |
| 181 | 189 | ||
| 182 | config_inc = open('config.inc', 'w') |
190 | config_inc = open('config.inc', 'w') |
| 183 | 191 | ||