Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL Blocking
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv TTL Blocking
Commits
616dae19
Commit
616dae19
authored
Feb 07, 2017
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pulsegen: Emit at least the requested number of pulses when rounding
parent
4165734a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
pulsegen.py
software/utils/pulsegen.py
+2
-2
No files found.
software/utils/pulsegen.py
View file @
616dae19
...
...
@@ -118,7 +118,7 @@ class PulseGen:
# deal with the limitation described above
# number of pulses in the arbitrary waveform
div
=
int
(
math
.
floor
(
count
/
self
.
MAX_PULSE_COUNT
))
+
1
div
=
math
.
ceil
(
count
/
self
.
MAX_PULSE_COUNT
)
period
=
1.0
/
freq
if
width
>
period
*
0.9
:
...
...
@@ -142,7 +142,7 @@ class PulseGen:
# update all variables basing on the divider
freq
=
freq
/
div
count
=
int
(
count
/
div
)
count
=
math
.
ceil
(
count
/
div
)
width
=
duty_cycle
*
period
# the actual number of pulses is rounded to the number of pulses in
# the arbitrary waveform
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment