Skip to content

Commit aec6843

Browse files
committed
demoboard bugfix and better pmux dir
1 parent 207f54c commit aec6843

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/ttboard/demoboard.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ def clk(self):
237237
return self._clock_pwm
238238
return self.pins.rp_projclk
239239

240+
241+
240242
@property
241243
def rst_n(self):
242244
'''
@@ -324,7 +326,7 @@ def clock_project_PWM(self, freqHz:int, duty_u16:int=(0xffff/2), quiet:bool=Fals
324326
self._clock_pwm_deinit()
325327

326328
if self._clock_pio is None:
327-
self._clock_pio = platform.PIOClock(self.rp_projclk.raw_pin)
329+
self._clock_pio = platform.PIOClock(self.pins.rp_projclk.raw_pin)
328330

329331
self._clock_pio.start(freqHz)
330332
log.info(f"Clocking at {freqHz}Hz using PIO clock")

src/ttboard/project_mux.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def all(self):
154154
'''
155155
all available projects in the shuttle, whether loaded or not
156156
'''
157-
return list(map(lambda p: DesignStub(self, p), sorted(self._available_projects.keys())))
157+
return list(map(lambda p: self._shuttle_index[p] if p in self._shuttle_index else DesignStub(self, p), sorted(self._available_projects.keys())))
158158
@property
159159
def all_loaded(self):
160160
'''
@@ -372,10 +372,14 @@ def __getitem__(self, key) -> Design:
372372
raise None
373373

374374
def __dir__(self):
375-
# this doesn't seem to do what I want in uPython?
375+
names = []
376376
if hasattr(self, 'projects'):
377-
return self.projects.names
378-
return []
377+
names = self.projects.names
378+
379+
return sorted(set(
380+
list(dir(type(self))) + \
381+
list(self.__dict__.keys()) + names))
382+
379383

380384

381385
def __len__(self):

0 commit comments

Comments
 (0)