Skip to content

Commit 78b711f

Browse files
committed
better behaved project mux, find function, default config for demos
1 parent b25632f commit 78b711f

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

src/config.ini

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ input_byte = 0b11001000
5757
mode = ASIC_RP_CONTROL
5858

5959

60+
[wokwi_7seg_tiny_tapeout_display]
61+
rp_clock_frequency = 50_000_000
62+
clock_frequency = 5
63+
mode = ASIC_RP_CONTROL
64+
65+
[tt_um_seven_segment_seconds]
66+
rp_clock_frequency = 120e6
67+
clock_frequency = 10e6
68+
input_byte = 0
69+
mode = ASIC_RP_CONTROL
70+
71+
6072

6173

6274
[tt_um_loopback]

src/ttboard/project_mux.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self, projectMux, projindex:int, info:dict):
3535
if self.name.startswith('tt_um_wokwi') and 'title' in info and len(info['title']):
3636
new_name = self.SpaceCharsRe.sub('_', self.BadCharsRe.sub('', info['title'])).lower()
3737
if len(new_name):
38-
self.name = f'tt_um_wokwi_{new_name}'
38+
self.name = f'wokwi_{new_name}'
3939

4040
self._all = info
4141

@@ -84,11 +84,11 @@ def count(self):
8484

8585
@property
8686
def names(self):
87-
return self._shuttle_index.keys()
87+
return sorted(self._shuttle_index.keys())
8888

8989
@property
9090
def all(self):
91-
return self._shuttle_index.values()
91+
return sorted(self._shuttle_index.values(), key=lambda p: p.name)
9292

9393
def get(self, project_name:str) -> Design:
9494
if project_name in self._shuttle_index:
@@ -226,6 +226,9 @@ def has(self, project_name:str):
226226
def get(self, project_name:str) -> Design:
227227
return getattr(self.projects, project_name)
228228

229+
def find(self, search:str) -> list:
230+
return list(filter(lambda p: p.name.find(search) >= 0, self.all))
231+
229232
def __getattr__(self, name):
230233
if hasattr(self, 'projects') and hasattr(self.projects, name):
231234
return getattr(self.projects, name)
@@ -236,7 +239,11 @@ def __getitem__(self, key) -> Design:
236239
return self.projects[key]
237240
raise None
238241

242+
243+
def __str__(self):
244+
return f'Shuttle {self.run}\n{self.all}'
245+
239246
def __repr__(self):
240247
des_idx = self.projects
241-
return f'<ProjectMux with {len(des_idx)} projects>'
248+
return f'<ProjectMux for {self.run} with {len(des_idx)} projects>'
242249

0 commit comments

Comments
 (0)