Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sven Greiner
rampinglight
Commits
5292d879
Commit
5292d879
authored
Jan 01, 2019
by
Sven Greiner
Browse files
Add some comments about optimization assumptions and implications
parent
929262aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
rampinglight.c
View file @
5292d879
...
...
@@ -319,6 +319,7 @@ ISR(TIM0_OVF_vect) {
++
ticks
;
}
// This will be called multiple times, but we don't care
if
(
ticks
==
4
)
{
// ~440 ms
fast_presses
=
0
;
}
...
...
@@ -529,6 +530,9 @@ int main(void) {
}
#ifdef LOW_VOLTAGE_PROTECTION
// This condition is true for about 110 ms. If we miss this window, we have
// to wait for the next interval. If the condition is false, it might be
// checked/executed multiple times in the same interval.
if
((
ticks
&
0x7F
)
==
14
)
{
// Every ~14 s starting after ~1.5 s
// TODO Take several measurements for noise filtering?
const
uint8_t
voltage
=
battery_voltage
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment