Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/ttboard/demoboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,11 @@ def clock_project_PWM(self, freqHz:int, duty_u16:int=(0xffff/2)):
'''
Start an automatic clock for the selected project (using
PWM).
@param freqHz: The frequency of the clocking, in Hz
@param freqHz: The frequency of the clocking, in Hz, or 0 to disable PWM
@param duty_u16: Optional duty cycle (0-0xffff), defaults to 50%
'''
self.clock_project_stop()
if freqHz < 1: # equiv to stop
return
try:
self._clock_pwm = self.project_clk.pwm(freqHz, duty_u16)
self._clock_pwm = self.pins.rp_projclk.pwm(freqHz, duty_u16)
except Exception as e:
log.error(f"Could not set project clock PWM: {e}")
return self._clock_pwm
Expand All @@ -202,8 +199,7 @@ def clock_project_stop(self):
if self._clock_pwm is None:
return

self._clock_pwm.deinit()
self._clock_pwm = None
self.clock_project_PWM(0)


def apply_user_config(self, design:Design):
Expand Down