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
da6e32d8
Commit
da6e32d8
authored
Dec 23, 2018
by
Sven Greiner
Browse files
Make battcheck optional via define
parent
a90896ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
rampinglight.c
View file @
da6e32d8
...
...
@@ -15,6 +15,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Optional features
//#define BATTCHECK
#include
<avr/io.h>
#include
<util/delay.h>
#include
<avr/interrupt.h>
...
...
@@ -55,8 +58,10 @@ enum State {
kFrozen
,
// Frozen ramping level
kTurbo
,
// Full power
kFixed
,
// Fixed mode
kBattcheck
,
// Battery level
kConfig
,
// Config menu
#ifdef BATTCHECK
kBattcheck
,
// Battery level
#endif // ifdef BATTCHECK
};
/**
...
...
@@ -327,9 +332,11 @@ int main(void) {
// Input handling
if
(
options
.
fixed_mode
)
{
switch
(
fast_presses
)
{
#ifdef BATTCHECK
case
FIXED_SIZE
+
1
:
state
=
kBattcheck
;
break
;
#endif // ifdef BATTCHECK
case
10
:
state
=
kConfig
;
...
...
@@ -347,9 +354,11 @@ int main(void) {
state
=
kTurbo
;
break
;
#ifdef BATTCHECK
case
3
:
state
=
kBattcheck
;
break
;
#endif // ifdef BATTCHECK
case
10
:
state
=
kConfig
;
...
...
@@ -422,10 +431,12 @@ int main(void) {
case
kFixed
:
break
;
#ifdef BATTCHECK
case
kBattcheck
:
// TODO
blink
(
20
,
1000
/
20
);
break
;
#endif // ifdef BATTCHECK
case
kConfig
:
set_level
(
0
);
...
...
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