summaryrefslogtreecommitdiff
path: root/tests/pyb/timer.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-10-31 12:49:18 +1100
committerDamien George <damien.p.george@gmail.com>2019-10-31 12:49:18 +1100
commit9ec73aedb4fedafce93a018c26cfbc79686be34b (patch)
treeea19043d155b3aaeebf6fdead9ba1f815bdd221e /tests/pyb/timer.py
parent4e1b03d45c4d6be9ad9615f63a1146c46a4136d7 (diff)
stm32/timer: Fix Timer.freq() calc so mult doesn't overflow uint32_t.
Fixes issue #5280.
Diffstat (limited to 'tests/pyb/timer.py')
-rw-r--r--tests/pyb/timer.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/pyb/timer.py b/tests/pyb/timer.py
index 61320690a..e83550abd 100644
--- a/tests/pyb/timer.py
+++ b/tests/pyb/timer.py
@@ -11,3 +11,9 @@ tim.prescaler(300)
print(tim.prescaler())
tim.period(400)
print(tim.period())
+
+# Setting and printing frequency
+tim = Timer(2, freq=100)
+print(tim.freq())
+tim.freq(0.001)
+print(tim.freq())