Skip to content
Commit 6e8132d1 authored by Andrzej Głąbek's avatar Andrzej Głąbek Committed by Maureen Helm
Browse files

samples: blink_led: Fix the behavior of the sample



Commit 16d8ce51 introduced changes
that caused this sample to no longer behave according to documentation
and for some hardware to no longer work at all.
On nRF51 SoCs for instance, the reported number of cycles per second
is 16M, what makes the calculated max_period and min_period to be 16
and 0 microseconds, respectively, what effectively makes it impossible
for the sample to return to the initial blinking frequency. Moreover,
with such short PWM periods, the blinking is not even noticeable.

This patch partially reverts the changes mentioned above, and instead
of calculating max_period and min_period basing on the reported clock
rate, it tries to only decrease the max_period if needed, accordingly
to what the used hardware can handle.
Documentation is also updated to mention the possible change in
observed behavior of the sample on some hardware.

Signed-off-by: default avatarAndrzej Głąbek <andrzej.glabek@nordicsemi.no>
parent 44841646
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment