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:Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Loading
Please sign in to comment