From 9ec73aedb4fedafce93a018c26cfbc79686be34b Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 31 Oct 2019 12:49:18 +1100 Subject: stm32/timer: Fix Timer.freq() calc so mult doesn't overflow uint32_t. Fixes issue #5280. --- tests/pyb/timer.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/pyb/timer.py') 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()) -- cgit v1.2.3