Commit b55edff
authored
Adds support for also running on NRF52 targets (#291)
* Fix problem of transitions getting faster with each call of setTargetFPS
On my app I noticed that each time I called setTargetFPS the transitions
would become faster and faster, until finally they don't even take one
frame. The problem was that the FP math for calculating changeRatio
would (because of rounding err) keep shrinking the number of ticksPerFrame.
This change instead computs ticksPerFrame/perTransition based on the
requested display time, so error can't accumulate from a series of calls.
(In my app I only bump up target FPS before each transition but then
I lower it down again afterwards to save CPU)
* Allow this library to work on other Arduinos (NRF52) besides ESPs
* Let users specify -1 for scl/sda to mean 'use current value'
(Also makes it easier to share code when users of library are targeting
multiple platforms)
* fix missing dependency, std::max is defined in algorithm1 parent 44379c3 commit b55edff
2 files changed
+15
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
46 | | - | |
| 46 | + | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| |||
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| |||
175 | 178 | | |
176 | 179 | | |
177 | 180 | | |
178 | | - | |
| 181 | + | |
179 | 182 | | |
180 | 183 | | |
181 | 184 | | |
| |||
0 commit comments