Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rampinglight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sven Greiner
rampinglight
Commits
8e10de3c
Commit
8e10de3c
authored
6 years ago
by
Sven Greiner
Browse files
Options
Downloads
Patches
Plain Diff
Define strobe pattern names
parent
8d0c1e8c
No related branches found
Tags
archived/strobe-mode-v2
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rampinglight.c
+22
-12
22 additions, 12 deletions
rampinglight.c
with
22 additions
and
12 deletions
rampinglight.c
+
22
−
12
View file @
8e10de3c
...
...
@@ -43,6 +43,7 @@
#define RAMP_SIZE sizeof(ramp_values)
#define RAMP_VALUES 5,5,5,5,5,6,6,6,6,7,7,8,8,9,10,11,12,13,14,15,17,18,20,22,23,25,28,30,32,35,38,41,44,47,51,55,59,63,67,71,76,81,86,92,97,103,109,116,122,129,136,144,151,159,167,176,185,194,203,213,223,233,244,255
#define TURBO_PWM 255
#define BEACON_PWM 5
#define FIXED_SIZE sizeof(fixed_values)
#define FIXED_VALUES 5,35,118,255
...
...
@@ -59,6 +60,10 @@
#define STROBE_PRESSES FIXED_SIZE+2
#define CONFIG_PRESSES 10
#define STROBE_PATTERN_BEACON 1
#define STROBE_PATTERN_FAST 2
#define STROBE_PATTERN_SIZE STROBE_PATTERN_FAST
/**
* Fuses for ATtiny13
*/
...
...
@@ -411,7 +416,7 @@ int main(void) {
#ifdef STROBE
case
STROBE_PRESSES
:
state
=
kStrobe
;
output
=
1
;
// First strobe pattern
output
=
STROBE_PATTERN_BEACON
;
break
;
#endif // ifdef STROBE
...
...
@@ -439,7 +444,7 @@ int main(void) {
#ifdef STROBE
case
kStrobe
:
output
=
(
output
%
2
)
+
1
;
output
=
(
output
%
STROBE_PATTERN_SIZE
)
+
1
;
break
;
#endif // ifdef STROBE
...
...
@@ -524,16 +529,21 @@ int main(void) {
#ifdef STROBE
case
kStrobe
:
set_pwm
(
TURBO_PWM
);
if
(
output
==
1
)
{
blink
(
2
,
3
);
set_level
(
1
);
delay_s
();
delay_s
();
}
else
{
enable_output
();
delay_10ms
(
2
);
disable_output
();
delay_10ms
(
4
);
switch
(
output
)
{
case
STROBE_PATTERN_BEACON
:
blink
(
2
,
3
);
set_pwm
(
BEACON_PWM
);
delay_s
();
delay_s
();
break
;
case
STROBE_PATTERN_FAST
:
default:
enable_output
();
delay_10ms
(
2
);
disable_output
();
delay_10ms
(
4
);
break
;
}
break
;
#endif // ifdef STROBE
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment